2000-02-19 13:36:48 +01:00
|
|
|
/*
|
|
|
|
* menu.h: The actual menu implementations
|
|
|
|
*
|
2000-04-24 09:46:05 +02:00
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
2000-02-19 13:36:48 +01:00
|
|
|
* how to reach the author.
|
|
|
|
*
|
2012-03-08 13:51:00 +01:00
|
|
|
* $Id: menu.h 2.5 2012/03/08 13:11:40 kls Exp $
|
2000-02-19 13:36:48 +01:00
|
|
|
*/
|
|
|
|
|
2002-04-13 15:31:41 +02:00
|
|
|
#ifndef __MENU_H
|
|
|
|
#define __MENU_H
|
2000-02-19 13:36:48 +01:00
|
|
|
|
2003-01-06 14:44:27 +01:00
|
|
|
#include "ci.h"
|
2002-06-16 12:57:31 +02:00
|
|
|
#include "device.h"
|
2003-12-22 13:29:24 +01:00
|
|
|
#include "epg.h"
|
2004-05-16 10:35:36 +02:00
|
|
|
#include "osdbase.h"
|
2002-06-16 12:57:31 +02:00
|
|
|
#include "dvbplayer.h"
|
2005-08-27 09:37:33 +02:00
|
|
|
#include "menuitems.h"
|
2002-06-16 12:57:31 +02:00
|
|
|
#include "recorder.h"
|
2004-05-16 10:35:36 +02:00
|
|
|
#include "skins.h"
|
2000-02-19 13:36:48 +01:00
|
|
|
|
2004-05-23 09:40:38 +02:00
|
|
|
class cMenuText : public cOsdMenu {
|
|
|
|
private:
|
2004-05-23 09:54:06 +02:00
|
|
|
char *text;
|
2006-02-17 15:45:25 +01:00
|
|
|
eDvbFont font;
|
2004-05-23 09:40:38 +02:00
|
|
|
public:
|
|
|
|
cMenuText(const char *Title, const char *Text, eDvbFont Font = fontOsd);
|
2004-05-23 09:54:06 +02:00
|
|
|
virtual ~cMenuText();
|
|
|
|
void SetText(const char *Text);
|
2004-05-23 09:40:38 +02:00
|
|
|
virtual void Display(void);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2010-01-17 12:08:03 +01:00
|
|
|
class cMenuFolder : public cOsdMenu {
|
|
|
|
private:
|
|
|
|
cNestedItemList *nestedItemList;
|
|
|
|
cList<cNestedItem> *list;
|
|
|
|
cString dir;
|
|
|
|
cOsdItem *firstFolder;
|
|
|
|
bool editing;
|
|
|
|
void SetHelpKeys(void);
|
|
|
|
void Set(const char *CurrentFolder = NULL);
|
|
|
|
void DescendPath(const char *Path);
|
|
|
|
eOSState SetFolder(void);
|
|
|
|
eOSState Select(void);
|
|
|
|
eOSState New(void);
|
|
|
|
eOSState Delete(void);
|
|
|
|
eOSState Edit(void);
|
|
|
|
cMenuFolder(const char *Title, cList<cNestedItem> *List, cNestedItemList *NestedItemList, const char *Dir, const char *Path = NULL);
|
|
|
|
public:
|
|
|
|
cMenuFolder(const char *Title, cNestedItemList *NestedItemList, const char *Path = NULL);
|
|
|
|
cString GetFolder(void);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2010-02-06 10:18:20 +01:00
|
|
|
class cMenuCommands : public cOsdMenu {
|
|
|
|
private:
|
|
|
|
cList<cNestedItem> *commands;
|
|
|
|
cString parameters;
|
|
|
|
cString title;
|
|
|
|
cString command;
|
|
|
|
bool confirm;
|
|
|
|
char *result;
|
|
|
|
bool Parse(const char *s);
|
|
|
|
eOSState Execute(void);
|
|
|
|
public:
|
|
|
|
cMenuCommands(const char *Title, cList<cNestedItem> *Commands, const char *Parameters = NULL);
|
|
|
|
virtual ~cMenuCommands();
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2005-08-27 09:37:33 +02:00
|
|
|
class cMenuEditTimer : public cOsdMenu {
|
|
|
|
private:
|
|
|
|
cTimer *timer;
|
|
|
|
cTimer data;
|
|
|
|
int channel;
|
|
|
|
bool addIfConfirmed;
|
2010-01-17 12:08:03 +01:00
|
|
|
cMenuEditStrItem *file;
|
2012-03-08 13:51:00 +01:00
|
|
|
cMenuEditDateItem *day;
|
2005-08-27 09:37:33 +02:00
|
|
|
cMenuEditDateItem *firstday;
|
2010-01-17 12:08:03 +01:00
|
|
|
eOSState SetFolder(void);
|
2005-08-27 09:37:33 +02:00
|
|
|
void SetFirstDayItem(void);
|
2010-01-17 12:08:03 +01:00
|
|
|
void SetHelpKeys(void);
|
2005-08-27 09:37:33 +02:00
|
|
|
public:
|
|
|
|
cMenuEditTimer(cTimer *Timer, bool New = false);
|
|
|
|
virtual ~cMenuEditTimer();
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
|
|
|
class cMenuEvent : public cOsdMenu {
|
|
|
|
private:
|
|
|
|
const cEvent *event;
|
|
|
|
public:
|
2006-02-25 14:39:29 +01:00
|
|
|
cMenuEvent(const cEvent *Event, bool CanSwitch = false, bool Buttons = false);
|
2005-08-27 09:37:33 +02:00
|
|
|
virtual void Display(void);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2000-02-19 13:36:48 +01:00
|
|
|
class cMenuMain : public cOsdMenu {
|
2000-05-01 16:29:46 +02:00
|
|
|
private:
|
2002-03-08 16:11:34 +01:00
|
|
|
bool replaying;
|
2005-12-24 15:53:53 +01:00
|
|
|
cOsdItem *stopReplayItem;
|
|
|
|
cOsdItem *cancelEditingItem;
|
|
|
|
cOsdItem *stopRecordingItem;
|
|
|
|
int recordControlsState;
|
2002-11-24 10:45:39 +01:00
|
|
|
static cOsdObject *pluginOsdObject;
|
2005-09-03 11:33:43 +02:00
|
|
|
void Set(void);
|
2005-12-24 15:53:53 +01:00
|
|
|
bool Update(bool Force = false);
|
2000-02-19 13:36:48 +01:00
|
|
|
public:
|
2005-12-24 15:53:53 +01:00
|
|
|
cMenuMain(eOSState State = osUnknown);
|
2000-03-11 11:22:37 +01:00
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
2002-11-24 10:45:39 +01:00
|
|
|
static cOsdObject *PluginOsdObject(void);
|
2000-02-19 13:36:48 +01:00
|
|
|
};
|
2001-08-03 14:18:08 +02:00
|
|
|
|
2002-05-18 12:41:18 +02:00
|
|
|
class cDisplayChannel : public cOsdObject {
|
2000-09-10 14:56:18 +02:00
|
|
|
private:
|
2004-05-16 10:35:36 +02:00
|
|
|
cSkinDisplayChannel *displayChannel;
|
2001-09-08 14:39:09 +02:00
|
|
|
int group;
|
|
|
|
bool withInfo;
|
2004-12-19 18:08:09 +01:00
|
|
|
cTimeMs lastTime;
|
2002-09-29 13:40:45 +02:00
|
|
|
int number;
|
2006-01-04 14:45:23 +01:00
|
|
|
bool timeout;
|
2003-12-22 13:29:24 +01:00
|
|
|
cChannel *channel;
|
2004-05-16 10:35:36 +02:00
|
|
|
const cEvent *lastPresent;
|
|
|
|
const cEvent *lastFollowing;
|
2006-01-22 14:27:53 +01:00
|
|
|
static cDisplayChannel *currentDisplayChannel;
|
2003-12-22 13:29:24 +01:00
|
|
|
void DisplayChannel(void);
|
2000-11-01 15:41:33 +01:00
|
|
|
void DisplayInfo(void);
|
2002-10-27 14:32:06 +01:00
|
|
|
void Refresh(void);
|
2006-01-22 14:27:53 +01:00
|
|
|
cChannel *NextAvailableChannel(cChannel *Channel, int Direction);
|
2000-09-10 14:56:18 +02:00
|
|
|
public:
|
2001-09-08 14:39:09 +02:00
|
|
|
cDisplayChannel(int Number, bool Switched);
|
2000-11-01 15:41:33 +01:00
|
|
|
cDisplayChannel(eKeys FirstKey);
|
|
|
|
virtual ~cDisplayChannel();
|
2000-09-10 14:56:18 +02:00
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
2006-01-22 14:27:53 +01:00
|
|
|
static bool IsOpen(void) { return currentDisplayChannel != NULL; }
|
2000-09-10 14:56:18 +02:00
|
|
|
};
|
|
|
|
|
2002-05-18 12:41:18 +02:00
|
|
|
class cDisplayVolume : public cOsdObject {
|
2002-03-09 17:11:49 +01:00
|
|
|
private:
|
2004-05-16 10:35:36 +02:00
|
|
|
cSkinDisplayVolume *displayVolume;
|
2004-12-19 18:08:09 +01:00
|
|
|
cTimeMs timeout;
|
2004-05-16 10:35:36 +02:00
|
|
|
static cDisplayVolume *currentDisplayVolume;
|
2003-05-24 16:41:35 +02:00
|
|
|
virtual void Show(void);
|
2002-03-09 17:11:49 +01:00
|
|
|
cDisplayVolume(void);
|
|
|
|
public:
|
|
|
|
virtual ~cDisplayVolume();
|
|
|
|
static cDisplayVolume *Create(void);
|
|
|
|
static void Process(eKeys Key);
|
|
|
|
eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2005-01-02 15:11:44 +01:00
|
|
|
class cDisplayTracks : public cOsdObject {
|
|
|
|
private:
|
|
|
|
cSkinDisplayTracks *displayTracks;
|
|
|
|
cTimeMs timeout;
|
|
|
|
eTrackType types[ttMaxTrackTypes];
|
2007-08-12 10:37:58 +02:00
|
|
|
char *descriptions[ttMaxTrackTypes + 1]; // list is NULL terminated
|
2005-01-09 12:08:34 +01:00
|
|
|
int numTracks, track, audioChannel;
|
2005-01-02 15:11:44 +01:00
|
|
|
static cDisplayTracks *currentDisplayTracks;
|
|
|
|
virtual void Show(void);
|
|
|
|
cDisplayTracks(void);
|
|
|
|
public:
|
|
|
|
virtual ~cDisplayTracks();
|
2005-01-06 14:36:40 +01:00
|
|
|
static bool IsOpen(void) { return currentDisplayTracks != NULL; }
|
2005-01-02 15:11:44 +01:00
|
|
|
static cDisplayTracks *Create(void);
|
2007-10-12 14:52:30 +02:00
|
|
|
static void Process(eKeys Key);
|
|
|
|
eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
|
|
|
class cDisplaySubtitleTracks : public cOsdObject {
|
|
|
|
private:
|
|
|
|
cSkinDisplayTracks *displayTracks;
|
|
|
|
cTimeMs timeout;
|
|
|
|
eTrackType types[ttMaxTrackTypes];
|
|
|
|
char *descriptions[ttMaxTrackTypes + 1]; // list is NULL terminated
|
|
|
|
int numTracks, track;
|
|
|
|
static cDisplaySubtitleTracks *currentDisplayTracks;
|
|
|
|
virtual void Show(void);
|
|
|
|
cDisplaySubtitleTracks(void);
|
|
|
|
public:
|
|
|
|
virtual ~cDisplaySubtitleTracks();
|
|
|
|
static bool IsOpen(void) { return currentDisplayTracks != NULL; }
|
|
|
|
static cDisplaySubtitleTracks *Create(void);
|
2005-01-02 15:11:44 +01:00
|
|
|
static void Process(eKeys Key);
|
|
|
|
eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2003-01-06 14:44:27 +01:00
|
|
|
cOsdObject *CamControl(void);
|
|
|
|
|
2002-01-20 14:05:28 +01:00
|
|
|
class cMenuRecordingItem;
|
|
|
|
|
2000-10-08 15:08:26 +02:00
|
|
|
class cMenuRecordings : public cOsdMenu {
|
|
|
|
private:
|
2002-01-20 14:05:28 +01:00
|
|
|
char *base;
|
|
|
|
int level;
|
2005-09-25 11:00:57 +02:00
|
|
|
int recordingsState;
|
2005-11-06 09:44:58 +01:00
|
|
|
int helpKeys;
|
2008-02-10 11:46:20 +01:00
|
|
|
bool SetFreeDiskDisplay(bool Force = false);
|
2002-01-20 14:05:28 +01:00
|
|
|
void SetHelpKeys(void);
|
2005-09-25 11:00:57 +02:00
|
|
|
void Set(bool Refresh = false);
|
2002-01-20 14:05:28 +01:00
|
|
|
bool Open(bool OpenSubMenus = false);
|
2000-10-08 15:08:26 +02:00
|
|
|
eOSState Play(void);
|
2001-02-11 11:04:41 +01:00
|
|
|
eOSState Rewind(void);
|
2002-10-06 10:40:27 +02:00
|
|
|
eOSState Delete(void);
|
2005-05-16 14:45:11 +02:00
|
|
|
eOSState Info(void);
|
2002-10-13 12:14:49 +02:00
|
|
|
eOSState Commands(eKeys Key = kNone);
|
2006-03-25 12:17:12 +01:00
|
|
|
protected:
|
|
|
|
cRecording *GetRecording(cMenuRecordingItem *Item);
|
2000-10-08 15:08:26 +02:00
|
|
|
public:
|
2002-01-20 14:05:28 +01:00
|
|
|
cMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false);
|
|
|
|
~cMenuRecordings();
|
2000-10-08 15:08:26 +02:00
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2000-05-01 16:29:46 +02:00
|
|
|
class cRecordControl {
|
2000-04-30 10:22:13 +02:00
|
|
|
private:
|
2002-06-16 12:57:31 +02:00
|
|
|
cDevice *device;
|
2000-04-30 10:22:13 +02:00
|
|
|
cTimer *timer;
|
2002-06-16 12:57:31 +02:00
|
|
|
cRecorder *recorder;
|
2003-12-22 13:29:24 +01:00
|
|
|
const cEvent *event;
|
2008-02-15 14:57:48 +01:00
|
|
|
cString instantId;
|
2001-09-23 14:02:11 +02:00
|
|
|
char *fileName;
|
2003-12-22 13:29:24 +01:00
|
|
|
bool GetEvent(void);
|
2000-04-30 10:22:13 +02:00
|
|
|
public:
|
2003-05-11 14:10:00 +02:00
|
|
|
cRecordControl(cDevice *Device, cTimer *Timer = NULL, bool Pause = false);
|
2000-04-30 10:22:13 +02:00
|
|
|
virtual ~cRecordControl();
|
2001-09-01 15:04:14 +02:00
|
|
|
bool Process(time_t t);
|
2004-02-15 14:31:53 +01:00
|
|
|
cDevice *Device(void) { return device; }
|
2010-03-07 12:43:30 +01:00
|
|
|
void Stop(bool ExecuteUserCommand = true);
|
2000-05-01 16:29:46 +02:00
|
|
|
const char *InstantId(void) { return instantId; }
|
2002-02-17 14:29:13 +01:00
|
|
|
const char *FileName(void) { return fileName; }
|
|
|
|
cTimer *Timer(void) { return timer; }
|
2000-05-01 16:29:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class cRecordControls {
|
|
|
|
private:
|
2002-06-16 12:57:31 +02:00
|
|
|
static cRecordControl *RecordControls[];
|
2005-12-24 15:53:53 +01:00
|
|
|
static int state;
|
2000-05-01 16:29:46 +02:00
|
|
|
public:
|
2003-05-11 14:10:00 +02:00
|
|
|
static bool Start(cTimer *Timer = NULL, bool Pause = false);
|
2000-05-01 16:29:46 +02:00
|
|
|
static void Stop(const char *InstantId);
|
2003-04-21 14:57:13 +02:00
|
|
|
static bool PauseLiveVideo(void);
|
2000-05-01 16:29:46 +02:00
|
|
|
static const char *GetInstantId(const char *LastInstantId);
|
2002-02-17 14:29:13 +01:00
|
|
|
static cRecordControl *GetRecordControl(const char *FileName);
|
2001-09-01 15:04:14 +02:00
|
|
|
static void Process(time_t t);
|
2004-01-04 12:30:00 +01:00
|
|
|
static void ChannelDataModified(cChannel *Channel);
|
2001-02-04 12:36:32 +01:00
|
|
|
static bool Active(void);
|
2002-06-16 12:57:31 +02:00
|
|
|
static void Shutdown(void);
|
2005-12-24 15:53:53 +01:00
|
|
|
static void ChangeState(void) { state++; }
|
|
|
|
static bool StateChanged(int &State);
|
2000-04-30 10:22:13 +02:00
|
|
|
};
|
|
|
|
|
2002-06-16 12:57:31 +02:00
|
|
|
class cReplayControl : public cDvbPlayerControl {
|
2000-04-24 15:32:11 +02:00
|
|
|
private:
|
2004-05-16 10:35:36 +02:00
|
|
|
cSkinDisplayReplay *displayReplay;
|
2000-12-28 12:57:16 +01:00
|
|
|
cMarks marks;
|
2001-09-14 14:06:43 +02:00
|
|
|
bool visible, modeOnly, shown, displayFrames;
|
2001-07-28 13:16:23 +02:00
|
|
|
int lastCurrent, lastTotal;
|
2004-05-16 10:35:36 +02:00
|
|
|
bool lastPlay, lastForward;
|
|
|
|
int lastSpeed;
|
2001-07-28 14:06:36 +02:00
|
|
|
time_t timeoutShow;
|
2003-12-22 13:29:24 +01:00
|
|
|
bool timeSearchActive, timeSearchHide;
|
2002-03-31 15:26:18 +02:00
|
|
|
int timeSearchTime, timeSearchPos;
|
2001-08-11 14:30:21 +02:00
|
|
|
void TimeSearchDisplay(void);
|
|
|
|
void TimeSearchProcess(eKeys Key);
|
|
|
|
void TimeSearch(void);
|
2003-05-24 16:41:35 +02:00
|
|
|
void ShowTimed(int Seconds = 0);
|
2006-10-20 13:42:14 +02:00
|
|
|
static cReplayControl *currentReplayControl;
|
2000-04-29 15:57:42 +02:00
|
|
|
static char *fileName;
|
|
|
|
static char *title;
|
2001-09-14 15:10:12 +02:00
|
|
|
void ShowMode(void);
|
2000-12-09 11:13:00 +01:00
|
|
|
bool ShowProgress(bool Initial);
|
2000-12-28 12:57:16 +01:00
|
|
|
void MarkToggle(void);
|
|
|
|
void MarkJump(bool Forward);
|
|
|
|
void MarkMove(bool Forward);
|
|
|
|
void EditCut(void);
|
|
|
|
void EditTest(void);
|
2000-04-23 15:38:16 +02:00
|
|
|
public:
|
2012-02-19 11:50:20 +01:00
|
|
|
cReplayControl(bool PauseLive = false);
|
2000-04-29 15:57:42 +02:00
|
|
|
virtual ~cReplayControl();
|
2010-03-07 12:43:30 +01:00
|
|
|
void Stop(void);
|
2006-01-06 12:53:28 +01:00
|
|
|
virtual cOsdObject *GetInfo(void);
|
2000-04-29 15:57:42 +02:00
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
2003-05-24 16:41:35 +02:00
|
|
|
virtual void Show(void);
|
2002-06-23 09:44:00 +02:00
|
|
|
virtual void Hide(void);
|
2000-04-29 15:57:42 +02:00
|
|
|
bool Visible(void) { return visible; }
|
|
|
|
static void SetRecording(const char *FileName, const char *Title);
|
2006-10-20 13:42:14 +02:00
|
|
|
static const char *NowReplaying(void);
|
2000-10-08 15:08:26 +02:00
|
|
|
static const char *LastReplayed(void);
|
2000-10-08 15:41:30 +02:00
|
|
|
static void ClearLastReplayed(const char *FileName);
|
2000-04-23 15:38:16 +02:00
|
|
|
};
|
|
|
|
|
2002-04-13 15:31:41 +02:00
|
|
|
#endif //__MENU_H
|