vdr  2.0.2
status.h
Go to the documentation of this file.
1 /*
2  * status.h: Status monitoring
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: status.h 2.1 2012/03/07 14:16:57 kls Exp $
8  */
9 
10 #ifndef __STATUS_H
11 #define __STATUS_H
12 
13 #include "config.h"
14 #include "device.h"
15 #include "player.h"
16 #include "tools.h"
17 
19 
20 class cTimer;
21 
22 class cStatus : public cListObject {
23 private:
25 protected:
26  // These functions can be implemented by derived classes to receive status information:
27  virtual void TimerChange(const cTimer *Timer, eTimerChange Change) {}
28  // Indicates a change in the timer settings.
29  // If Change is tcAdd or tcDel, Timer points to the timer that has
30  // been added or will be deleted, respectively. In case of tcMod,
31  // Timer is NULL; this indicates that some timer has been changed.
32  // Note that tcAdd and tcDel are always also followed by a tcMod.
33  virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView) {}
34  // Indicates a channel switch on the given DVB device.
35  // If ChannelNumber is 0, this is before the channel is being switched,
36  // otherwise ChannelNumber is the number of the channel that has been switched to.
37  // LiveView tells whether this channel switch is for live viewing.
38  virtual void Recording(const cDevice *Device, const char *Name, const char *FileName, bool On) {}
39  // The given DVB device has started (On = true) or stopped (On = false) recording Name.
40  // Name is the name of the recording, without any directory path. The full file name
41  // of the recording is given in FileName, which may be NULL in case there is no
42  // actual file involved. If On is false, Name may be NULL.
43  virtual void Replaying(const cControl *Control, const char *Name, const char *FileName, bool On) {}
44  // The given player control has started (On = true) or stopped (On = false) replaying Name.
45  // Name is the name of the recording, without any directory path. In case of a player that can't provide
46  // a name, Name can be a string that identifies the player type (like, e.g., "DVD").
47  // The full file name of the recording is given in FileName, which may be NULL in case there is no
48  // actual file involved. If On is false, Name may be NULL.
49  virtual void SetVolume(int Volume, bool Absolute) {}
50  // The volume has been set to the given value, either
51  // absolutely or relative to the current volume.
52  virtual void SetAudioTrack(int Index, const char * const *Tracks) {}
53  // The audio track has been set to the one given by Index, which
54  // points into the Tracks array of strings. Tracks is NULL terminated.
55  virtual void SetAudioChannel(int AudioChannel) {}
56  // The audio channel has been set to the given value.
57  // 0=stereo, 1=left, 2=right, -1=no information available.
58  virtual void SetSubtitleTrack(int Index, const char * const *Tracks) {}
59  // The subtitle track has been set to the one given by Index, which
60  // points into the Tracks array of strings. Tracks is NULL terminated.
61  virtual void OsdClear(void) {}
62  // The OSD has been cleared.
63  virtual void OsdTitle(const char *Title) {}
64  // Title has been displayed in the title line of the menu.
65  virtual void OsdStatusMessage(const char *Message) {}
66  // Message has been displayed in the status line of the menu.
67  // If Message is NULL, the status line has been cleared.
68  virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue) {}
69  // The help keys have been set to the given values (may be NULL).
70  virtual void OsdItem(const char *Text, int Index) {}
71  // The OSD displays the given single line Text as menu item at Index.
72  virtual void OsdCurrentItem(const char *Text) {}
73  // The OSD displays the given single line Text as the current menu item.
74  virtual void OsdTextItem(const char *Text, bool Scroll) {}
75  // The OSD displays the given multi line text. If Text points to an
76  // actual string, that text shall be displayed and Scroll has no
77  // meaning. If Text is NULL, Scroll defines whether the previously
78  // received text shall be scrolled up (true) or down (false) and
79  // the text shall be redisplayed with the new offset.
80  virtual void OsdChannel(const char *Text) {}
81  // The OSD displays the single line Text with the current channel information.
82  virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
83  // The OSD displays the given programme information.
84 public:
85  cStatus(void);
86  virtual ~cStatus();
87  // These functions are called whenever the related status information changes:
88  static void MsgTimerChange(const cTimer *Timer, eTimerChange Change);
89  static void MsgChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView);
90  static void MsgRecording(const cDevice *Device, const char *Name, const char *FileName, bool On);
91  static void MsgReplaying(const cControl *Control, const char *Name, const char *FileName, bool On);
92  static void MsgSetVolume(int Volume, bool Absolute);
93  static void MsgSetAudioTrack(int Index, const char * const *Tracks);
94  static void MsgSetAudioChannel(int AudioChannel);
95  static void MsgSetSubtitleTrack(int Index, const char * const *Tracks);
96  static void MsgOsdClear(void);
97  static void MsgOsdTitle(const char *Title);
98  static void MsgOsdStatusMessage(const char *Message);
99  static void MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue);
100  static void MsgOsdItem(const char *Text, int Index);
101  static void MsgOsdCurrentItem(const char *Text);
102  static void MsgOsdTextItem(const char *Text, bool Scroll = false);
103  static void MsgOsdChannel(const char *Text);
104  static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
105  };
106 
107 #endif //__STATUS_H
108