vdr
1.7.27
|
00001 /* 00002 * status.h: Status monitoring 00003 * 00004 * See the main source file 'vdr.c' for copyright information and 00005 * how to reach the author. 00006 * 00007 * $Id: status.h 2.1 2012/03/07 14:16:57 kls Exp $ 00008 */ 00009 00010 #ifndef __STATUS_H 00011 #define __STATUS_H 00012 00013 #include "config.h" 00014 #include "device.h" 00015 #include "player.h" 00016 #include "tools.h" 00017 00018 enum eTimerChange { tcMod, tcAdd, tcDel }; 00019 00020 class cTimer; 00021 00022 class cStatus : public cListObject { 00023 private: 00024 static cList<cStatus> statusMonitors; 00025 protected: 00026 // These functions can be implemented by derived classes to receive status information: 00027 virtual void TimerChange(const cTimer *Timer, eTimerChange Change) {} 00028 // Indicates a change in the timer settings. 00029 // If Change is tcAdd or tcDel, Timer points to the timer that has 00030 // been added or will be deleted, respectively. In case of tcMod, 00031 // Timer is NULL; this indicates that some timer has been changed. 00032 // Note that tcAdd and tcDel are always also followed by a tcMod. 00033 virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView) {} 00034 // Indicates a channel switch on the given DVB device. 00035 // If ChannelNumber is 0, this is before the channel is being switched, 00036 // otherwise ChannelNumber is the number of the channel that has been switched to. 00037 // LiveView tells whether this channel switch is for live viewing. 00038 virtual void Recording(const cDevice *Device, const char *Name, const char *FileName, bool On) {} 00039 // The given DVB device has started (On = true) or stopped (On = false) recording Name. 00040 // Name is the name of the recording, without any directory path. The full file name 00041 // of the recording is given in FileName, which may be NULL in case there is no 00042 // actual file involved. If On is false, Name may be NULL. 00043 virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On) {} 00044 // The given player control has started (On = true) or stopped (On = false) replaying Name. 00045 // Name is the name of the recording, without any directory path. In case of a player that can't provide 00046 // a name, Name can be a string that identifies the player type (like, e.g., "DVD"). 00047 // The full file name of the recording is given in FileName, which may be NULL in case there is no 00048 // actual file involved. If On is false, Name may be NULL. 00049 virtual void SetVolume(int Volume, bool Absolute) {} 00050 // The volume has been set to the given value, either 00051 // absolutely or relative to the current volume. 00052 virtual void SetAudioTrack(int Index, const char * const *Tracks) {} 00053 // The audio track has been set to the one given by Index, which 00054 // points into the Tracks array of strings. Tracks is NULL terminated. 00055 virtual void SetAudioChannel(int AudioChannel) {} 00056 // The audio channel has been set to the given value. 00057 // 0=stereo, 1=left, 2=right, -1=no information available. 00058 virtual void SetSubtitleTrack(int Index, const char * const *Tracks) {} 00059 // The subtitle track has been set to the one given by Index, which 00060 // points into the Tracks array of strings. Tracks is NULL terminated. 00061 virtual void OsdClear(void) {} 00062 // The OSD has been cleared. 00063 virtual void OsdTitle(const char *Title) {} 00064 // Title has been displayed in the title line of the menu. 00065 virtual void OsdStatusMessage(const char *Message) {} 00066 // Message has been displayed in the status line of the menu. 00067 // If Message is NULL, the status line has been cleared. 00068 virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue) {} 00069 // The help keys have been set to the given values (may be NULL). 00070 virtual void OsdItem(const char *Text, int Index) {} 00071 // The OSD displays the given single line Text as menu item at Index. 00072 virtual void OsdCurrentItem(const char *Text) {} 00073 // The OSD displays the given single line Text as the current menu item. 00074 virtual void OsdTextItem(const char *Text, bool Scroll) {} 00075 // The OSD displays the given multi line text. If Text points to an 00076 // actual string, that text shall be displayed and Scroll has no 00077 // meaning. If Text is NULL, Scroll defines whether the previously 00078 // received text shall be scrolled up (true) or down (false) and 00079 // the text shall be redisplayed with the new offset. 00080 virtual void OsdChannel(const char *Text) {} 00081 // The OSD displays the single line Text with the current channel information. 00082 virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {} 00083 // The OSD displays the given programme information. 00084 public: 00085 cStatus(void); 00086 virtual ~cStatus(); 00087 // These functions are called whenever the related status information changes: 00088 static void MsgTimerChange(const cTimer *Timer, eTimerChange Change); 00089 static void MsgChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView); 00090 static void MsgRecording(const cDevice *Device, const char *Name, const char *FileName, bool On); 00091 static void MsgReplaying(const cControl *Control, const char *Name, const char *FileName, bool On); 00092 static void MsgSetVolume(int Volume, bool Absolute); 00093 static void MsgSetAudioTrack(int Index, const char * const *Tracks); 00094 static void MsgSetAudioChannel(int AudioChannel); 00095 static void MsgSetSubtitleTrack(int Index, const char * const *Tracks); 00096 static void MsgOsdClear(void); 00097 static void MsgOsdTitle(const char *Title); 00098 static void MsgOsdStatusMessage(const char *Message); 00099 static void MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue); 00100 static void MsgOsdItem(const char *Text, int Index); 00101 static void MsgOsdCurrentItem(const char *Text); 00102 static void MsgOsdTextItem(const char *Text, bool Scroll = false); 00103 static void MsgOsdChannel(const char *Text); 00104 static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle); 00105 }; 00106 00107 #endif //__STATUS_H