summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-06-04 10:19:23 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2012-06-04 10:19:23 +0200
commit8d8dd8ecbd3a7c95800921009c72123939e3e571 (patch)
treeaec79840530906ce826751ededb9b8aed69c06dd
parent4bce65eb10999e2c7500faa6113bb79af600dc2e (diff)
downloadvdr-8d8dd8ecbd3a7c95800921009c72123939e3e571.tar.gz
vdr-8d8dd8ecbd3a7c95800921009c72123939e3e571.tar.bz2
Added HandledExternally() to the EPG handler interface
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--eit.c10
-rw-r--r--epg.c11
-rw-r--r--epg.h9
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
diff --git a/HISTORY b/HISTORY
index edc09622..8be42bb7 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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).
diff --git a/eit.c b/eit.c
index c746337b..9840d9a2 100644
--- a/eit.c
+++ b/eit.c
@@ -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)
diff --git a/epg.c b/epg.c
index 54712cc9..48fff364 100644
--- a/epg.c
+++ b/epg.c
@@ -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)) {
diff --git a/epg.h b/epg.h
index 6930fe0c..714ac176 100644
--- a/epg.h
+++ b/epg.h
@@ -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);