diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-06-04 10:19:23 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-06-04 10:19:23 +0200 |
commit | 8d8dd8ecbd3a7c95800921009c72123939e3e571 (patch) | |
tree | aec79840530906ce826751ededb9b8aed69c06dd | |
parent | 4bce65eb10999e2c7500faa6113bb79af600dc2e (diff) | |
download | vdr-8d8dd8ecbd3a7c95800921009c72123939e3e571.tar.gz vdr-8d8dd8ecbd3a7c95800921009c72123939e3e571.tar.bz2 |
Added HandledExternally() to the EPG handler interface
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | eit.c | 10 | ||||
-rw-r--r-- | epg.c | 11 | ||||
-rw-r--r-- | epg.h | 9 |
5 files changed, 28 insertions, 5 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c9a5660b..617e26c9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2465,6 +2465,7 @@ Ulf Kiener <webmaster@ulf-kiener.de> Jörg Wendel <vdr-ml@jwendel.de> for reporting that cPlugin::Active() was called too often + for adding HandledExternally() to the EPG handler interface Peter Pinnau <vdr@unterbrecher.de> for reporting that 'uint32_t' requires including stdint.h in font.h on some systems @@ -7162,3 +7162,5 @@ Video Disk Recorder Revision History - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Fixed the call to ChannelString() in cSkinLCARSDisplayChannel::SetChannel() (thanks to Rolf Ahrenberg). +- Removed DeleteEvent() from the EPG handler interface (turned out not to be useful) + and replaced it with HandledExternally() (thanks to Jörg Wendel). @@ -8,7 +8,7 @@ * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>. * - * $Id: eit.c 2.18 2012/06/04 09:48:57 kls Exp $ + * $Id: eit.c 2.19 2012/06/04 10:10:11 kls Exp $ */ #include "eit.h" @@ -45,6 +45,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo return; } + bool handledExternally = EpgHandlers.HandledExternally(channel); cSchedule *pSchedule = (cSchedule *)Schedules->GetSchedule(channel, true); bool Empty = true; @@ -70,7 +71,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo cEvent *newEvent = NULL; cEvent *rEvent = NULL; cEvent *pEvent = (cEvent *)pSchedule->GetEvent(SiEitEvent.getEventId(), StartTime); - if (!pEvent) { + if (!pEvent || handledExternally) { if (OnlyRunningStatus) continue; // If we don't have that event yet, we create a new one. @@ -78,7 +79,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo pEvent = newEvent = new cEvent(SiEitEvent.getEventId()); newEvent->SetStartTime(StartTime); newEvent->SetDuration(Duration); - pSchedule->AddEvent(newEvent); + if (!handledExternally) + pSchedule->AddEvent(newEvent); } else { // We have found an existing event, either through its event ID or its start time. @@ -290,6 +292,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo channel->SetLinkChannels(LinkChannels); Modified = true; EpgHandlers.HandleEvent(pEvent); + if (handledExternally) + delete pEvent; } if (Tid == 0x4E) { if (Empty && getSectionNumber() == 0) @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * - * $Id: epg.c 2.15 2012/06/04 09:49:48 kls Exp $ + * $Id: epg.c 2.16 2012/06/04 10:06:22 kls Exp $ */ #include "epg.h" @@ -1331,6 +1331,15 @@ bool cEpgHandlers::HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *Eit return false; } +bool cEpgHandlers::HandledExternally(const cChannel *Channel) +{ + for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { + if (eh->HandledExternally(Channel)) + return true; + } + return false; +} + void cEpgHandlers::SetEventID(cEvent *Event, tEventID EventID) { for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * - * $Id: epg.h 2.11 2012/06/04 09:49:24 kls Exp $ + * $Id: epg.h 2.12 2012/06/04 10:05:21 kls Exp $ */ #ifndef __EPG_H @@ -244,6 +244,12 @@ public: ///< EPG handlers are queried to see if any of them would like to do the ///< complete processing by itself. TableID and Version are from the ///< incoming section data. + virtual bool HandledExternally(const cChannel *Channel) { return false; } + ///< If any EPG handler returns true in this function, it is assumed that + ///< the EPG for the given Channel is handled completely from some external + ///< source. Incoming EIT data is processed as usual, but any new EPG event + ///< will not be added to the respective schedule. It's up to the EPG + ///< handler to take care of this. virtual bool SetEventID(cEvent *Event, tEventID EventID) { return false; } virtual bool SetTitle(cEvent *Event, const char *Title) { return false; } virtual bool SetShortText(cEvent *Event, const char *ShortText) { return false; } @@ -269,6 +275,7 @@ class cEpgHandlers : public cList<cEpgHandler> { public: bool IgnoreChannel(const cChannel *Channel); bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version); + bool HandledExternally(const cChannel *Channel); void SetEventID(cEvent *Event, tEventID EventID); void SetTitle(cEvent *Event, const char *Title); void SetShortText(cEvent *Event, const char *ShortText); |