vdr/menuitems.h
Klaus Schmidinger 19b952728e Version 1.7.27
Original announce message:
VDR developer version 1.7.27 is now available at

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

A 'diff' against the previous version is available at

       ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.26-1.7.27.diff

MD5 checksums:

bfeaa79a9e55144bca2b69139c45f1bb  vdr-1.7.27.tar.bz2
b23344be51d3e2c2d96cc2dd4e8e564e  vdr-1.7.26-1.7.27.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:
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Changed the Green button in the "Edit timer" menu from "Once" to "Single"
  (suggested by Rolf Ahrenberg).
- Fixed some typos in HISTORY and CONTRIBUTORS (thanks to Ville Skyttä).
- The channel name column in the "What's on now/next" menu now adjusts its width
  to display the full short name of each channel (suggested by Dominic Evans).
- Dropped the meanwhile obsolete script 'i18n-to-gettext'.
- Removed the obsolete function cPlugin::RegisterI18n().
- Removed the obsolete typedef tI18nPhrase.
- Adapted menu column widths of 'skincurses' to the wider HD OSD sizes.
- Deactivated definition of __RECORDING_H_DEPRECATED_DIRECT_MEMBER_ACCESS (recording.h)
  and LEGACY_CRECEIVER (receiver.h) to trigger an error for any plugin that still
  uses the respective code. You can reactivate these to quickly make your plugin
  compile again, but beware that these code parts will be removed in one of the next
  versions.
- Made the "overloaded-virtual" warning an error to detect hidden overloaded
  virtual functions (thanks to Anssi Hannula for pointing out -Werror=...).
  Plugin authors may want to change -Woverloaded-virtual to -Werror=overloaded-virtual
  in their Makefiles.
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
- Improved fast forwarding to the end of a timeshift recording.
- The new function cDevice::DeviceName() returns a string identifying the name of
  the given device.
- When toggling a timer between "Single" and "Repeating", the previous setting is now
  retained in case the user toggles back to the original value.
- When estimating the remaining disk space (in hours), the average data rate of all
  existing recordings is now taken into account. If this value can't be determined,
  the previous value of 25.75 MB/min is taken.
- No longer using GetFont() (which is not thread safe) in the 'osddemo' plugin.
- No longer using GetFont() (which is not thread safe) in cSubtitleRegion::UpdateTextData().
- Fixed a memory leak in cSubtitleRegion::UpdateTextData().
- Moved setting LC_NUMERIC further up to make sure any floating point numbers use a
  decimal point (suggested by Tobias Grimm).
- Added missing channel locking to cEIT.
- Fixed reduced bpp support for DVB subtitles (thanks to Rolf Ahrenberg).
- Updated the Italian OSD texts (thanks to Diego Pierotto).
- Reverted some improvements to Make.config.template (thanks to Christian Ruppert).
- Fixed handling IDLEPRIORITY in cDvbDevice::ProvidesChannel() (thanks to Frank
  Schmirler).
2012-03-25 15:43:37 +02:00

215 lines
5.4 KiB
C++

/*
* menuitems.h: General purpose menu items
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menuitems.h 2.8 2012/03/13 11:19:11 kls Exp $
*/
#ifndef __MENUITEMS_H
#define __MENUITEMS_H
#include <limits.h>
#include "dvbdevice.h"
#include "osdbase.h"
extern const char *FileNameChars;
class cMenuEditItem : public cOsdItem {
private:
char *name;
const char *helpRed, *helpGreen, *helpYellow, *helpBlue;
bool helpDisplayed;
protected:
void SetHelp(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL);
public:
cMenuEditItem(const char *Name);
~cMenuEditItem();
void SetValue(const char *Value);
bool DisplayHelp(void);
};
class cMenuEditIntItem : public cMenuEditItem {
protected:
int *value;
int min, max;
const char *minString, *maxString;
virtual void Set(void);
public:
cMenuEditIntItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX, const char *MinString = NULL, const char *MaxString = NULL);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditBoolItem : public cMenuEditIntItem {
protected:
const char *falseString, *trueString;
virtual void Set(void);
public:
cMenuEditBoolItem(const char *Name, int *Value, const char *FalseString = NULL, const char *TrueString = NULL);
};
class cMenuEditBitItem : public cMenuEditBoolItem {
protected:
uint *value;
uint mask;
int bit;
virtual void Set(void);
public:
cMenuEditBitItem(const char *Name, uint *Value, uint Mask, const char *FalseString = NULL, const char *TrueString = NULL);
};
class cMenuEditNumItem : public cMenuEditItem {
protected:
char *value;
int length;
bool blind;
virtual void Set(void);
public:
cMenuEditNumItem(const char *Name, char *Value, int Length, bool Blind = false);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditPrcItem : public cMenuEditItem {
protected:
double *value;
double min, max;
int decimals;
int factor;
virtual void Set(void);
public:
cMenuEditPrcItem(const char *Name, double *Value, double Min = 0.0, double Max = 1.0, int Decimals = 0);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditChrItem : public cMenuEditItem {
private:
char *value;
char *allowed;
const char *current;
virtual void Set(void);
public:
cMenuEditChrItem(const char *Name, char *Value, const char *Allowed);
~cMenuEditChrItem();
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditStrItem : public cMenuEditItem {
private:
char *value;
int length;
const char *allowed;
int pos, offset;
bool insert, newchar, uppercase;
int lengthUtf8;
uint *valueUtf8;
uint *allowedUtf8;
uint *charMapUtf8;
uint *currentCharUtf8;
eKeys lastKey;
cTimeMs autoAdvanceTimeout;
void SetHelpKeys(void);
uint *IsAllowed(uint c);
void AdvancePos(void);
virtual void Set(void);
uint Inc(uint c, bool Up);
void Type(uint c);
void Insert(void);
void Delete(void);
protected:
void EnterEditMode(void);
void LeaveEditMode(bool SaveValue = false);
bool InEditMode(void) { return valueUtf8 != NULL; }
public:
cMenuEditStrItem(const char *Name, char *Value, int Length, const char *Allowed = NULL);
~cMenuEditStrItem();
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditStraItem : public cMenuEditIntItem {
private:
const char * const *strings;
protected:
virtual void Set(void);
public:
cMenuEditStraItem(const char *Name, int *Value, int NumStrings, const char * const *Strings);
};
class cMenuEditChanItem : public cMenuEditIntItem {
protected:
const char *noneString;
int dummyValue;
cString *channelID;
virtual void Set(void);
public:
cMenuEditChanItem(const char *Name, int *Value, const char *NoneString = NULL);
cMenuEditChanItem(const char *Name, cString *ChannelID, const char *NoneString = NULL);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditTranItem : public cMenuEditChanItem {
private:
int number;
int *source;
int *transponder;
public:
cMenuEditTranItem(const char *Name, int *Value, int *Source);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditDateItem : public cMenuEditItem {
private:
static int days[];
time_t *value;
int *weekdays;
time_t oldvalue;
int oldweekdays;
int dayindex;
int FindDayIndex(int WeekDays);
virtual void Set(void);
public:
cMenuEditDateItem(const char *Name, time_t *Value, int *WeekDays = NULL);
void ToggleRepeating(void);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditTimeItem : public cMenuEditItem {
protected:
int *value;
int hh, mm;
int pos;
virtual void Set(void);
public:
cMenuEditTimeItem(const char *Name, int *Value);
virtual eOSState ProcessKey(eKeys Key);
};
class cMenuEditMapItem : public cMenuEditItem {
protected:
int *value;
const tDvbParameterMap *map;
const char *zeroString;
virtual void Set(void);
public:
cMenuEditMapItem(const char *Name, int *Value, const tDvbParameterMap *Map, const char *ZeroString = NULL);
virtual eOSState ProcessKey(eKeys Key);
};
class cPlugin;
class cMenuSetupPage : public cOsdMenu {
private:
cPlugin *plugin;
protected:
void SetSection(const char *Section);
virtual void Store(void) = 0;
void SetupStore(const char *Name, const char *Value = NULL);
void SetupStore(const char *Name, int Value);
public:
cMenuSetupPage(void);
virtual eOSState ProcessKey(eKeys Key);
void SetPlugin(cPlugin *Plugin);
};
#endif //__MENUITEMS_H