diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2008-01-27 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2008-01-27 18:00:00 +0100 |
commit | e3887083391d10f8cfcd1d8ac65a99d9978f05f2 (patch) | |
tree | 85d1b5e0ef75b718143b58184c56c6c8425a1d69 /menuitems.c | |
parent | fc4c8740a72e6c7cea5a001e19fdacb63c3cc538 (diff) | |
download | vdr-patch-lnbsharing-e3887083391d10f8cfcd1d8ac65a99d9978f05f2.tar.gz vdr-patch-lnbsharing-e3887083391d10f8cfcd1d8ac65a99d9978f05f2.tar.bz2 |
Version 1.5.14vdr-1.5.14
- Fixed the Play function in the pictures plugin.
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Updated the Makefile of the skincurses plugin (thanks to Rolf Ahrenberg).
- The new option --localedir can be used to set the locale directory at runtime
(based on a patch from Stefan Huelswitt).
- Fixed finding new transponders (thanks to Winfried Köhler).
- Implemented handling of DVB-S2 (thanks to Marco Schlüßler and Reinhard Nissl
for a patch that was used to implement this). VDR now requires the "multiproto"
DVB driver, e.g. from http://jusst.de/hg/multiproto.
- Removed switching to the next higher or lower channel if the current channel
is not available, in order to allow staying on an encrypted channel that takes
a while for the CAM to start decrypting.
Diffstat (limited to 'menuitems.c')
-rw-r--r-- | menuitems.c | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/menuitems.c b/menuitems.c index a7ceef2..15f729b 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c 1.55 2007/11/03 15:01:01 kls Exp $ + * $Id: menuitems.c 1.56 2008/01/26 16:07:07 kls Exp $ */ #include "menuitems.h" @@ -937,6 +937,64 @@ eOSState cMenuEditTimeItem::ProcessKey(eKeys Key) return state; } +// --- cMenuEditMapItem ------------------------------------------------------ + +cMenuEditMapItem::cMenuEditMapItem(const char *Name, int *Value, const tChannelParameterMap *Map, const char *ZeroString) +:cMenuEditItem(Name) +{ + value = Value; + map = Map; + zeroString = ZeroString; + Set(); +} + +void cMenuEditMapItem::Set(void) +{ + const char *s = NULL; + int n = MapToUser(*value, map, &s); + if (n == 999) + SetValue(tr("auto")); + else if (n == 0 && zeroString) + SetValue(zeroString); + else if (n >= 0) { + if (s) + SetValue(s); + else { + char buf[16]; + snprintf(buf, sizeof(buf), "%d", n); + SetValue(buf); + } + } + else + SetValue("???"); +} + +eOSState cMenuEditMapItem::ProcessKey(eKeys Key) +{ + eOSState state = cMenuEditItem::ProcessKey(Key); + + if (state == osUnknown) { + int newValue = *value; + int n = DriverIndex(*value, map); + if (NORMALKEY(Key) == kLeft) { // TODO might want to increase the delta if repeated quickly? + if (n-- > 0) + newValue = map[n].driverValue; + } + else if (NORMALKEY(Key) == kRight) { + if (map[++n].userValue >= 0) + newValue = map[n].driverValue; + } + else + return state; + if (newValue != *value) { + *value = newValue; + Set(); + } + state = osContinue; + } + return state; +} + // --- cMenuSetupPage -------------------------------------------------------- cMenuSetupPage::cMenuSetupPage(void) |