summaryrefslogtreecommitdiff
path: root/epgelement.c
diff options
context:
space:
mode:
Diffstat (limited to 'epgelement.c')
-rw-r--r--epgelement.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/epgelement.c b/epgelement.c
new file mode 100644
index 0000000..1ef5542
--- /dev/null
+++ b/epgelement.c
@@ -0,0 +1,52 @@
+#include "switchtimer.h"
+#include "services/remotetimers.h"
+#include "epgelement.h"
+
+cEpgElement::cEpgElement(const cEvent *event, cChannelEpg *owner) : cGridElement(owner) {
+ this->event = event;
+ hasTimer = false;
+ SetTimer();
+ hasSwitchTimer = false;
+ SetSwitchTimer();
+ dummy = false;
+}
+
+cEpgElement::~cEpgElement(void) {
+}
+
+void cEpgElement::SetTimer() {
+ if (config.useRemoteTimers && pRemoteTimers) {
+ RemoteTimers_Event_v1_0 rt;
+ rt.event = event;
+ if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt))
+ hasTimer = true;
+ else
+ hasTimer = false;
+ } else if (owner->HasTimer()) {
+ hasTimer = event->HasTimer();
+ } else {
+ hasTimer = false;
+ }
+}
+
+void cEpgElement::SetSwitchTimer() {
+ if (owner->HasSwitchTimer()) {
+ hasSwitchTimer = SwitchTimers.EventInSwitchList(event);
+ } else {
+ hasSwitchTimer = false;
+ }
+}
+
+const char *cEpgElement::Title(void) {
+ return event->Title();
+}
+
+const char *cEpgElement::ShortText(void) {
+ if (event->ShortText())
+ return event->ShortText();
+ return "";
+}
+
+void cEpgElement::Debug() {
+ esyslog("tvguideng: epgelement %ld: \"%s\" %s - %s, channel %s, timer: %d", id, event->Title(), *(event->GetTimeString()), *(event->GetEndTimeString()), Channel()->Name(), hasTimer);
+}