aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/InfoBarGenerics.py
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-12-03 15:23:41 +0100
committerghost <andreas.monzner@multimedia-labs.de>2009-12-03 15:25:30 +0100
commitb79bdb964320dabf4180ef6820a1ce335afccaa5 (patch)
tree5733875f29cd63b18030e49925de9a259e95acaa /lib/python/Screens/InfoBarGenerics.py
parentc5c481c395ec9828847ebfd81481005e1c8d4fdb (diff)
downloadenigma2-b79bdb964320dabf4180ef6820a1ce335afccaa5.tar.gz
enigma2-b79bdb964320dabf4180ef6820a1ce335afccaa5.zip
Plugins/Plugin.py, InfoBarGenerics.py: add WHERE_AUDIOMENU for plugins .. requested by Tode for the AudioSync Plugin
fixes bug #305
Diffstat (limited to 'lib/python/Screens/InfoBarGenerics.py')
-rw-r--r--lib/python/Screens/InfoBarGenerics.py47
1 files changed, 38 insertions, 9 deletions
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index b98cd469..b672b682 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -1663,17 +1663,46 @@ class InfoBarAudioSelection:
else:
break
+ availableKeys = []
+ usedKeys = []
+
if SystemInfo["CanDownmixAC3"]:
- tlist = [(_("AC3 downmix") + " - " +(_("Off"), _("On"))[config.av.downmix_ac3.value and 1 or 0], "CALLFUNC", self.changeAC3Downmix),
- ((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode"),
- ("--", "")] + tlist
- keys = [ "red", "green", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n
- selection += 3
- else:
- tlist = [((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode"), ("--", "")] + tlist
- keys = [ "red", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n
+ flist = [(_("AC3 downmix") + " - " +(_("Off"), _("On"))[config.av.downmix_ac3.value and 1 or 0], "CALLFUNC", self.changeAC3Downmix),
+ ((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode")]
+ usedKeys.extend(["red", "green"])
+ availableKeys.extend(["yellow", "blue"])
selection += 2
- self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = tlist, selection = selection, keys = keys, skin_name = "AudioTrackSelection")
+ else:
+ flist = [((_("Left"), _("Stereo"), _("Right"))[self.audioChannel.getCurrentChannel()], "mode")]
+ usedKeys.extend(["red"])
+ availableKeys.extend(["green", "yellow", "blue"])
+ selection += 1
+
+ if hasattr(self, "runPlugin"):
+ class PluginCaller:
+ def __init__(self, fnc, *args):
+ self.fnc = fnc
+ self.args = args
+ def __call__(self, *args, **kwargs):
+ self.fnc(*self.args)
+
+ Plugins = [ (p.name, PluginCaller(self.runPlugin, p)) for p in plugins.getPlugins(where = PluginDescriptor.WHERE_AUDIOMENU) ]
+
+ for p in Plugins:
+ selection += 1
+ flist.append((p[0], "CALLFUNC", p[1]))
+ if availableKeys:
+ usedKeys.append(availableKeys[0])
+ del availableKeys[0]
+ else:
+ usedKeys.append("")
+
+ flist.append(("--", ""))
+ usedKeys.append("")
+ selection += 1
+
+ keys = usedKeys + [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" ] + [""] * n
+ self.session.openWithCallback(self.audioSelected, ChoiceBox, title=_("Select audio track"), list = flist + tlist, selection = selection, keys = keys, skin_name = "AudioTrackSelection")
else:
del self.audioTracks