vdr  2.0.4
menu.h
Go to the documentation of this file.
1 /*
2  * menu.h: The actual menu implementations
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: menu.h 2.13.1.1 2013/10/16 09:46:15 kls Exp $
8  */
9 
10 #ifndef __MENU_H
11 #define __MENU_H
12 
13 #include "ci.h"
14 #include "device.h"
15 #include "epg.h"
16 #include "osdbase.h"
17 #include "dvbplayer.h"
18 #include "menuitems.h"
19 #include "recorder.h"
20 #include "skins.h"
21 
22 class cMenuText : public cOsdMenu {
23 private:
24  char *text;
26 public:
27  cMenuText(const char *Title, const char *Text, eDvbFont Font = fontOsd);
28  virtual ~cMenuText();
29  void SetText(const char *Text);
30  virtual void Display(void);
31  virtual eOSState ProcessKey(eKeys Key);
32  };
33 
34 class cMenuFolder : public cOsdMenu {
35 private:
40  bool editing;
41  void SetHelpKeys(void);
42  void Set(const char *CurrentFolder = NULL);
43  void DescendPath(const char *Path);
44  eOSState SetFolder(void);
45  eOSState Select(void);
46  eOSState New(void);
47  eOSState Delete(void);
48  eOSState Edit(void);
49  cMenuFolder(const char *Title, cList<cNestedItem> *List, cNestedItemList *NestedItemList, const char *Dir, const char *Path = NULL);
50 public:
51  cMenuFolder(const char *Title, cNestedItemList *NestedItemList, const char *Path = NULL);
52  cString GetFolder(void);
53  virtual eOSState ProcessKey(eKeys Key);
54  };
55 
56 class cMenuCommands : public cOsdMenu {
57 private:
62  bool confirm;
63  char *result;
64  bool Parse(const char *s);
65  eOSState Execute(void);
66 public:
67  cMenuCommands(const char *Title, cList<cNestedItem> *Commands, const char *Parameters = NULL);
68  virtual ~cMenuCommands();
69  virtual eOSState ProcessKey(eKeys Key);
70  };
71 
72 class cMenuEditTimer : public cOsdMenu {
73 private:
76  int channel;
81  eOSState SetFolder(void);
82  void SetFirstDayItem(void);
83  void SetHelpKeys(void);
84 public:
85  cMenuEditTimer(cTimer *Timer, bool New = false);
86  virtual ~cMenuEditTimer();
87  virtual eOSState ProcessKey(eKeys Key);
88  };
89 
90 class cMenuEvent : public cOsdMenu {
91 private:
92  const cEvent *event;
93 public:
94  cMenuEvent(const cEvent *Event, bool CanSwitch = false, bool Buttons = false);
95  virtual void Display(void);
96  virtual eOSState ProcessKey(eKeys Key);
97  };
98 
99 class cMenuMain : public cOsdMenu {
100 private:
101  bool replaying;
108  void Set(void);
109  bool Update(bool Force = false);
110 public:
111  cMenuMain(eOSState State = osUnknown, bool OpenSubMenus = false);
112  virtual eOSState ProcessKey(eKeys Key);
113  static cOsdObject *PluginOsdObject(void);
114  };
115 
116 class cDisplayChannel : public cOsdObject {
117 private:
119  int group;
120  bool withInfo;
122  int number;
123  bool timeout;
128  void DisplayChannel(void);
129  void DisplayInfo(void);
130  void Refresh(void);
131  cChannel *NextAvailableChannel(cChannel *Channel, int Direction);
132 public:
133  cDisplayChannel(int Number, bool Switched);
134  cDisplayChannel(eKeys FirstKey);
135  virtual ~cDisplayChannel();
136  virtual eOSState ProcessKey(eKeys Key);
137  static bool IsOpen(void) { return currentDisplayChannel != NULL; }
138  };
139 
140 class cDisplayVolume : public cOsdObject {
141 private:
145  virtual void Show(void);
146  cDisplayVolume(void);
147 public:
148  virtual ~cDisplayVolume();
149  static cDisplayVolume *Create(void);
150  static void Process(eKeys Key);
152  };
153 
154 class cDisplayTracks : public cOsdObject {
155 private:
159  char *descriptions[ttMaxTrackTypes + 1]; // list is NULL terminated
162  virtual void Show(void);
163  cDisplayTracks(void);
164 public:
165  virtual ~cDisplayTracks();
166  static bool IsOpen(void) { return currentDisplayTracks != NULL; }
167  static cDisplayTracks *Create(void);
168  static void Process(eKeys Key);
170  };
171 
173 private:
177  char *descriptions[ttMaxTrackTypes + 1]; // list is NULL terminated
180  virtual void Show(void);
182 public:
183  virtual ~cDisplaySubtitleTracks();
184  static bool IsOpen(void) { return currentDisplayTracks != NULL; }
185  static cDisplaySubtitleTracks *Create(void);
186  static void Process(eKeys Key);
188  };
189 
190 cOsdObject *CamControl(void);
191 bool CamMenuActive(void);
192 
193 class cMenuRecordingItem;
194 
195 class cMenuRecordings : public cOsdMenu {
196 private:
197  char *base;
198  int level;
200  int helpKeys;
201  void SetHelpKeys(void);
202  void Set(bool Refresh = false);
203  bool Open(bool OpenSubMenus = false);
204  eOSState Play(void);
205  eOSState Rewind(void);
206  eOSState Delete(void);
207  eOSState Info(void);
208  eOSState Sort(void);
209  eOSState Commands(eKeys Key = kNone);
210  eOSState Edit(void);
211 protected:
212  cString DirectoryName(void);
213 public:
214  cMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false);
216  virtual eOSState ProcessKey(eKeys Key);
217  };
218 
220 private:
224  const cEvent *event;
226  char *fileName;
227  bool GetEvent(void);
228 public:
229  cRecordControl(cDevice *Device, cTimer *Timer = NULL, bool Pause = false);
230  virtual ~cRecordControl();
231  bool Process(time_t t);
232  cDevice *Device(void) { return device; }
233  void Stop(bool ExecuteUserCommand = true);
234  const char *InstantId(void) { return instantId; }
235  const char *FileName(void) { return fileName; }
236  cTimer *Timer(void) { return timer; }
237  };
238 
240 private:
242  static int state;
243 public:
244  static bool Start(cTimer *Timer = NULL, bool Pause = false);
245  static void Stop(const char *InstantId);
246  static bool PauseLiveVideo(void);
247  static const char *GetInstantId(const char *LastInstantId);
248  static cRecordControl *GetRecordControl(const char *FileName);
249  static cRecordControl *GetRecordControl(const cTimer *Timer);
252  static void Process(time_t t);
253  static void ChannelDataModified(cChannel *Channel);
254  static bool Active(void);
255  static void Shutdown(void);
256  static void ChangeState(void) { state++; }
257  static bool StateChanged(int &State);
258  };
259 
261 private:
272  time_t timeoutShow;
275  void TimeSearchDisplay(void);
276  void TimeSearchProcess(eKeys Key);
277  void TimeSearch(void);
278  void ShowTimed(int Seconds = 0);
281  void ShowMode(void);
282  bool ShowProgress(bool Initial);
283  void MarkToggle(void);
284  void MarkJump(bool Forward);
285  void MarkMove(bool Forward);
286  void EditCut(void);
287  void EditTest(void);
288 public:
289  cReplayControl(bool PauseLive = false);
290  virtual ~cReplayControl();
291  void Stop(void);
292  virtual cOsdObject *GetInfo(void);
293  virtual const cRecording *GetRecording(void);
294  virtual eOSState ProcessKey(eKeys Key);
295  virtual void Show(void);
296  virtual void Hide(void);
297  bool Visible(void) { return visible; }
298  static void SetRecording(const char *FileName);
299  static const char *NowReplaying(void);
300  static const char *LastReplayed(void);
301  static void ClearLastReplayed(const char *FileName);
302  };
303 
304 #endif //__MENU_H
305