- fix av switch
[vuplus_dvbapp] / lib / python / Components / AVSwitch.py
1 from config import *
2 import os
3
4 class AVSwitch:
5         def __init__(self):
6                 pass
7
8         def setColorFormat(self, value):
9                 print "colorformat:" + str(value)
10                 os.system("scart " + str(value))
11                 
12         def setAspectRatio(self, value):
13                 print "aspectratio:" + str(value)
14
15         def setSystem(self, value):
16                 print "system:" + str(value)
17
18         def setWSS(self, value):
19                 print "wss:" + str(value)
20
21 def InitAVSwitch():
22         config.av = ConfigSubsection();
23         config.av.colorformat = configElement("1", configBoolean, 1, ("CVBS", "RGB", "S-Video") );
24         config.av.aspectratio = configElement("2", configBoolean, 0, ("4:3 Letterbox", "4:3 PanScan", "16:9", "16:9 always") );
25         config.av.tvsystem = configElement("3", configBoolean, 0, ("PAL", "PAL + PAL60", "Multi", "NTSC") );
26         config.av.wss = configElement("4", configBoolean, 0, ("Enable", "Disable") );
27         config.av.defaultac3 = configElement("5", configBoolean, 1, ("Enable", "Disable") );
28         config.av.vcrswitch = configElement("6", configBoolean, 0, ("Enable", "Disable") );
29
30         iAVSwitch = AVSwitch()
31
32         def setColorFormat(configElement):
33                 iAVSwitch.setColorFormat(configElement.value);
34         def setAspectRatio(configElement):
35                 iAVSwitch.setAspectRatio(configElement.value);
36         def setSystem(configElement):
37                 iAVSwitch.setSystem(configElement.value);
38         def setWSS(configElement):
39                 iAVSwitch.setWSS(configElement.value);
40
41         # this will call the "setup-val" initial
42         config.av.colorformat.addNotifier(setColorFormat);
43         config.av.aspectratio.addNotifier(setAspectRatio);
44         config.av.tvsystem.addNotifier(setSystem);
45         config.av.wss.addNotifier(setWSS);
46
47