1 from AC3utils import PLUGIN_BASE, PLUGIN_VERSION
2 from Components.ActionMap import ActionMap, NumberActionMap
3 from Components.Button import Button
4 from Components.ConfigList import ConfigListScreen
5 from Components.Label import Label,MultiColorLabel
6 from Components.ProgressBar import ProgressBar
7 from Components.config import config, getConfigListEntry
8 from Screens.ChoiceBox import ChoiceBox
9 from Screens.MessageBox import MessageBox
10 from Screens.Screen import Screen
11 from __init__ import _
14 class AC3LipSyncSetup(ConfigListScreen, Screen):
16 <screen position="center,center" size="560,400" title="AC3 Lip Sync Setup">
17 <ePixmap pixmap="~/img/button-red.png" position="0,0" zPosition="0" size="140,40" transparent="1" alphatest="on" />
18 <ePixmap pixmap="~/img/button-green.png" position="140,0" zPosition="0" size="140,40" transparent="1" alphatest="on" />
19 <ePixmap pixmap="~/img/button-yellow.png" position="280,0" zPosition="0" size="140,40" transparent="1" alphatest="on" />
20 <ePixmap pixmap="~/img/button-blue.png" position="420,0" zPosition="0" size="140,40" transparent="1" alphatest="on" />
21 <widget name="key_red" position="0,0" zPosition="1" size="140,40"
22 font="Regular;20" valign="center" halign="center" backgroundColor="#9f1313" transparent="1"
23 shadowColor="#000000" shadowOffset="-1,-1" />
24 <widget name="key_green" position="140,0" zPosition="1" size="140,40"
25 font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1"
26 shadowColor="#000000" shadowOffset="-1,-1" />
27 <widget name="key_yellow" position="280,0" zPosition="1" size="140,40"
28 font="Regular;20" valign="center" halign="center" backgroundColor="#a08500" transparent="1"
29 shadowColor="#000000" shadowOffset="-1,-1" />
30 <widget name="key_blue" position="420,0" zPosition="1" size="140,40"
31 font="Regular;20" valign="center" halign="center" backgroundColor="#18188b" transparent="1"
32 shadowColor="#000000" shadowOffset="-1,-1" />
33 <widget name="config" position="10,40" size="540,320" scrollbarMode="showOnDemand" />
34 <widget name="PluginInfo" position="10,370" size="540,20" zPosition="4" font="Regular;18" foregroundColor="#cccccc" />
37 def __init__(self, session, plugin_path):
38 Screen.__init__(self, session)
40 # Lets get a list of elements for the config list
42 getConfigListEntry(_("Outer Bound (+/-)"), config.plugins.AC3LipSync.outerBounds),
43 getConfigListEntry(_("Step in ms for arrow keys"), config.plugins.AC3LipSync.arrowStepSize),
44 getConfigListEntry(_("Wait time in ms before activation:"), config.plugins.AC3LipSync.activationDelay),
45 getConfigListEntry(_("Step in ms for keys '%s'") % ("1/3"), config.plugins.AC3LipSync.stepSize13),
46 getConfigListEntry(_("Step in ms for keys '%s'") % ("4/6"), config.plugins.AC3LipSync.stepSize46),
47 getConfigListEntry(_("Step in ms for keys '%s'") % ("7/9"), config.plugins.AC3LipSync.stepSize79),
48 getConfigListEntry(_("Step in ms for key %i") % (2), config.plugins.AC3LipSync.absoluteStep2),
49 getConfigListEntry(_("Step in ms for key %i") % (5), config.plugins.AC3LipSync.absoluteStep5),
50 getConfigListEntry(_("Step in ms for key %i") % (8), config.plugins.AC3LipSync.absoluteStep8)
53 ConfigListScreen.__init__(self, self.list)
55 self["config"].list = self.list
57 self.skin_path = plugin_path
60 self["PluginInfo"] = Label(_("Plugin: %(plugin)s , Version: %(version)s") %dict(plugin=PLUGIN_BASE,version=PLUGIN_VERSION))
63 self["key_red"] = Button(_("Cancel"))
64 self["key_green"] = Button(_("Save"))
65 self["key_yellow"] = Button(_(" "))
66 self["key_blue"] = Button(" ")
68 self["setupActions"] = NumberActionMap(["SetupActions", "ColorActions"],
71 "cancel": self.cancel,
83 for x in self["config"].list: