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