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; }
103 const char *
Title(
void)
const {
return title; }
110 time_t
EndTime(
void)
const {
return startTime + duration; }
112 time_t
Vps(
void)
const {
return vps; }
113 time_t
Seen(
void)
const {
return seen; }
114 bool SeenWithin(
int Seconds)
const {
return time(NULL) - seen < Seconds; }
115 const char *
Aux(
void)
const {
return aux; }
118 bool HasTimer(
void)
const {
return numTimers > 0; }
119 bool IsRunning(
bool OrAboutToStart =
false)
const;
120 static const char *ContentToString(
uchar Content);
121 cString GetParentalRatingString(
void)
const;
122 cString GetDateString(
void)
const;
123 cString GetTimeString(
void)
const;
124 cString GetEndTimeString(
void)
const;
125 cString GetVpsString(
void)
const;
127 void SetTableID(
uchar TableID);
128 void SetVersion(
uchar Version);
130 void SetTitle(
const char *Title);
131 void SetShortText(
const char *ShortText);
132 void SetDescription(
const char *Description);
134 void SetContents(
uchar *Contents);
135 void SetParentalRating(
int ParentalRating);
136 void SetStartTime(time_t StartTime);
137 void SetDuration(
int Duration);
138 void SetVps(time_t Vps);
140 void SetAux(
const char *Aux);
142 void Dump(FILE *f,
const char *Prefix =
"",
bool InfoOnly =
false)
const;
145 void FixEpgBugs(
void);
164 bool Modified(
int &State)
const {
bool Result = State != modified; State = modified;
return Result; }
170 void ClrRunningStatus(
cChannel *Channel = NULL);
171 void ResetVersions(
void);
173 void DropOutdated(time_t SegmentStart, time_t SegmentEnd,
uchar TableID,
uchar Version);
174 void Cleanup(time_t Time);
176 void IncNumTimers(
void)
const;
177 void DecNumTimers(
void)
const;
178 bool HasTimer(
void)
const {
return numTimers > 0; }
180 void DelEvent(
cEvent *Event);
181 void HashEvent(
cEvent *Event);
182 void UnhashEvent(
cEvent *Event);
184 const cEvent *GetPresentEvent(
void)
const;
185 const cEvent *GetFollowingEvent(
void)
const;
186 const cEvent *GetEvent(
tEventID EventID, time_t StartTime = 0)
const;
187 const cEvent *GetEventAround(time_t Time)
const;
188 void Dump(
const cChannels *Channels, FILE *f,
const char *Prefix =
"",
eDumpMode DumpMode =
dmAll, time_t AtTime = 0)
const;
189 static bool Read(FILE *f,
cSchedules *Schedules);
206 static void SetEpgDataFileName(
const char *FileName);
207 static void Cleanup(
bool Force =
false);
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;
224 #define LOCK_SCHEDULES_READ USE_LIST_LOCK_READ(Schedules); 225 #define LOCK_SCHEDULES_WRITE USE_LIST_LOCK_WRITE(Schedules); 230 virtual void Action(
void);
302 bool IgnoreChannel(
const cChannel *Channel);
304 bool HandledExternally(
const cChannel *Channel);
307 void SetTitle(
cEvent *Event,
const char *Title);
308 void SetShortText(
cEvent *Event,
const char *ShortText);
309 void SetDescription(
cEvent *Event,
const char *Description);
311 void SetParentalRating(
cEvent *Event,
int ParentalRating);
312 void SetStartTime(
cEvent *Event, time_t StartTime);
313 void SetDuration(
cEvent *Event,
int Duration);
314 void SetVps(
cEvent *Event, time_t Vps);
316 void FixEpgBugs(
cEvent *Event);
317 void HandleEvent(
cEvent *Event);
319 void DropOutdated(
cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd,
uchar TableID,
uchar Version);
320 bool BeginSegmentTransfer(
const cChannel *Channel);
321 void EndSegmentTransfer(
bool Modified);
virtual bool EndSegmentTransfer(bool Modified, bool Dummy)
< Called directly after IgnoreChannel() before any other handler method is called.
virtual bool SortSchedule(cSchedule *Schedule)
Sorts the Schedule after the complete table has been processed.
time_t EndTime(void) const
void IncNumTimers(void) const
virtual bool SetContents(cEvent *Event, uchar *Contents)
tChannelID ChannelID(void) const
virtual bool SetTitle(cEvent *Event, const char *Title)
static cMutex numTimersMutex
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...
void Dump(const cChannels *Channels, FILE *f, const char *Prefix="", eDumpMode DumpMode=dmAll, time_t AtTime=0) const
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 BeginSegmentTransfer(const cChannel *Channel, bool Dummy)
virtual bool SetComponents(cEvent *Event, cComponents *Components)
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...
bool Modified(int &State) const
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
tEventID EventID(void) const
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 DecNumTimers(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 char * Aux(void) const
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...
static cMutex numTimersMutex
cHash< cEvent > eventsHashStartTime
bool HasTimer(void) const
const char * ShortText(void) const
void SetRunningStatus(cEvent *Event, int RunningStatus, const cChannel *Channel=NULL)
bool HasTimer(void) const
uchar Version(void) const
virtual bool SetEventID(cEvent *Event, tEventID EventID)