vdr/menu.h
Klaus Schmidinger 2db7397542 Version 2.1.7
VDR developer version 2.1.7 is now available at

       ftp://ftp.tvdr.de/vdr/Developer/vdr-2.1.7.tar.bz2

A 'diff' against the previous version is available at

       ftp://ftp.tvdr.de/vdr/Developer/vdr-2.1.6-2.1.7.diff

MD5 checksums:

1c954bad31ce74cd1cbd7987e62d2a98  vdr-2.1.7.tar.bz2
88a90327a75833b7723942d3bd25f954  vdr-2.1.6-2.1.7.diff

WARNING:
========

This is a *developer* version. Even though *I* use it in my productive
environment, I strongly recommend that you only use it under controlled
conditions and for testing and debugging.

From the HISTORY file:
- No longer logging an error message in DirSizeMB() if the given directory doesn't
  exist. This avoids lots of log entries in case several VDRs use the same video
  directory and one of them has already physically removed a recording directory,
  while the others still have it in their list of deleted recordings.
- Updated the Italian OSD texts (thanks to Diego Pierotto).
- A cCamSlot that has WantsTsData set to true in its constructor now also gets
  the CAT and EMM PIDs data.
- Fixed a possible division by zero in frame rate detection.
- VDR now reads command line options from *.conf files in /etc/vdr/conf.d (thanks
  to Lars Hanisch). See vdr.1 and vdr.5 for details.
- Fixed a possible crash in the LCARS skin (thanks to Thomas Reufer).
- Updated the dvbhddevice plugin source.
- Fixed a bug in the Makefile when installing plugins with LCLBLD=1 (thanks to
  Stefan Huelswitt).
- The pid of the PMT in which the CA descriptors of a given channel are broadcast
  is now stored together with the CA descriptors and can be retrieved by calling
  GetPmtPid() (this information is only required to receive encrypted channels
  with the OctopusNet receiver via the 'satip' plugin).
- Channels that are not listed in the SDT are now only marked as OBSOLETE if
  "Setup/DVB/Update channels" is set to a value other than "no" or "PIDs only".
- Fixed multiple OBSOLETE marks in channels that are not listed in the SDT in case
  "Setup/Miscellaneous/Show channel names with source" is set to "yes".
- The new function cOsd::DrawScaledBitmap() is now used for drawing subtitles.
  This function can be reimplemented by high level OSDs which may be able to do
  the scaling in hardware or otherwise more efficiently (thanks to Thomas Reufer).
- Fixed detaching receivers from devices in case a CAM needs to receive the TS
  (reported by Dietmar Spingler).
- Fixed resetting the receiver for EMM pids for CAMs that need to receive the TS
  (reported by Dietmar Spingler).
- Fixed (well, actually worked around) a problem with subtitles not being displayed
  because the broadcaster doesn't set the data's version numbers as required by the
  DVB standard (thanks to Rolf Ahrenberg).
- Fixed support for systemd (thanks to Christopher Reimer).
- Added a missing backslash to the help text of the SVDRP command MOVR (thanks to
  Lars Hanisch).
- Added subsystem id support for DVB devices connected via USB (thanks to Jose
  Alberto Reguero).
- Added the functions IndexOf(), InsertUnique(), AppendUnique() and RemoveElement()
  to the cVector class (thanks to Stefan Schallenberg).
- Fixed a possible out-of-bounds access in cVector::Remove().
- Added functions to set and retrieve the priority of a cReceiver (suggested by
  Frank Schmirler).
- Added the new parameters "Setup/Miscellaneous/Volume steps" and
  ".../Volume linearize" (thanks to Claus Muus). See the MANUAL for details.
- Fixed jumping to an absolute position via the Red key in case replay was paused
  (reported by Dieter Ferdinand).
- Changed the German weekday names from "MonDieMitDonFreSamSon" to
  "Mo.Di.Mi.Do.Fr.Sa.So." (thanks to Stefan Blochberger).
- Now handling CAT sections that consist of more than one TS packet.
- Added handling for DTS audio tracks to cPatPmtParser::ParsePmt() (thanks to
  Thomas Reufer).
- Added support for PGS subtitles (thanks to Thomas Reufer).
- Use of the function cOsd::GetBitmap() outside of derived classes is now deprecated,
  and it may be made 'protected' in a future version, since it doesn't work with
  TrueColor OSDs. Plugin authors may want to modify their code so that it
  works without this function.
- Modified the descriptions of several threads, so that the important information
  (like device or frontend numbers) is within the first 15 characters of the
  string, because only these are displayed in thread listings. Plugin authors may
  want to do the same.
- Added the channel name to log messages that reference a channel (suggested by
  Dietmar Spingler).
- Modified the CAM API so that it is possible to implement CAMs that can be freely
  assigned to any devices (thanks to Jasmin Jessich).
- Plugins can now implement the function SetMenuSortMode() in their skin objects
  derived from cSkinDisplayMenu, to get informed about the currently used sort
  mode, if applicable (suggested by Martin Schirrmacher).
- Added cOsdProvider::OsdSizeChanged(), which plugins that implement an output device
  can call to signal a change in the OSD that requires a redraw of the currently
  displayed object (thanks to Thomas Reufer).
- Added a comment to cRecorder::Activate() about the need to call Detach() in the
  destructor (suggested by Eike Sauer).
- Now returning from removing deleted recordings after at most 10 seconds, or if the
  user presses a remote control key, to keep the system from getting unresponsive
  when removing a huge number of files (reported by Dieter Ferdinand).
- Fixed generating the index file of an existing recording in case at the of a TS file
  there is less data in the buffer than needed by the frame detector. In such a case
  it was possible that frames were missed, and there was most likely a distortion
  when replaying that part of a recording. This is mostly a problem for recordings that
  consist of more than one *.ts file. Single file recordings could only lose some
  frames at their very end, which probably doesn't matter. At any rate, if you have
  generated an index file with VDR version 2.0.6, 2.1.5 or 2.1.6, you may want to
  do so again with this version to make sure the index is OK.
- Added the new command line option --updindex, which can be used to update an
  incomplete index of a recording (based on a patch from Helmut Auer).
2015-01-18 14:45:41 +01:00

315 lines
8.7 KiB
C++

/*
* menu.h: The actual menu implementations
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.h 3.6 2015/01/15 11:12:57 kls Exp $
*/
#ifndef __MENU_H
#define __MENU_H
#include "ci.h"
#include "device.h"
#include "epg.h"
#include "osdbase.h"
#include "dvbplayer.h"
#include "menuitems.h"
#include "recorder.h"
#include "skins.h"
class cMenuText : public cOsdMenu {
private:
char *text;
eDvbFont font;
public:
cMenuText(const char *Title, const char *Text, eDvbFont Font = fontOsd);
virtual ~cMenuText();
void SetText(const char *Text);
virtual void Display(void);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuFolder : public cOsdMenu {
private:
cNestedItemList *nestedItemList;
cList<cNestedItem> *list;
cString dir;
cOsdItem *firstFolder;
bool editing;
int helpKeys;
void SetHelpKeys(void);
void Set(const char *CurrentFolder = NULL);
void DescendPath(const char *Path);
eOSState SetFolder(void);
eOSState Select(bool Open);
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);
};
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);
};
class cMenuEditTimer : public cOsdMenu {
private:
cTimer *timer;
cTimer data;
int channel;
bool addIfConfirmed;
cMenuEditStrItem *file;
cMenuEditDateItem *day;
cMenuEditDateItem *firstday;
eOSState SetFolder(void);
void SetFirstDayItem(void);
void SetHelpKeys(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);
};
class cMenuMain : public cOsdMenu {
private:
bool replaying;
cOsdItem *stopReplayItem;
cOsdItem *cancelEditingItem;
cOsdItem *stopRecordingItem;
int recordControlsState;
static cOsdObject *pluginOsdObject;
void Set(void);
bool Update(bool Force = false);
public:
cMenuMain(eOSState State = osUnknown, bool OpenSubMenus = false);
virtual eOSState ProcessKey(eKeys Key);
static cOsdObject *PluginOsdObject(void);
};
class cDisplayChannel : public cOsdObject {
private:
cSkinDisplayChannel *displayChannel;
int group;
bool withInfo;
cTimeMs lastTime;
int number;
bool timeout;
int osdState;
const cPositioner *positioner;
cChannel *channel;
const cEvent *lastPresent;
const cEvent *lastFollowing;
static cDisplayChannel *currentDisplayChannel;
void DisplayChannel(void);
void DisplayInfo(void);
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 {
private:
cSkinDisplayVolume *displayVolume;
cTimeMs timeout;
static cDisplayVolume *currentDisplayVolume;
virtual void Show(void);
cDisplayVolume(void);
public:
virtual ~cDisplayVolume();
static cDisplayVolume *Create(void);
static void Process(eKeys Key);
eOSState ProcessKey(eKeys Key);
};
class cDisplayTracks : public cOsdObject {
private:
cSkinDisplayTracks *displayTracks;
cTimeMs timeout;
eTrackType types[ttMaxTrackTypes];
char *descriptions[ttMaxTrackTypes + 1]; // list is NULL terminated
int numTracks, track, audioChannel;
static cDisplayTracks *currentDisplayTracks;
virtual void Show(void);
cDisplayTracks(void);
public:
virtual ~cDisplayTracks();
static bool IsOpen(void) { return currentDisplayTracks != NULL; }
static cDisplayTracks *Create(void);
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);
static void Process(eKeys Key);
eOSState ProcessKey(eKeys Key);
};
cOsdObject *CamControl(void);
bool CamMenuActive(void);
class cRecordingFilter {
public:
virtual ~cRecordingFilter(void) {};
virtual bool Filter(const cRecording *Recording) const = 0;
///< Returns true if the given Recording shall be displayed in the Recordings menu.
};
class cMenuRecordingItem;
class cMenuRecordings : public cOsdMenu {
private:
char *base;
int level;
int recordingsState;
int helpKeys;
const cRecordingFilter *filter;
static cString path;
static cString fileName;
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);
eOSState Sort(void);
eOSState Commands(eKeys Key = kNone);
protected:
cString DirectoryName(void);
public:
cMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false, const cRecordingFilter *Filter = NULL);
~cMenuRecordings();
virtual eOSState ProcessKey(eKeys Key);
static void SetPath(const char *Path);
static void SetRecording(const char *FileName);
};
class cRecordControl {
private:
cDevice *device;
cTimer *timer;
cRecorder *recorder;
const cEvent *event;
cString instantId;
char *fileName;
bool GetEvent(void);
public:
cRecordControl(cDevice *Device, cTimer *Timer = NULL, bool Pause = false);
virtual ~cRecordControl();
bool Process(time_t t);
cDevice *Device(void) { return device; }
void Stop(bool ExecuteUserCommand = true);
const char *InstantId(void) { return instantId; }
const char *FileName(void) { return fileName; }
cTimer *Timer(void) { return timer; }
};
class cRecordControls {
private:
static cRecordControl *RecordControls[];
static int state;
public:
static bool Start(cTimer *Timer = NULL, bool Pause = false);
static void Stop(const char *InstantId);
static bool PauseLiveVideo(void);
static const char *GetInstantId(const char *LastInstantId);
static cRecordControl *GetRecordControl(const char *FileName);
static cRecordControl *GetRecordControl(const cTimer *Timer);
///< Returns the cRecordControl for the given Timer.
///< If there is no cRecordControl for Timer, NULL is returned.
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);
};
class cReplayControl : public cDvbPlayerControl {
private:
cSkinDisplayReplay *displayReplay;
cMarks marks;
bool marksModified;
bool visible, modeOnly, shown, displayFrames;
int lastCurrent, lastTotal;
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 cString fileName;
void ShowMode(void);
bool ShowProgress(bool Initial);
void MarkToggle(void);
void MarkJump(bool Forward);
void MarkMove(bool Forward);
void EditCut(void);
void EditTest(void);
public:
cReplayControl(bool PauseLive = false);
virtual ~cReplayControl();
void Stop(void);
virtual cOsdObject *GetInfo(void);
virtual const cRecording *GetRecording(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);
static const char *NowReplaying(void);
static const char *LastReplayed(void);
static void ClearLastReplayed(const char *FileName);
};
#endif //__MENU_H