aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2009-11-04 16:20:13 +0100
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2009-11-04 16:20:13 +0100
commitaaeba87c8ee1b528dc9660dab9c6980155e878d4 (patch)
tree2539fc3744e2f236a1377dec309c822ce58671ad /lib/python/Components
parent21ca87a50a252d81f2f07d1596b33511e98a3c0d (diff)
parent0fd217d2eef3ae87953e6622edb977aded899a52 (diff)
downloadenigma2-aaeba87c8ee1b528dc9660dab9c6980155e878d4.tar.gz
enigma2-aaeba87c8ee1b528dc9660dab9c6980155e878d4.zip
Merge branch '219_negative_ac3_pcm_delay'
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/AVSwitch.py6
-rwxr-xr-xlib/python/Components/config.py36
2 files changed, 39 insertions, 3 deletions
diff --git a/lib/python/Components/AVSwitch.py b/lib/python/Components/AVSwitch.py
index bc2a66a4..2658f9ba 100644
--- a/lib/python/Components/AVSwitch.py
+++ b/lib/python/Components/AVSwitch.py
@@ -1,5 +1,5 @@
from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \
- ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigNumber, ConfigNothing, NoSave
+ ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigSelectionNumber, ConfigNothing, NoSave
from enigma import eAVSwitch, getDesktop
from SystemInfo import SystemInfo
from os import path as os_path
@@ -112,8 +112,8 @@ def InitAVSwitch():
config.av.tvsystem = ConfigSelection(choices = {"pal": _("PAL"), "ntsc": _("NTSC"), "multinorm": _("multinorm")}, default="pal")
config.av.wss = ConfigEnableDisable(default = True)
config.av.defaultac3 = ConfigYesNo(default = False)
- config.av.generalAC3delay = ConfigNumber(default = 0)
- config.av.generalPCMdelay = ConfigNumber(default = 0)
+ config.av.generalAC3delay = ConfigSelectionNumber(-1000, 1000, 25, default = 0)
+ config.av.generalPCMdelay = ConfigSelectionNumber(-1000, 1000, 25, default = 0)
config.av.vcrswitch = ConfigEnableDisable(default = False)
iAVSwitch = AVSwitch()
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index 49501f95..d17f7711 100755
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -1017,6 +1017,42 @@ class ConfigPassword(ConfigText):
ConfigText.onDeselect(self, session)
self.hidden = True
+# lets the user select between [min, min+stepwidth, min+(stepwidth*2)..., maxval] with maxval <= max depending
+# on the stepwidth
+# min, max, stepwidth, default are int values
+# wraparound: pressing RIGHT key at max value brings you to min value and vice versa if set to True
+class ConfigSelectionNumber(ConfigSelection):
+ def __init__(self, min, max, stepwidth, default = None, wraparound = False):
+ self.wraparound = wraparound
+ if default is None:
+ default = min
+ default = str(default)
+ choices = []
+ step = min
+ while step <= max:
+ choices.append(str(step))
+ step += stepwidth
+
+ ConfigSelection.__init__(self, choices, default)
+
+ def getValue(self):
+ return int(self.text)
+
+ def setValue(self, val):
+ self.text = str(val)
+
+ def handleKey(self, key):
+ if not self.wraparound:
+ if key == KEY_RIGHT:
+ if len(self.choices) == (self.choices.index(self.value) + 1):
+ return
+ if key == KEY_LEFT:
+ if self.choices.index(self.value) == 0:
+ return
+ ConfigSelection.handleKey(self, key)
+
+
+
class ConfigNumber(ConfigText):
def __init__(self, default = 0):
ConfigText.__init__(self, str(default), fixed_size = False)