From 04f176b2489722283039e4c73e2f19e6a519fde1 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 4 Jun 2012 10:29:19 +0200 Subject: Added SetComponents() to the EPG handler interface --- CONTRIBUTORS | 3 +++ HISTORY | 1 + eit.c | 4 ++-- epg.c | 11 ++++++++++- epg.h | 4 +++- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 617e26c9..4c4c629f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2907,3 +2907,6 @@ Christian Richter Christian Kaiser for adding DeleteEvent() to the EPG handler interface + +Dirk Heiser + for adding SetComponents() to the EPG handler interface diff --git a/HISTORY b/HISTORY index 8be42bb7..d81e0632 100644 --- a/HISTORY +++ b/HISTORY @@ -7164,3 +7164,4 @@ Video Disk Recorder Revision History 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). +- Added SetComponents() to the EPG handler interface (thanks to Dirk Heiser). diff --git a/eit.c b/eit.c index 9840d9a2..12e1d242 100644 --- a/eit.c +++ b/eit.c @@ -8,7 +8,7 @@ * Robert Schneider and Rolf Hakenes . * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg . * - * $Id: eit.c 2.19 2012/06/04 10:10:11 kls Exp $ + * $Id: eit.c 2.20 2012/06/04 10:26:10 kls Exp $ */ #include "eit.h" @@ -285,7 +285,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo delete ExtendedEventDescriptors; delete ShortEventDescriptor; - pEvent->SetComponents(Components); + EpgHandlers.SetComponents(pEvent, Components); EpgHandlers.FixEpgBugs(pEvent); if (LinkChannels) diff --git a/epg.c b/epg.c index 48fff364..d47c4a37 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 and Rolf Hakenes . * - * $Id: epg.c 2.16 2012/06/04 10:06:22 kls Exp $ + * $Id: epg.c 2.17 2012/06/04 10:26:10 kls Exp $ */ #include "epg.h" @@ -1421,6 +1421,15 @@ void cEpgHandlers::SetVps(cEvent *Event, time_t Vps) Event->SetVps(Vps); } +void cEpgHandlers::SetComponents(cEvent *Event, cComponents *Components) +{ + for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { + if (eh->SetComponents(Event, Components)) + return; + } + Event->SetComponents(Components); +} + void cEpgHandlers::FixEpgBugs(cEvent *Event) { for (cEpgHandler *eh = First(); eh; eh = Next(eh)) { diff --git a/epg.h b/epg.h index 714ac176..98cb7764 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 and Rolf Hakenes . * - * $Id: epg.h 2.12 2012/06/04 10:05:21 kls Exp $ + * $Id: epg.h 2.13 2012/06/04 10:26:10 kls Exp $ */ #ifndef __EPG_H @@ -259,6 +259,7 @@ public: virtual bool SetStartTime(cEvent *Event, time_t StartTime) { return false; } virtual bool SetDuration(cEvent *Event, int Duration) { return false; } virtual bool SetVps(cEvent *Event, time_t Vps) { return false; } + virtual bool SetComponents(cEvent *Event, cComponents *Components) { return false; } virtual bool FixEpgBugs(cEvent *Event) { return false; } ///< Fixes some known problems with EPG data. virtual bool HandleEvent(cEvent *Event) { return false; } @@ -285,6 +286,7 @@ public: void SetStartTime(cEvent *Event, time_t StartTime); void SetDuration(cEvent *Event, int Duration); void SetVps(cEvent *Event, time_t Vps); + void SetComponents(cEvent *Event, cComponents *Components); void FixEpgBugs(cEvent *Event); void HandleEvent(cEvent *Event); void SortSchedule(cSchedule *Schedule); -- cgit v1.2.3