summaryrefslogtreecommitdiff
path: root/epg.h
diff options
context:
space:
mode:
Diffstat (limited to 'epg.h')
-rw-r--r--epg.h38
1 files changed, 18 insertions, 20 deletions
diff --git a/epg.h b/epg.h
index 409968a..4b209b5 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 1.4 2004/01/09 15:21:05 kls Exp $
+ * $Id: epg.h 1.10 2004/02/22 14:34:04 kls Exp kls $
*/
#ifndef __EPG_H
@@ -19,6 +19,8 @@
#define MAXEPGBUGFIXLEVEL 2
+enum eDumpMode { dmAll, dmPresent, dmFollowing, dmAtTime };
+
class cSchedule;
class cEvent : public cListObject {
@@ -27,45 +29,43 @@ private:
u_int16_t eventID; // Event ID of this event
uchar tableID; // Table ID this event came from
uchar version; // Version number of section this event came from
- //XXX present/following obsolete???
- bool isPresent; // true if this is the present event running
- bool isFollowing; // true if this is the next event on this channel
+ int runningStatus; // 0=undefined, 1=not running, 2=starts in a few seconds, 3=pausing, 4=running
char *title; // Title of this event
char *shortText; // Short description of this event (typically the episode name in case of a series)
char *description; // Description of this event
time_t startTime; // Start time of this event
int duration; // Duration of this event in seconds
- //XXX find an other solution, avoiding channelNumber???
- int channelNumber; // the actual channel number from VDR's channel list (used in cMenuSchedule for sorting by channel number)
+ time_t vps; // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL)
public:
cEvent(tChannelID ChannelID, u_int16_t EventID);
~cEvent();
+ virtual bool operator< (const cListObject &ListObject);
tChannelID ChannelID(void) const { return channelID; }
u_int16_t EventID(void) const { return eventID; }
uchar TableID(void) const { return tableID; }
uchar Version(void) const { return version; }
- bool IsPresent(void) const { return isPresent; }
- bool IsFollowing(void) const { return isFollowing; }
+ int RunningStatus(void) const { return runningStatus; }
const char *Title(void) const { return title; }
const char *ShortText(void) const { return shortText; }
const char *Description(void) const { return description; }
time_t StartTime(void) const { return startTime; }
int Duration(void) const { return duration; }
- int ChannelNumber(void) const { return channelNumber; }
+ time_t Vps(void) const { return vps; }
+ bool HasTimer(void) const;
const char *GetDateString(void) const;
const char *GetTimeString(void) const;
const char *GetEndTimeString(void) const;
+ const char *GetVpsString(void) const;
void SetEventID(u_int16_t EventID);
void SetTableID(uchar TableID);
void SetVersion(uchar Version);
- void SetIsPresent(bool IsPresent);
- void SetIsFollowing(bool IsFollowing);
+ void SetRunningStatus(int RunningStatus);
void SetTitle(const char *Title);
void SetShortText(const char *ShortText);
void SetDescription(const char *Description);
void SetStartTime(time_t StartTime);
void SetDuration(int Duration);
- void SetChannelNumber(int ChannelNumber) const { ((cEvent *)this)->channelNumber = ChannelNumber; } // doesn't modify the EIT data, so it's ok to make it 'const' //XXX
+ void SetVps(time_t Vps);
void Dump(FILE *f, const char *Prefix = "") const;
static bool Read(FILE *f, cSchedule *Schedule);
void FixEpgBugs(void);
@@ -77,24 +77,22 @@ class cSchedule : public cListObject {
private:
tChannelID channelID;
cList<cEvent> events;
- cEvent *present;
- cEvent *following;
public:
cSchedule(tChannelID ChannelID);
tChannelID ChannelID(void) const { return channelID; }
- bool SetPresentEvent(cEvent *Event);
- bool SetFollowingEvent(cEvent *Event);
+ void SetRunningStatus(cEvent *Event, int RunningStatus);
void ResetVersions(void);
+ void Sort(void);
void Cleanup(time_t Time);
void Cleanup(void);
cEvent *AddEvent(cEvent *Event);
- const cEvent *GetPresentEvent(void) const;
- const cEvent *GetFollowingEvent(void) const;
+ const cEvent *GetPresentEvent(bool CheckRunningStatus = false) const;
+ const cEvent *GetFollowingEvent(bool CheckRunningStatus = false) const;
const cEvent *GetEvent(u_int16_t EventID, time_t StartTime = 0) const;
const cEvent *GetEventAround(time_t Time) const;
const cEvent *GetEventNumber(int n) const { return events.Get(n); }
int NumEvents(void) const { return events.Count(); }
- void Dump(FILE *f, const char *Prefix = "") const;
+ void Dump(FILE *f, const char *Prefix = "", eDumpMode DumpMode = dmAll, time_t AtTime = 0) const;
static bool Read(FILE *f, cSchedules *Schedules);
};
@@ -125,7 +123,7 @@ public:
static void Cleanup(bool Force = false);
static void ResetVersions(void);
static bool ClearAll(void);
- static bool Dump(FILE *f, const char *Prefix = "");
+ static bool Dump(FILE *f, const char *Prefix = "", eDumpMode DumpMode = dmAll, time_t AtTime = 0);
static bool Read(FILE *f = NULL);
cSchedule *AddSchedule(tChannelID ChannelID);
const cSchedule *GetSchedule(tChannelID ChannelID) const;