summaryrefslogtreecommitdiff
path: root/epghandler.c
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2012-05-23 21:36:14 +0200
committerDimitar Petrovski <dimeptr@gmail.com>2012-05-23 21:36:14 +0200
commit61eded224bc4660b41f6754e83b91a262af3f8ce (patch)
tree34c06a64e23d1ae7c6a87a79769344cae972b52c /epghandler.c
parentfeee46aeed74157e104335918741f266fd576f29 (diff)
downloadvdr-plugin-eepg-61eded224bc4660b41f6754e83b91a262af3f8ce.tar.gz
vdr-plugin-eepg-61eded224bc4660b41f6754e83b91a262af3f8ce.tar.bz2
move equivalence to separate file/class
Diffstat (limited to 'epghandler.c')
-rw-r--r--epghandler.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/epghandler.c b/epghandler.c
index 29f092b..426958d 100644
--- a/epghandler.c
+++ b/epghandler.c
@@ -8,20 +8,28 @@
#include "epghandler.h"
#if APIVERSNUM > 10725
#include "log.h"
+#include "equivhandler.h"
+#include <vdr/sources.h>
cEEpgHandler::cEEpgHandler() {
- // TODO Auto-generated constructor stub
LogD(4, prep("cEEpgHandler()"));
-
+ equivHandler = new cEquivHandler();
}
cEEpgHandler::~cEEpgHandler() {
- // TODO Auto-generated destructor stub
+ delete equivHandler;
+ equivHandler = NULL;
}
bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule,
const SI::EIT::Event* EitEvent, uchar TableID, uchar Version) {
//LogD(1, prep("HandleEitEvent"));
+ //DISH NID 0x1001 to 0x100B BEV 0x100 and 0x101
+ //TODO move the eit handling code at least for NA providers here instead of discarding.
+ int nid = Schedule->ChannelID().Nid();
+ if ((nid >= 0x1001 && nid <= 0x100B) || nid == 0x101 || nid == 0x100)
+ return true;
+
return false;
// return true;
}
@@ -103,6 +111,14 @@ bool cEEpgHandler::HandleEvent(cEvent* Event) {
if (!Event->Description() && !origDescription.empty()) {
Event->SetDescription(origDescription.c_str());
}
+
+ cSchedulesLock SchedulesLock (true);
+ cSchedules *s = (cSchedules *) cSchedules::Schedules (SchedulesLock);
+ if (s) {
+ equivHandler->updateEquivalent(s, Event->ChannelID(), Event);
+ } else
+ LogE (0, prep("Error: could not lock schedules."));
+
//TODO just to see the difference
//else if (!origDescription.empty() && !origDescription.compare(Event->Description())) {
// origDescription.append(" | EIT: ");
@@ -114,7 +130,16 @@ bool cEEpgHandler::HandleEvent(cEvent* Event) {
}
bool cEEpgHandler::SortSchedule(cSchedule* Schedule) {
+
Schedule->Sort();
+
+ cSchedulesLock SchedulesLock (true);
+ cSchedules *s = (cSchedules *) cSchedules::Schedules (SchedulesLock);
+ if (s) {
+ equivHandler->sortEquivalents(Schedule->ChannelID(), s);
+ } else
+ LogE (0, prep("Error: could not lock schedules."));
+
return true;
}