summaryrefslogtreecommitdiff
path: root/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'service.c')
-rw-r--r--service.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/service.c b/service.c
new file mode 100644
index 0000000..20ccf14
--- /dev/null
+++ b/service.c
@@ -0,0 +1,71 @@
+/*
+ * service.c: EPG2VDR plugin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
+#include "service.h"
+#include "plgconfig.h"
+
+//***************************************************************************
+// Class cEpgTimer
+//***************************************************************************
+
+cEpgTimer::cEpgTimer(bool Instant, bool Pause, const cChannel* Channel)
+ : cEpgTimer_Interface_V1(Instant, Pause, Channel)
+{
+ timerid = na; eventid = na;
+ vdrName = 0; vdrUuid = 0;
+ vdrRunning = no;
+ stateInfo = 0;
+ local = yes;
+}
+
+cEpgTimer::~cEpgTimer()
+{
+ free(vdrUuid);
+ free(vdrName);
+ free(stateInfo);
+}
+
+void cEpgTimer::setState(char s, const char* info)
+{
+ state = s;
+ free(stateInfo);
+ stateInfo = 0;
+
+ if (!isEmpty(info))
+ stateInfo = strdup(info);
+}
+
+void cEpgTimer::setAction(char a)
+{
+ action = a;
+}
+
+void cEpgTimer::setVdr(const char* name, const char* uuid, int running)
+{
+ local = yes; // the default
+ free(vdrUuid);
+ free(vdrName);
+ vdrName = strdup(name);
+
+ if (!isEmpty(uuid))
+ vdrUuid = strdup(uuid);
+
+ vdrRunning = running;
+
+ if (!isEmpty(vdrUuid) && strcmp(vdrUuid, Epg2VdrConfig.uuid) != 0)
+ local = no;
+}
+
+//***************************************************************************
+// Class cEpgEvent
+//***************************************************************************
+
+cEpgEvent::cEpgEvent(tEventID EventID)
+ : cEpgEvent_Interface_V1(EventID)
+{
+
+}