From e3887083391d10f8cfcd1d8ac65a99d9978f05f2 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 27 Jan 2008 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.5.14=20-=20Fixed=20the=20Play=20function=20?= =?UTF-8?q?in=20the=20pictures=20plugin.=20-=20Updated=20the=20Finnish=20O?= =?UTF-8?q?SD=20texts=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Updated=20?= =?UTF-8?q?the=20Makefile=20of=20the=20skincurses=20plugin=20(thanks=20to?= =?UTF-8?q?=20Rolf=20Ahrenberg).=20-=20The=20new=20option=20--localedir=20?= =?UTF-8?q?can=20be=20used=20to=20set=20the=20locale=20directory=20at=20ru?= =?UTF-8?q?ntime=20=20=20(based=20on=20a=20patch=20from=20Stefan=20Huelswi?= =?UTF-8?q?tt).=20-=20Fixed=20finding=20new=20transponders=20(thanks=20to?= =?UTF-8?q?=20Winfried=20K=C3=B6hler).=20-=20Implemented=20handling=20of?= =?UTF-8?q?=20DVB-S2=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler=20and=20?= =?UTF-8?q?Reinhard=20Nissl=20=20=20for=20a=20patch=20that=20was=20used=20?= =?UTF-8?q?to=20implement=20this).=20VDR=20now=20requires=20the=20"multipr?= =?UTF-8?q?oto"=20=20=20DVB=20driver,=20e.g.=20from=20http://jusst.de/hg/m?= =?UTF-8?q?ultiproto.=20-=20Removed=20switching=20to=20the=20next=20higher?= =?UTF-8?q?=20or=20lower=20channel=20if=20the=20current=20channel=20=20=20?= =?UTF-8?q?is=20not=20available,=20in=20order=20to=20allow=20staying=20on?= =?UTF-8?q?=20an=20encrypted=20channel=20that=20takes=20=20=20a=20while=20?= =?UTF-8?q?for=20the=20CAM=20to=20start=20decrypting.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- menuitems.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) (limited to 'menuitems.c') 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) -- cgit v1.2.3