smaller cleanups,
[vuplus_dvbapp-plugin] / ac3lipsync / src / plugin.py
1 from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSubList
2 from Plugins.Plugin import PluginDescriptor
3 from Screens.MessageBox import MessageBox
4 import AC3main
5 import AC3setup
6
7 config.plugins.AC3LipSync = ConfigSubsection()
8 config.plugins.AC3LipSync.lowerBound = ConfigInteger(default = 0, limits = (0,10000))
9 config.plugins.AC3LipSync.upperBound = ConfigInteger(default = 405, limits = (0,10000))
10 config.plugins.AC3LipSync.arrowStepSize = ConfigInteger(default = 5, limits = (0,10000))
11 config.plugins.AC3LipSync.stepSize = ConfigInteger(default = 45, limits = (0,10000))
12 config.plugins.AC3LipSync.keySteps = ConfigSubList()
13 for i in range(0, 10):
14     s = ConfigSubsection()
15     s.stepSize = ConfigInteger(default = i*45, limits = (0,10000))
16     config.plugins.AC3LipSync.keySteps.append(s)
17     del s
18
19 def main(session, **kwargs):
20 #    reload(AC3main)
21     session.open(AC3main.AC3LipSync)
22
23 def setup(session, **kwargs):
24 #    reload(AC3setup)
25     session.open(AC3setup.AC3LipSyncSetup)
26
27 def mainSetup(menuid, **kwargs):
28     if menuid == "setup":
29         return [(_("AC3 Lip Sync"), main, "ac3_lipsync", 99)]
30     return [ ]
31
32 def Plugins(**kwargs):
33     return [ PluginDescriptor(name=_("AC3 Lip Sync"), description=_("sets the AC3 audio Delay (LipSync)"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main),
34         PluginDescriptor(name=_("AC3 Lip Sync Setup"), description=_("Setup for the AC3 Lip Sync Plugin"), icon = "AC3LipSync.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=setup),
35         PluginDescriptor(name=_("AC3 Lip Sync"), description=_("sets the AC3 audio Delay (LipSync)"), where = PluginDescriptor.WHERE_MENU, fnc=mainSetup)]
36