summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-05-28 10:09:06 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-05-28 10:09:06 +0200
commitb4cbb84489020d0fa3e45fbff60cf1ce43ea6a1b (patch)
tree1d14c80c5db191a3d57b3ec3c7f3cf9ba32f13c2 /epg.c
parent7114258ebd27e302eba4be88b546662c163396f4 (diff)
downloadvdr-b4cbb84489020d0fa3e45fbff60cf1ce43ea6a1b.tar.gz
vdr-b4cbb84489020d0fa3e45fbff60cf1ce43ea6a1b.tar.bz2
cEvent no longer stores the channelID directly, but rather has a pointer to the schedule it is in
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c13
1 files changed, 9 insertions, 4 deletions
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 <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $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);