Home

Dokumentation

Impressum

Dokumentation VDR
 

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

eit.h

Go to the documentation of this file.
00001 /*!*************************************************************************
00002                           eit.h  -  description
00003                              -------------------
00004     begin                : Fri Aug 25 2000
00005     copyright            : (C) 2000 by Robert Schneider
00006     email                : Robert.Schneider@web.de
00007 
00008     2001-08-15: Adapted to 'libdtv' by Rolf Hakenes <hakenes@hippomi.de>
00009 
00010  ***************************************************************************/
00011 
00012 /*!*************************************************************************
00013  *                                                                         *
00014  *   This program is free software; you can redistribute it and/or modify  *
00015  *   it under the terms of the GNU General Public License as published by  *
00016  *   the Free Software Foundation; either version 2 of the License, or     *
00017  *   (at your option) any later version.                                   *
00018  *                                                                         *
00019  * $Id: eit.h 1.22 2002/11/24 12:45:55 kls Exp $
00020  ***************************************************************************/
00021 
00022 #ifndef __EIT_H
00023 #define __EIT_H
00024 
00025 #include "channels.h"
00026 #include "thread.h"
00027 #include "tools.h"
00028 
00029 #define MAXEPGBUGFIXLEVEL 2
00030 
00032 class cEventInfo : public cListObject {
00033   friend class cSchedule;
00034   friend class cEIT;
00035 private:
00036 
00040   unsigned char uTableID;
00041 
00045   tChannelID channelID;
00046 
00050   bool bIsFollowing;
00051 
00055   bool bIsPresent;
00056 
00060   char *pExtendedDescription;
00061 
00065   char *pSubtitle;
00066 
00070   char *pTitle;
00071 
00075   unsigned short uEventID;
00076 
00080   long lDuration;
00081 
00085   time_t tTime;
00086 
00091   int nChannelNumber;
00092 protected:
00093   void SetTableID(unsigned char tableid);
00094   void SetFollowing(bool foll);
00095   void SetPresent(bool pres);
00096   void SetTitle(const char *string);
00097   void SetChannelID(tChannelID channelid);
00098   void SetEventID(unsigned short evid);
00099   void SetDuration(long l);
00100   void SetTime(time_t t);
00101   void SetExtendedDescription(const char *string);
00102   void SetSubtitle(const char *string);
00103   cEventInfo(tChannelID channelid, unsigned short eventid);
00104 public:
00105   ~cEventInfo();
00106   const unsigned char GetTableID(void) const;
00107   const char *GetTimeString(void) const;
00108   const char *GetEndTimeString(void) const;
00109   const char *GetDate(void) const;
00110   bool IsFollowing(void) const;
00111   bool IsPresent(void) const;
00112   const char *GetExtendedDescription(void) const;
00113   const char *GetSubtitle(void) const;
00114   const char *GetTitle(void) const;
00115   unsigned short GetEventID(void) const;
00116   long GetDuration(void) const;
00117   time_t GetTime(void) const;
00118   tChannelID GetChannelID(void) const;
00119   int GetChannelNumber(void) const { return nChannelNumber; }
00120 
00124   void SetChannelNumber(int ChannelNumber) const { ((cEventInfo *)this)->nChannelNumber = ChannelNumber; }
00125   void Dump(FILE *f, const char *Prefix = "") const;
00126   static bool Read(FILE *f, cSchedule *Schedule);
00127   void FixEpgBugs(void);
00128   };
00129 
00130 class cSchedule : public cListObject  {
00131   friend class cSchedules;
00132   friend class cEIT;
00133 private:
00134   cEventInfo *pPresent;
00135   cEventInfo *pFollowing;
00136   tChannelID channelID;
00137   cList<cEventInfo> Events;
00138 protected:
00139   void SetChannelID(tChannelID channelid);
00140   bool SetFollowingEvent(cEventInfo *pEvent);
00141   bool SetPresentEvent(cEventInfo *pEvent);
00142   void Cleanup(time_t tTime);
00143   void Cleanup(void);
00144   cSchedule(tChannelID channelid = tChannelID::InvalidID);
00145 public:
00146   ~cSchedule();
00147   cEventInfo *AddEvent(cEventInfo *EventInfo);
00148   const cEventInfo *GetPresentEvent(void) const;
00149   const cEventInfo *GetFollowingEvent(void) const;
00150   tChannelID GetChannelID(void) const;
00151   const cEventInfo *GetEvent(unsigned short uEventID, time_t tTime = 0) const;
00152   const cEventInfo *GetEventAround(time_t tTime) const;
00153   const cEventInfo *GetEventNumber(int n) const { return Events.Get(n); }
00154   int NumEvents(void) const { return Events.Count(); }
00155   void Dump(FILE *f, const char *Prefix = "") const;
00156   static bool Read(FILE *f, cSchedules *Schedules);
00157   };
00158 
00160 class cSchedules : public cList<cSchedule> {
00161   friend class cSchedule;
00162   friend class cSIProcessor;
00163 private:
00164   const cSchedule *pCurrentSchedule;
00165   tChannelID currentChannelID;
00166 protected:
00167   const cSchedule *AddChannelID(tChannelID channelid);
00168   const cSchedule *SetCurrentChannelID(tChannelID channelid);
00169   void Cleanup();
00170 public:
00171   cSchedules(void);
00172   ~cSchedules();
00173   const cSchedule *GetSchedule(tChannelID channelid) const;
00174   const cSchedule *GetSchedule(void) const;
00175   void Dump(FILE *f, const char *Prefix = "") const;
00176   static bool Read(FILE *f);
00177 };
00178 
00179 typedef struct sip_filter {
00180 
00181   u_char pid;
00182   u_char tid;
00183   int handle;
00184   bool inuse;
00185 
00186 }SIP_FILTER;
00187 
00189 class cSIProcessor : public cThread {
00190 private:
00191   static int numSIProcessors;
00192   static cSchedules *schedules;
00193   static cMutex schedulesMutex;
00194   static const char *epgDataFileName;
00195   static time_t lastDump;
00196   bool masterSIProcessor;
00197   int currentSource;
00198   int currentTransponder;
00199   SIP_FILTER *filters;
00200   char *fileName;
00201   bool active;
00202   void Action(void);
00203   bool AddFilter(u_char pid, u_char tid);
00204   bool ShutDownFilters(void);
00205 public:
00206   cSIProcessor(const char *FileName);
00207   ~cSIProcessor();
00208 
00209   static void SetEpgDataFileName(const char *FileName);
00210   static const char *GetEpgDataFileName(void);
00211 
00217   static const cSchedules *Schedules(cMutexLock &MutexLock);
00218   static bool Read(FILE *f = NULL);
00219   static void Clear(void);
00220   void SetStatus(bool On);
00221   void SetCurrentTransponder(int CurrentSource, int CurrentTransponder);
00222   static bool SetCurrentChannelID(tChannelID channelid);
00223   static void TriggerDump(void);
00224   };
00225 
00226 #endif
00227 

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