1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

cEvent no longer stores the channelID directly, but rather has a pointer to the schedule it is in

This commit is contained in:
Klaus Schmidinger 2005-05-28 10:09:06 +02:00
parent 7114258ebd
commit b4cbb84489
5 changed files with 20 additions and 13 deletions

View File

@ -3513,7 +3513,7 @@ Video Disk Recorder Revision History
- Fixed a wrong inheritance in libsi's SubtitlingDescriptor::Subtitling (thanks to - Fixed a wrong inheritance in libsi's SubtitlingDescriptor::Subtitling (thanks to
Marco Schlüßler). Marco Schlüßler).
2005-05-26: Version 1.3.25 2005-05-28: Version 1.3.25
- Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Updated the Estonian OSD texts (thanks to Arthur Konovalov).
- Some cable providers don't mark short channel names according to the standard, - Some cable providers don't mark short channel names according to the standard,
@ -3566,3 +3566,5 @@ Video Disk Recorder Revision History
- Made tChannelID::operator==() inline for better performance (thanks to Georg - Made tChannelID::operator==() inline for better performance (thanks to Georg
Acher). Acher).
- Introduced cListBase::count for better performance (thanks to Georg Acher). - Introduced cListBase::count for better performance (thanks to Georg Acher).
- cEvent no longer stores the channelID directly, but rather has a pointer to
the schedule it is in.

4
eit.c
View File

@ -8,7 +8,7 @@
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * 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>. * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
* *
* $Id: eit.c 1.105 2005/05/26 10:25:41 kls Exp $ * $Id: eit.c 1.106 2005/05/28 10:07:12 kls Exp $
*/ */
#include "eit.h" #include "eit.h"
@ -56,7 +56,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
if (!pEvent) { if (!pEvent) {
// If we don't have that event yet, we create a new one. // If we don't have that event yet, we create a new one.
// Otherwise we copy the information into the existing event anyway, because the data might have changed. // Otherwise we copy the information into the existing event anyway, because the data might have changed.
pEvent = pSchedule->AddEvent(new cEvent(channelID, SiEitEvent.getEventId())); pEvent = pSchedule->AddEvent(new cEvent(pSchedule, SiEitEvent.getEventId()));
if (!pEvent) if (!pEvent)
continue; continue;
} }

13
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * 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" #include "epg.h"
@ -81,9 +81,9 @@ void cComponents::SetComponent(int Index, uchar Stream, uchar Type, const char *
// --- cEvent ---------------------------------------------------------------- // --- cEvent ----------------------------------------------------------------
cEvent::cEvent(tChannelID ChannelID, u_int16_t EventID) cEvent::cEvent(cSchedule *Schedule, u_int16_t EventID)
{ {
channelID = ChannelID; schedule = Schedule;
eventID = EventID; eventID = EventID;
tableID = 0; tableID = 0;
version = 0xFF; // actual version numbers are 0..31 version = 0xFF; // actual version numbers are 0..31
@ -112,6 +112,11 @@ int cEvent::Compare(const cListObject &ListObject) const
return startTime - e->startTime; return startTime - e->startTime;
} }
tChannelID cEvent::ChannelID(void) const
{
return schedule ? schedule->ChannelID() : tChannelID();
}
void cEvent::SetEventID(u_int16_t EventID) void cEvent::SetEventID(u_int16_t EventID)
{ {
eventID = EventID; eventID = EventID;
@ -281,7 +286,7 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
if (n == 3 || n == 4) { if (n == 3 || n == 4) {
Event = (cEvent *)Schedule->GetEvent(EventID, StartTime); Event = (cEvent *)Schedule->GetEvent(EventID, StartTime);
if (!Event) if (!Event)
Event = Schedule->AddEvent(new cEvent(Schedule->ChannelID(), EventID)); Event = Schedule->AddEvent(new cEvent(Schedule, EventID));
if (Event) { if (Event) {
Event->SetTableID(TableID); Event->SetTableID(TableID);
Event->SetStartTime(StartTime); Event->SetStartTime(StartTime);

8
epg.h
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* *
* $Id: epg.h 1.23 2005/05/28 09:48:56 kls Exp $ * $Id: epg.h 1.24 2005/05/28 10:00:12 kls Exp $
*/ */
#ifndef __EPG_H #ifndef __EPG_H
@ -48,7 +48,7 @@ class cSchedule;
class cEvent : public cListObject { class cEvent : public cListObject {
private: private:
tChannelID channelID; // Channel ID of program for this event cSchedule *schedule; // The Schedule this event belongs to
u_int16_t eventID; // Event ID of this event u_int16_t eventID; // Event ID of this event
uchar tableID; // Table ID this event came from uchar tableID; // Table ID this event came from
uchar version; // Version number of section this event came from uchar version; // Version number of section this event came from
@ -62,10 +62,10 @@ private:
time_t vps; // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL) time_t vps; // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL)
time_t seen; // When this event was last seen in the data stream time_t seen; // When this event was last seen in the data stream
public: public:
cEvent(tChannelID ChannelID, u_int16_t EventID); cEvent(cSchedule *Schedule, u_int16_t EventID);
~cEvent(); ~cEvent();
virtual int Compare(const cListObject &ListObject) const; virtual int Compare(const cListObject &ListObject) const;
tChannelID ChannelID(void) const { return channelID; } tChannelID ChannelID(void) const;
u_int16_t EventID(void) const { return eventID; } u_int16_t EventID(void) const { return eventID; }
uchar TableID(void) const { return tableID; } uchar TableID(void) const { return tableID; }
uchar Version(void) const { return version; } uchar Version(void) const { return version; }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.104 2005/05/28 09:53:54 kls Exp $ * $Id: recording.c 1.105 2005/05/28 10:04:24 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -228,7 +228,7 @@ cRecordingInfo::cRecordingInfo(const cEvent *Event)
ownEvent = NULL; ownEvent = NULL;
} }
else else
event = ownEvent = new cEvent(tChannelID(), 0); event = ownEvent = new cEvent(NULL, 0);
} }
cRecordingInfo::~cRecordingInfo() cRecordingInfo::~cRecordingInfo()