Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

timers.h

Go to the documentation of this file.
00001 
00010 #ifndef __TIMERS_H
00011 #define __TIMERS_H
00012 
00013 #include "channels.h"
00014 #include "config.h"
00015 #include "eit.h"
00016 #include "tools.h"
00017 
00019 enum eTimerActive {
00023  taInactive = 0,
00024                     
00028  taActive   = 1,
00029  taInstant  = 2,
00030  taActInst  = (taActive | taInstant)
00031                   };
00033 class cTimer : public cListObject {
00034   friend class cMenuEditTimer;
00035 private:
00036 
00040   time_t startTime, stopTime;
00041   static char *buffer;
00042 
00046   bool recording, pending;
00047 
00051   int active;
00052 
00056   cChannel *channel;
00057 
00061   int day;
00062 
00066   int start;
00067 
00071   int stop;
00072 
00078   int priority;
00079   int lifetime;
00080 
00084   char file[MaxFileName];
00085   time_t firstday;
00086 
00093   char *summary;
00094 public:
00095   cTimer(bool Instant = false);
00096   cTimer(const cEventInfo *EventInfo);
00097   virtual ~cTimer();
00098   cTimer& operator= (const cTimer &Timer);
00099   virtual bool operator< (const cListObject &ListObject);
00100   bool Recording(void) { return recording; }
00101 
00105   bool Pending(void) { return pending; }
00106 
00110   int Active(void) { return active; }
00111 
00115   const cChannel *Channel(void) { return channel; }
00116 
00120   int Day(void) { return day; }
00121   int Start(void) { return start; }
00122   int Stop(void) { return stop; }
00123   int Priority(void) { return priority; }
00124   int Lifetime(void) { return lifetime; }
00125   const char *File(void) { return file; }
00126   time_t FirstDay(void) { return firstday; }
00127   const char *Summary(void) { return summary; }
00128   const char *ToText(bool UseChannelID = false);
00129   bool Parse(const char *s);
00130   bool Save(FILE *f);
00131 
00135   bool IsSingleEvent(void);
00136 
00140   int GetMDay(time_t t);
00141 
00145   int GetWDay(time_t t);
00146 
00150   bool DayMatches(time_t t);
00151 
00155   static time_t IncDay(time_t t, int Days);
00156 
00160   static time_t SetTime(time_t t, int SecondsFromMidnight);
00161   char *SetFile(const char *File);
00162 
00166   bool Matches(time_t t = 0);
00167   time_t StartTime(void);
00168   time_t StopTime(void);
00169   void SetRecording(bool Recording);
00170   void SetPending(bool Pending);
00171 
00175   void SetActive(int Active);
00176   void Skip(void);
00177 
00181   void OnOff(void);
00182   const char *PrintFirstDay(void);
00183   static int TimeToInt(int t);
00184   static int ParseDay(const char *s, time_t *FirstDay = NULL);
00185   static const char *PrintDay(int d, time_t FirstDay = 0);
00186   };
00187 
00189 class cTimers : public cConfig<cTimer> {
00190 public:
00191   cTimer *GetTimer(cTimer *Timer);
00192   cTimer *GetMatch(time_t t);
00193   cTimer *GetNextActiveTimer(void);
00194   };
00195 
00196 extern cTimers Timers;
00197 
00198 #endif //__TIMERS_H
00199 

Generated on Wed Feb 5 23:30:12 2003 for VDR by doxygen1.3-rc2