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.
|
|
|
|
*
|
2001-09-22 14:23:55 +02:00
|
|
|
* $Id: menu.h 1.29 2001/09/22 14:02:37 kls Exp $
|
2000-02-19 13:36:48 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MENU_H
|
|
|
|
#define _MENU_H
|
|
|
|
|
2000-05-01 16:29:46 +02:00
|
|
|
#define _GNU_SOURCE
|
|
|
|
|
|
|
|
#include "dvbapi.h"
|
2001-08-06 16:19:20 +02:00
|
|
|
#ifdef DVDSUPPORT
|
|
|
|
#include "dvd.h"
|
|
|
|
#endif //DVDSUPPORT
|
2000-02-19 13:36:48 +01:00
|
|
|
#include "osd.h"
|
2000-10-08 15:08:26 +02:00
|
|
|
#include "recording.h"
|
2000-02-19 13:36:48 +01:00
|
|
|
|
|
|
|
class cMenuMain : public cOsdMenu {
|
2000-05-01 16:29:46 +02:00
|
|
|
private:
|
|
|
|
time_t lastActivity;
|
2001-08-03 14:18:08 +02:00
|
|
|
int digit;
|
|
|
|
const char *hk(const char *s);
|
2000-02-19 13:36:48 +01:00
|
|
|
public:
|
2000-05-01 16:29:46 +02:00
|
|
|
cMenuMain(bool Replaying);
|
2000-03-11 11:22:37 +01:00
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
2000-02-19 13:36:48 +01:00
|
|
|
};
|
2001-08-03 14:18:08 +02:00
|
|
|
|
2000-11-01 15:41:33 +01:00
|
|
|
class cDisplayChannel : public cOsdBase {
|
2000-09-10 14:56:18 +02:00
|
|
|
private:
|
2001-09-08 14:39:09 +02:00
|
|
|
int group;
|
|
|
|
bool withInfo;
|
2000-11-01 15:41:33 +01:00
|
|
|
int lines;
|
2000-09-10 14:56:18 +02:00
|
|
|
int lastTime;
|
2000-11-01 15:41:33 +01:00
|
|
|
int oldNumber, number;
|
|
|
|
void DisplayChannel(const cChannel *Channel);
|
|
|
|
void DisplayInfo(void);
|
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);
|
|
|
|
};
|
|
|
|
|
2001-08-06 16:19:20 +02:00
|
|
|
#ifdef DVDSUPPORT
|
2001-08-03 14:18:08 +02:00
|
|
|
class cMenuDVD : public cOsdMenu {
|
|
|
|
private:
|
|
|
|
cDVD *dvd;//XXX member really necessary???
|
|
|
|
eOSState Play(void);
|
|
|
|
eOSState Eject(void);
|
|
|
|
public:
|
|
|
|
cMenuDVD(void);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
2001-08-06 16:19:20 +02:00
|
|
|
#endif //DVDSUPPORT
|
2001-08-03 14:18:08 +02:00
|
|
|
|
2000-10-08 15:08:26 +02:00
|
|
|
class cMenuRecordings : public cOsdMenu {
|
|
|
|
private:
|
|
|
|
cRecordings Recordings;
|
|
|
|
eOSState Play(void);
|
2001-02-11 11:04:41 +01:00
|
|
|
eOSState Rewind(void);
|
2000-10-08 15:08:26 +02:00
|
|
|
eOSState Del(void);
|
|
|
|
eOSState Summary(void);
|
|
|
|
public:
|
|
|
|
cMenuRecordings(void);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2000-05-01 16:29:46 +02:00
|
|
|
class cRecordControl {
|
2000-04-30 10:22:13 +02:00
|
|
|
private:
|
2001-09-22 14:23:55 +02:00
|
|
|
static const char *userCommand;
|
2000-05-01 16:29:46 +02:00
|
|
|
cDvbApi *dvbApi;
|
2000-04-30 10:22:13 +02:00
|
|
|
cTimer *timer;
|
2001-08-19 14:45:31 +02:00
|
|
|
const cEventInfo *eventInfo;
|
2000-05-01 16:29:46 +02:00
|
|
|
char *instantId;
|
2001-08-19 14:45:31 +02:00
|
|
|
bool GetEventInfo(void);
|
2001-09-22 14:23:55 +02:00
|
|
|
void InvokeUserCommand(bool Before);
|
2000-04-30 10:22:13 +02:00
|
|
|
public:
|
2000-05-01 16:29:46 +02:00
|
|
|
cRecordControl(cDvbApi *DvbApi, cTimer *Timer = NULL);
|
2000-04-30 10:22:13 +02:00
|
|
|
virtual ~cRecordControl();
|
2001-09-22 14:23:55 +02:00
|
|
|
static void SetUserCommand(const char *UserCommand) { userCommand = UserCommand; }
|
2001-09-01 15:04:14 +02:00
|
|
|
bool Process(time_t t);
|
2000-11-12 14:06:53 +01:00
|
|
|
bool Uses(cDvbApi *DvbApi) { return DvbApi == dvbApi; }
|
2000-04-30 11:15:16 +02:00
|
|
|
void Stop(bool KeepInstant = false);
|
2000-05-01 16:29:46 +02:00
|
|
|
bool IsInstant(void) { return instantId; }
|
|
|
|
const char *InstantId(void) { return instantId; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class cRecordControls {
|
|
|
|
private:
|
|
|
|
static cRecordControl *RecordControls[MAXDVBAPI];
|
|
|
|
public:
|
|
|
|
static bool Start(cTimer *Timer = NULL);
|
|
|
|
static void Stop(const char *InstantId);
|
2000-11-12 14:06:53 +01:00
|
|
|
static void Stop(cDvbApi *DvbApi);
|
2000-05-01 16:29:46 +02:00
|
|
|
static const char *GetInstantId(const char *LastInstantId);
|
2001-09-01 15:04:14 +02:00
|
|
|
static void Process(time_t t);
|
2001-02-04 12:36:32 +01:00
|
|
|
static bool Active(void);
|
2000-04-30 10:22:13 +02:00
|
|
|
};
|
|
|
|
|
2000-04-29 15:57:42 +02:00
|
|
|
class cReplayControl : public cOsdBase {
|
2000-04-24 15:32:11 +02:00
|
|
|
private:
|
2000-05-01 16:29:46 +02:00
|
|
|
cDvbApi *dvbApi;
|
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;
|
2001-07-28 14:06:36 +02:00
|
|
|
time_t timeoutShow;
|
2001-08-11 14:30:21 +02:00
|
|
|
bool timeSearchActive, timeSearchHide;
|
|
|
|
int timeSearchHH, timeSearchMM, timeSearchPos;
|
|
|
|
void TimeSearchDisplay(void);
|
|
|
|
void TimeSearchProcess(eKeys Key);
|
|
|
|
void TimeSearch(void);
|
2001-07-28 14:06:36 +02:00
|
|
|
void Show(int Seconds = 0);
|
2000-04-29 15:57:42 +02:00
|
|
|
void Hide(void);
|
|
|
|
static char *fileName;
|
2001-08-06 16:19:20 +02:00
|
|
|
#ifdef DVDSUPPORT
|
2001-08-03 14:18:08 +02:00
|
|
|
static cDVD *dvd;//XXX member really necessary???
|
|
|
|
static int titleid;//XXX
|
2001-08-06 16:19:20 +02:00
|
|
|
#endif //DVDSUPPORT
|
2000-04-29 15:57:42 +02:00
|
|
|
static char *title;
|
2001-09-14 15:10:12 +02:00
|
|
|
void DisplayAtBottom(const char *s = NULL);
|
|
|
|
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:
|
2000-04-29 15:57:42 +02:00
|
|
|
cReplayControl(void);
|
|
|
|
virtual ~cReplayControl();
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
bool Visible(void) { return visible; }
|
|
|
|
static void SetRecording(const char *FileName, const char *Title);
|
2001-08-06 16:19:20 +02:00
|
|
|
#ifdef DVDSUPPORT
|
2001-08-03 14:18:08 +02:00
|
|
|
static void SetDVD(cDVD *DVD, int Title);//XXX
|
2001-08-06 16:19:20 +02:00
|
|
|
#endif //DVDSUPPORT
|
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
|
|
|
};
|
|
|
|
|
2000-02-19 13:36:48 +01:00
|
|
|
#endif //_MENU_H
|