From a69b3211dc4f9b34eef440067d5ba304fbfbad94 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Wed, 1 Nov 2000 18:00:00 +0100 Subject: Version 0.67 - The EIT information is now gathered in a separate thread. - The sytem time can now be synchronized to the time broadcast in the DVB data stream. This can be enabled in the "Setup" menu by setting "SetSystemTime" to 1. Note that this works only if VDR is running under a user id that has permisson to set the system time. - The new item "Schedule" in the "Main" menu opens VDR's EPG (thanks to Robert Schneider). See the MANUAL file for a detailed description. - The new setup parameters MarginStart and MarginStop define how long (in minutes) before the official start time of a broadcast VDR shall begin recording, and how long after the official end time it shall stop recording. These are used when a recording is programmed from the "Schedules" menu. - The delay value in the dvb.c.071.diff patch to the driver has been increased to '3', because on some systems the OSD was not displayed correctly. If you are running an already patched version 0.71 driver and encounter problems with the OSD, please make sure the parameter in the ddelay call is '3', not '2'. - Fixed initializing the RCU remote control code (didn't work after switching on the system). - Problematic characters in recording names (which can come from timers that are programmed via the "Schedules" menu) are now replaced by suitable substitutes. --- eit.h | 173 ++++++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 110 insertions(+), 63 deletions(-) (limited to 'eit.h') diff --git a/eit.h b/eit.h index 28329f4..fec498b 100644 --- a/eit.h +++ b/eit.h @@ -13,80 +13,127 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: eit.h 1.1 2000/09/03 10:23:24 kls Exp $ + * $Id: eit.h 1.2 2000/10/29 10:21:56 kls Exp $ ***************************************************************************/ #ifndef __EIT_H #define __EIT_H -#include +#include "thread.h" +#include "tools.h" -typedef struct eit_event { +class cEventInfo : public cListObject { + friend class cSchedule; + friend class cEIT; +private: + unsigned short uServiceID; // Service ID of program for that event + bool bIsFollowing; // true if this is the next event on this channel + bool bIsPresent; // true if this is the present event running + char *pExtendedDescription; // Extended description of this event + char *pSubtitle; // Subtitle of event + char *pTitle; // Title of event + unsigned short uEventID; // Event ID of this event + long lDuration; // duration of event in seconds + time_t tTime; // Start time + u_char cExtendedDescriptorNumber; // current extended descriptor number that has to be inserted + int nChannelNumber; // the actual channel number from VDR's channel list (used in cMenuSchedule for sorting by channel number) +protected: + void SetFollowing(bool foll); + void SetPresent(bool pres); + bool SetTitle(char *string); + void SetServiceID(unsigned short servid); + void SetEventID(unsigned short evid); + void SetDuration(long l); + void SetTime(time_t t); + bool AddExtendedDescription(char *string); + bool SetSubtitle(char *string); + void IncreaseExtendedDescriptorNumber(void); + cEventInfo(unsigned short serviceid, unsigned short eventid); +public: + ~cEventInfo(); + const char *GetTimeString(void) const; + const char *GetEndTimeString(void) const; + const char *GetDate(void) const; + bool IsFollowing(void) const; + bool IsPresent(void) const; + const char *GetExtendedDescription(void) const; + const char *GetSubtitle(void) const; + const char *GetTitle(void) const; + unsigned short GetEventID(void) const; + long GetDuration(void) const; + time_t GetTime(void) const; + u_char GetExtendedDescriptorNumber(void) const; + unsigned short GetServiceID(void) const; + int GetChannelNumber(void) const { return nChannelNumber; } + void SetChannelNumber(int ChannelNumber) const { ((cEventInfo *)this)->nChannelNumber = ChannelNumber; } // doesn't modify the EIT data, so it's ok to make it 'const' + }; + +class cSchedule : public cListObject { + friend class cSchedules; + friend class cEIT; +private: + cEventInfo *pPresent; + cEventInfo *pFollowing; + unsigned short uServiceID; + cList Events; +protected: + void SetServiceID(unsigned short servid); + bool SetFollowingEvent(cEventInfo *pEvent); + bool SetPresentEvent(cEventInfo *pEvent); + void Cleanup(time_t tTime); + void Cleanup(void); + cSchedule(unsigned short servid = 0); +public: + ~cSchedule(); + const cEventInfo *GetPresentEvent(void) const; + const cEventInfo *GetFollowingEvent(void) const; + unsigned short GetServiceID(void) const; + const cEventInfo *GetEvent(unsigned short uEventID) const; + const cEventInfo *GetEvent(time_t tTime) const; + const cEventInfo *GetEventNumber(int n) const { return Events.Get(n); } + int NumEvents(void) const { return Events.Count(); } + }; - bool bIsValid; - char szTitle[512]; - char szSubTitle[512]; - char szDate[12]; - char szTime[12]; +class cSchedules : public cList { + friend class cSIProcessor; +private: + const cSchedule *pCurrentSchedule; + unsigned short uCurrentServiceID; +protected: + bool SetCurrentServiceID(unsigned short servid); + void Cleanup(); +public: + cSchedules(void); + ~cSchedules(); + const cSchedule *GetSchedule(unsigned short servid) const; + const cSchedule *GetSchedule(void) const; +}; -}eit_event; +typedef struct sip_filter { -/** - *@author Robert Schneider - */ + u_char pid; + u_char tid; + int handle; + bool inuse; -class cEIT { -public: - cEIT(); - ~cEIT(); - /** */ - int GetEIT(); - /** */ - int SetProgramNumber(unsigned short pnr); - /** Retrieves the string representing the time of the current event */ - char * GetRunningTime(); - /** Retrieves the string representing the date of the current event */ - char * GetRunningDate(); - /** Retrieves the string for the running subtitle */ - char * GetRunningSubtitle(); - /** retrieves the string for the running title */ - char * GetRunningTitle(); - /** Retrieves the string representing the time of the next event */ - char * GetNextTime(); - /** Retrieves the string representing the date of the next event */ - char * GetNextDate(); - /** Retrieves the string for the next subtitle */ - char * GetNextSubtitle(); - /** retrieves the string for the next title */ - char * GetNextTitle(); - /** */ - bool IsValid(); +}SIP_FILTER; -protected: // Protected attributes - /** Device name of VBI device */ - const char * cszBitFilter; -protected: // Protected attributes - /** handle to VBI device (usually /dev/vbi) */ +class cSIProcessor : public cThread { +private: + cSchedules *schedules; + bool useTStime; + SIP_FILTER *filters; int fsvbi; - /** Describes the event next on */ - eit_event evtNext; - /** Describes the running event */ - eit_event evtRunning; -protected: // Protected methods - /** Set the bitfilter in vbi device to return -correct tables */ - int SetBitFilter(unsigned short pid, unsigned short section, unsigned short mode); - /** */ - int GetSection(unsigned char *buf, ushort PID, unsigned char sec); - /** */ - int CloseFilter(unsigned short handle); - /** */ - char * mjd2string(unsigned short mjd); - /** */ - int strdvbcpy(unsigned char *dst, unsigned char *src, int max); -public: // Public attributes - /** */ - unsigned short uProgramNumber; -}; + bool RefreshFilters(void); + void Action(void); +public: + cSIProcessor(const char *FileName); + ~cSIProcessor(); + bool SetUseTSTime(bool use); + bool AddFilter(u_char pid, u_char tid); + bool ShutDownFilters(void); + bool SetCurrentServiceID(unsigned short servid); + const cSchedules *Schedules(void) { return schedules; } + }; #endif -- cgit v1.2.3