From 1314d03411769215c4ce1d62a8a847c9d3e58a7c Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Tue, 27 Dec 2005 14:39:14 +0100 Subject: [PATCH] cTimer no longer has its own 'schedule' member --- HISTORY | 2 ++ epg.h | 3 ++- timers.c | 9 ++++----- timers.h | 5 ++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/HISTORY b/HISTORY index a5043408..21850b6d 100644 --- a/HISTORY +++ b/HISTORY @@ -4000,3 +4000,5 @@ Video Disk Recorder Revision History - Schedules are now cleaned up once every hour (not only at 05:00). - The "Schedules" and "What's on now/next?" menus are now updated if a timer is set or modified. +- cTimer no longer has its own 'schedule' member, it rather uses that of the + event it has been set to. diff --git a/epg.h b/epg.h index 866db0ff..04b63bfb 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 and Rolf Hakenes . * - * $Id: epg.h 1.27 2005/12/26 11:59:44 kls Exp $ + * $Id: epg.h 1.28 2005/12/27 14:31:24 kls Exp $ */ #ifndef __EPG_H @@ -67,6 +67,7 @@ public: ~cEvent(); virtual int Compare(const cListObject &ListObject) const; tChannelID ChannelID(void) const; + const cSchedule *Schedule(void) const { return schedule; } u_int16_t EventID(void) const { return eventID; } uchar TableID(void) const { return tableID; } uchar Version(void) const { return version; } diff --git a/timers.c b/timers.c index ff51f109..c71d663f 100644 --- a/timers.c +++ b/timers.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.c 1.36 2005/09/09 15:22:33 kls Exp $ + * $Id: timers.c 1.37 2005/12/27 14:33:14 kls Exp $ */ #include "timers.h" @@ -363,7 +363,7 @@ bool cTimer::Matches(time_t t, bool Directly) const } if (HasFlags(tfActive)) { - if (HasFlags(tfVps) && !Directly && event && event->Vps() && schedule && schedule->PresentSeenWithin(30)) { + if (HasFlags(tfVps) && !Directly && event && event->Vps() && event->Schedule() && event->Schedule()->PresentSeenWithin(30)) { startTime = event->StartTime(); stopTime = event->EndTime(); return event->IsRunning(true); @@ -425,7 +425,7 @@ time_t cTimer::StopTime(void) const return stopTime; } -void cTimer::SetEvent(const cSchedule *Schedule, const cEvent *Event) +void cTimer::SetEvent(const cEvent *Event) { if (event != Event) { //XXX TODO check event data, too??? if (Event) { @@ -436,7 +436,6 @@ void cTimer::SetEvent(const cSchedule *Schedule, const cEvent *Event) } else isyslog("timer %s set to no event", *ToDescr()); - schedule = Event ? Schedule : NULL; event = Event; } } @@ -629,7 +628,7 @@ void cTimers::SetEvents(void) } if (Event && Event->EndTime() < now - EXPIRELATENCY && !Event->IsRunning()) Event = NULL; - ti->SetEvent(Schedule, Event); + ti->SetEvent(Event); } } } diff --git a/timers.h b/timers.h index 28b3dd50..d3dfc843 100644 --- a/timers.h +++ b/timers.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: timers.h 1.19 2005/05/07 10:36:35 kls Exp $ + * $Id: timers.h 1.20 2005/12/27 14:27:26 kls Exp $ */ #ifndef __TIMERS_H @@ -39,7 +39,6 @@ private: int lifetime; char file[MaxFileName]; char *summary; - const cSchedule *schedule; const cEvent *event; public: cTimer(bool Instant = false, bool Pause = false); @@ -78,7 +77,7 @@ public: bool Expired(void) const; time_t StartTime(void) const; time_t StopTime(void) const; - void SetEvent(const cSchedule *Schedule, const cEvent *Event); + void SetEvent(const cEvent *Event); void SetRecording(bool Recording); void SetPending(bool Pending); void SetInVpsMargin(bool InVpsMargin);