1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00
vdr/menu.h

235 lines
6.1 KiB
C
Raw Normal View History

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.
*
* $Id: menu.h 1.87 2007/01/07 14:40:54 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
#include "ci.h"
#include "device.h"
#include "epg.h"
2004-05-16 10:35:36 +02:00
#include "osdbase.h"
#include "dvbplayer.h"
#include "menuitems.h"
#include "recorder.h"
2004-05-16 10:35:36 +02:00
#include "skins.h"
2000-02-19 13:36:48 +01: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;
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);
virtual void Display(void);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditTimer : public cOsdMenu {
private:
cTimer *timer;
cTimer data;
int channel;
bool addIfConfirmed;
cMenuEditDateItem *firstday;
void SetFirstDayItem(void);
public:
cMenuEditTimer(cTimer *Timer, bool New = false);
virtual ~cMenuEditTimer();
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEvent : public cOsdMenu {
private:
const cEvent *event;
public:
cMenuEvent(const cEvent *Event, bool CanSwitch = false, bool Buttons = false);
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:
time_t lastDiskSpaceCheck;
int lastFreeMB;
bool replaying;
cOsdItem *stopReplayItem;
cOsdItem *cancelEditingItem;
cOsdItem *stopRecordingItem;
int recordControlsState;
2002-11-24 10:45:39 +01:00
static cOsdObject *pluginOsdObject;
void Set(void);
bool Update(bool Force = false);
2000-02-19 13:36:48 +01:00
public:
cMenuMain(eOSState State = osUnknown);
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
class cDisplayChannel : public cOsdObject {
private:
2004-05-16 10:35:36 +02:00
cSkinDisplayChannel *displayChannel;
int group;
bool withInfo;
cTimeMs lastTime;
2002-09-29 13:40:45 +02:00
int number;
bool timeout;
cChannel *channel;
2004-05-16 10:35:36 +02:00
const cEvent *lastPresent;
const cEvent *lastFollowing;
static cDisplayChannel *currentDisplayChannel;
void DisplayChannel(void);
void DisplayInfo(void);
2002-10-27 14:32:06 +01:00
void Refresh(void);
cChannel *NextAvailableChannel(cChannel *Channel, int Direction);
public:
cDisplayChannel(int Number, bool Switched);
cDisplayChannel(eKeys FirstKey);
virtual ~cDisplayChannel();
virtual eOSState ProcessKey(eKeys Key);
static bool IsOpen(void) { return currentDisplayChannel != NULL; }
};
class cDisplayVolume : public cOsdObject {
2002-03-09 17:11:49 +01:00
private:
2004-05-16 10:35:36 +02:00
cSkinDisplayVolume *displayVolume;
cTimeMs timeout;
2004-05-16 10:35:36 +02:00
static cDisplayVolume *currentDisplayVolume;
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];
char *descriptions[ttMaxTrackTypes];
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);
static void Process(eKeys Key);
eOSState ProcessKey(eKeys Key);
};
cOsdObject *CamControl(void);
class cMenuRecordingItem;
class cMenuRecordings : public cOsdMenu {
private:
char *base;
int level;
int recordingsState;
int helpKeys;
void SetHelpKeys(void);
void Set(bool Refresh = false);
bool Open(bool OpenSubMenus = false);
eOSState Play(void);
eOSState Rewind(void);
eOSState Delete(void);
eOSState Info(void);
2002-10-13 12:14:49 +02:00
eOSState Commands(eKeys Key = kNone);
protected:
cRecording *GetRecording(cMenuRecordingItem *Item);
public:
cMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false);
~cMenuRecordings();
virtual eOSState ProcessKey(eKeys Key);
};
2000-05-01 16:29:46 +02:00
class cRecordControl {
2000-04-30 10:22:13 +02:00
private:
cDevice *device;
2000-04-30 10:22:13 +02:00
cTimer *timer;
cRecorder *recorder;
const cEvent *event;
2000-05-01 16:29:46 +02:00
char *instantId;
char *fileName;
bool GetEvent(void);
2000-04-30 10:22:13 +02:00
public:
cRecordControl(cDevice *Device, cTimer *Timer = NULL, bool Pause = false);
2000-04-30 10:22:13 +02:00
virtual ~cRecordControl();
bool Process(time_t t);
cDevice *Device(void) { return device; }
void Stop(void);
2000-05-01 16:29:46 +02:00
const char *InstantId(void) { return instantId; }
const char *FileName(void) { return fileName; }
cTimer *Timer(void) { return timer; }
2000-05-01 16:29:46 +02:00
};
class cRecordControls {
private:
static cRecordControl *RecordControls[];
static int state;
2000-05-01 16:29:46 +02:00
public:
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);
static cRecordControl *GetRecordControl(const char *FileName);
static void Process(time_t t);
static void ChannelDataModified(cChannel *Channel);
static bool Active(void);
static void Shutdown(void);
static void ChangeState(void) { state++; }
static bool StateChanged(int &State);
2000-04-30 10:22:13 +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;
int lastCurrent, lastTotal;
2004-05-16 10:35:36 +02:00
bool lastPlay, lastForward;
int lastSpeed;
time_t timeoutShow;
bool timeSearchActive, timeSearchHide;
int timeSearchTime, timeSearchPos;
void TimeSearchDisplay(void);
void TimeSearchProcess(eKeys Key);
void TimeSearch(void);
void ShowTimed(int Seconds = 0);
static cReplayControl *currentReplayControl;
static char *fileName;
static char *title;
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:
cReplayControl(void);
virtual ~cReplayControl();
2006-01-06 12:53:28 +01:00
virtual cOsdObject *GetInfo(void);
virtual eOSState ProcessKey(eKeys Key);
virtual void Show(void);
virtual void Hide(void);
bool Visible(void) { return visible; }
static void SetRecording(const char *FileName, const char *Title);
static const char *NowReplaying(void);
static const char *LastReplayed(void);
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