From b4cbb84489020d0fa3e45fbff60cf1ce43ea6a1b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 28 May 2005 10:09:06 +0200 Subject: cEvent no longer stores the channelID directly, but rather has a pointer to the schedule it is in --- epg.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'epg.c') diff --git a/epg.c b/epg.c index 5546bf96..440e7fa0 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 1.31 2005/05/28 09:49:04 kls Exp $ + * $Id: epg.c 1.32 2005/05/28 10:03:39 kls Exp $ */ #include "epg.h" @@ -81,9 +81,9 @@ void cComponents::SetComponent(int Index, uchar Stream, uchar Type, const char * // --- cEvent ---------------------------------------------------------------- -cEvent::cEvent(tChannelID ChannelID, u_int16_t EventID) +cEvent::cEvent(cSchedule *Schedule, u_int16_t EventID) { - channelID = ChannelID; + schedule = Schedule; eventID = EventID; tableID = 0; version = 0xFF; // actual version numbers are 0..31 @@ -112,6 +112,11 @@ int cEvent::Compare(const cListObject &ListObject) const return startTime - e->startTime; } +tChannelID cEvent::ChannelID(void) const +{ + return schedule ? schedule->ChannelID() : tChannelID(); +} + void cEvent::SetEventID(u_int16_t EventID) { eventID = EventID; @@ -281,7 +286,7 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule) if (n == 3 || n == 4) { Event = (cEvent *)Schedule->GetEvent(EventID, StartTime); if (!Event) - Event = Schedule->AddEvent(new cEvent(Schedule->ChannelID(), EventID)); + Event = Schedule->AddEvent(new cEvent(Schedule, EventID)); if (Event) { Event->SetTableID(TableID); Event->SetStartTime(StartTime); -- cgit v1.2.3