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