21 #define MAXEPGBUGFIXLEVEL 3 55 bool Realloc(
int Index);
60 void SetComponent(
int Index,
const char *s);
61 void SetComponent(
int Index,
uchar Stream,
uchar Type,
const char *Language,
const char *Description);
62 tComponent *
Component(
int Index)
const {
return (Index < numComponents) ? &components[Index] : NULL; }
100 const char *
Title(
void)
const {
return title; }
107 time_t
EndTime(
void)
const {
return startTime + duration; }
109 time_t
Vps(
void)
const {
return vps; }
110 time_t
Seen(
void)
const {
return seen; }
111 bool SeenWithin(
int Seconds)
const {
return time(NULL) - seen < Seconds; }
112 bool HasTimer(
void)
const;
113 bool IsRunning(
bool OrAboutToStart =
false)
const;
114 static const char *ContentToString(
uchar Content);
115 cString GetParentalRatingString(
void)
const;
116 cString GetDateString(
void)
const;
117 cString GetTimeString(
void)
const;
118 cString GetEndTimeString(
void)
const;
119 cString GetVpsString(
void)
const;
121 void SetTableID(
uchar TableID);
122 void SetVersion(
uchar Version);
124 void SetTitle(
const char *Title);
125 void SetShortText(
const char *ShortText);
126 void SetDescription(
const char *Description);
128 void SetContents(
uchar *Contents);
129 void SetParentalRating(
int ParentalRating);
130 void SetStartTime(time_t StartTime);
131 void SetDuration(
int Duration);
132 void SetVps(time_t Vps);
135 void Dump(FILE *f,
const char *Prefix =
"",
bool InfoOnly =
false)
const;
138 void FixEpgBugs(
void);
161 void ClrRunningStatus(
cChannel *Channel = NULL);
162 void ResetVersions(
void);
164 void DropOutdated(time_t SegmentStart, time_t SegmentEnd,
uchar TableID,
uchar Version);
165 void Cleanup(time_t Time);
168 void DelEvent(
cEvent *Event);
169 void HashEvent(
cEvent *Event);
170 void UnhashEvent(
cEvent *Event);
172 const cEvent *GetPresentEvent(
void)
const;
173 const cEvent *GetFollowingEvent(
void)
const;
174 const cEvent *GetEvent(
tEventID EventID, time_t StartTime = 0)
const;
175 const cEvent *GetEventAround(time_t Time)
const;
176 void Dump(FILE *f,
const char *Prefix =
"",
eDumpMode DumpMode =
dmAll, time_t AtTime = 0)
const;
177 static bool Read(FILE *f,
cSchedules *Schedules);
199 static void SetEpgDataFileName(
const char *FileName);
205 static void SetModified(
cSchedule *Schedule);
206 static void Cleanup(
bool Force =
false);
207 static void ResetVersions(
void);
208 static bool ClearAll(
void);
209 static bool Dump(FILE *f = NULL,
const char *Prefix =
"",
eDumpMode DumpMode =
dmAll, time_t AtTime = 0);
210 static bool Read(FILE *f = NULL);
213 const cSchedule *GetSchedule(
const cChannel *Channel,
bool AddIfMissing =
false)
const;
219 virtual void Action(
void);
286 bool IgnoreChannel(
const cChannel *Channel);
288 bool HandledExternally(
const cChannel *Channel);
291 void SetTitle(
cEvent *Event,
const char *Title);
292 void SetShortText(
cEvent *Event,
const char *ShortText);
293 void SetDescription(
cEvent *Event,
const char *Description);
295 void SetParentalRating(
cEvent *Event,
int ParentalRating);
296 void SetStartTime(
cEvent *Event, time_t StartTime);
297 void SetDuration(
cEvent *Event,
int Duration);
298 void SetVps(
cEvent *Event, time_t Vps);
300 void FixEpgBugs(
cEvent *Event);
301 void HandleEvent(
cEvent *Event);
303 void DropOutdated(
cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd,
uchar TableID,
uchar Version);
304 void BeginSegmentTransfer(
const cChannel *Channel,
bool OnlyRunningStatus);
305 void EndSegmentTransfer(
bool Modified,
bool OnlyRunningStatus);
virtual bool SortSchedule(cSchedule *Schedule)
Sorts the Schedule after the complete table has been processed.
time_t EndTime(void) const
virtual bool SetContents(cEvent *Event, uchar *Contents)
tChannelID ChannelID(void) const
virtual bool SetTitle(cEvent *Event, const char *Title)
char language[MAXLANGCODE2]
virtual bool SetDuration(cEvent *Event, int Duration)
virtual bool SetParentalRating(cEvent *Event, int ParentalRating)
const cSchedule * Schedule(void) const
virtual bool HandleEvent(cEvent *Event)
After all modifications of the Event have been done, the EPG handler can take a final look at it...
time_t PresentSeen(void) const
cHash< cEvent > eventsHashID
uchar Contents(int i=0) const
tComponent * Component(int Index) const
time_t StartTime(void) const
virtual bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version)
Before the raw EitEvent for the given Schedule is processed, the EPG handlers are queried to see if a...
bool PresentSeenWithin(int Seconds) const
virtual bool SetDescription(cEvent *Event, const char *Description)
virtual bool SetComponents(cEvent *Event, cComponents *Components)
virtual bool EndSegmentTransfer(bool Modified, bool OnlyRunningStatus)
Called after the segment data has been processed.
int ParentalRating(void) const
virtual int Compare(const cListObject &ListObject) const
Must return 0 if this object is equal to ListObject, a positive value if it is "greater", and a negative value if it is "smaller".
uchar TableID(void) const
virtual bool DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
Takes a look at all EPG events between SegmentStart and SegmentEnd and drops outdated events...
static time_t Modified(void)
static bool Read(FILE *f, cSchedules *Schedules)
const cList< cEvent > * Events(void) const
static char * epgDataFileName
virtual bool SetStartTime(cEvent *Event, time_t StartTime)
int RunningStatus(void) const
time_t Modified(void) const
tEventID EventID(void) const
void SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel=NULL)
virtual bool HandledExternally(const cChannel *Channel)
If any EPG handler returns true in this function, it is assumed that the EPG for the given Channel is...
bool FromString(const char *s)
void SetPresentSeen(void)
const char * Title(void) const
void ReportEpgBugFixStats(bool Force=false)
static cSchedules schedules
virtual bool SetShortText(cEvent *Event, const char *ShortText)
int NumComponents(void) const
const char * Description(void) const
virtual bool IgnoreChannel(const cChannel *Channel)
Before any EIT data for the given Channel is processed, the EPG handlers are asked whether this Chann...
virtual bool SetVps(cEvent *Event, time_t Vps)
const cComponents * Components(void) const
bool SeenWithin(int Seconds) const
virtual bool FixEpgBugs(cEvent *Event)
Fixes some known problems with EPG data.
virtual bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version)
VDR can't perform the update check (version, tid) for externally handled events, therefore the EPG ha...
virtual bool BeginSegmentTransfer(const cChannel *Channel, bool OnlyRunningStatus)
Called directly after IgnoreChannel() before any other handler method is called.
cHash< cEvent > eventsHashStartTime
const char * ShortText(void) const
void Dump(FILE *f, const char *Prefix="", eDumpMode DumpMode=dmAll, time_t AtTime=0) const
uchar Version(void) const
virtual bool SetEventID(cEvent *Event, tEventID EventID)