aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/ChoiceList.py13
-rw-r--r--lib/python/Screens/ChoiceBox.py2
-rw-r--r--lib/python/Screens/InfoBarGenerics.py31
3 files changed, 32 insertions, 14 deletions
diff --git a/lib/python/Components/ChoiceList.py b/lib/python/Components/ChoiceList.py
index fe3e6008..a0fbde54 100644
--- a/lib/python/Components/ChoiceList.py
+++ b/lib/python/Components/ChoiceList.py
@@ -18,11 +18,14 @@ RT_VALIGN_BOTTOM = 16
def ChoiceEntryComponent(key, text):
res = [ text ]
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 32, 00, 800, 25, 0, RT_HALIGN_LEFT, text[0]))
-
- png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "key_" + key + "-fs8.png"))
- if png is not None:
- res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 30, 20, png))
+ if text[0] == "--":
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 00, 800, 25, 0, RT_HALIGN_LEFT, "-"*200))
+ else:
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 32, 00, 800, 25, 0, RT_HALIGN_LEFT, text[0]))
+
+ png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "key_" + key + "-fs8.png"))
+ if png is not None:
+ res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 30, 20, png))
return res
diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py
index 50fd6c51..60aa5e10 100644
--- a/lib/python/Screens/ChoiceBox.py
+++ b/lib/python/Screens/ChoiceBox.py
@@ -24,7 +24,7 @@ class ChoiceBox(Screen):
pos = 0
for x in list:
strpos = str(self.keys[pos])
- self.list.append(ChoiceEntryComponent(strpos, x))
+ self.list.append(ChoiceEntryComponent(key = strpos, text = x))
if self.keys[pos] != "":
self.keymap[self.keys[pos]] = list[pos]
pos += 1
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index be770210..b7325c36 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -1214,14 +1214,17 @@ class InfoBarAudioSelection:
audio = service.audioTracks()
self.audioTracks = audio
n = audio.getNumberOfTracks()
+ keys = [ "red", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n
+ tlist = []
+ print "tlist:", tlist
if n > 0:
-# self.audioChannel = service.audioChannel()
+ self.audioChannel = service.audioChannel()
# config.audio.audiochannel = configElement_nonSave("config.audio.audiochannel", configSelection, self.audioChannel.getCurrentChannel(), (("left", _("Left >")), ("stereo", _("< Stereo >")), ("right", _("< Right"))))
- tlist = []
+
for x in range(n):
i = audio.getTrackInfo(x)
language = i.getLanguage()
- description = i.getDescription();
+ description = i.getDescription()
if len(language) == 3:
if language in LanguageCodes:
@@ -1239,24 +1242,36 @@ class InfoBarAudioSelection:
# tlist.insert(0, getConfigListEntry(_("Audio Channel"), config.audio.audiochannel))
- selection = 0
+ selection = 2
for x in tlist:
if x[1] != selectedAudio:
selection += 1
else:
break
-
- self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = tlist, selection = selection)
+
+ tlist = [([_("Left"), _("Stereo"), _("Right")][self.audioChannel.getCurrentChannel()], "mode"), ("--", "")] + tlist
+ self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = tlist, selection = selection, keys = keys)
else:
del self.audioTracks
def audioSelected(self, audio):
if audio is not None:
- self.audioTracks.selectTrack(audio[1])
+ if isinstance(audio[1], str):
+ if audio[1] == "mode":
+ keys = ["red", "green", "yellow"]
+ selection = self.audioChannel.getCurrentChannel()
+ tlist = [(_("left"), 0), (_("stereo"), 1), (_("right"), 2)]
+ self.session.openWithCallback(self.modeSelected, ChoiceBox, title=_("Select audio mode"), list = tlist, selection = selection, keys = keys)
+ else:
+ if self.session.nav.getCurrentService().audioTracks().getNumberOfTracks() > audio[1]:
+ self.audioTracks.selectTrack(audio[1])
del self.audioTracks
-# del self.audioChannel
# del config.audio.audiochannel
+ def modeSelected(self, mode):
+ if mode is not None:
+ self.audioChannel.selectChannel(mode[1])
+ del self.audioChannel
class InfoBarSubserviceSelection:
def __init__(self):
self["SubserviceSelectionAction"] = HelpableActionMap(self, "InfobarSubserviceSelectionActions",