add avswitch calls
[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                 #print "colorformat:" + str(value)
11                 eAVSwitch.getInstance().setColorFormat(value)
12                 
13         def setAspectRatio(self, value):
14                 #print "aspectratio:" + str(value)
15                 eAVSwitch.getInstance().setAspectRatio(value)
16
17         def setSystem(self, value):
18                 print "system:" + str(value)
19                 eAVSwitch.getInstance().setVideomode(value)
20
21         def setWSS(self, value):
22                 #print "wss:" + str(value)
23                 pass
24
25 def InitAVSwitch():
26         config.av = ConfigSubsection();
27         config.av.colorformat = configElement("config.av.colorformat", configSelection, 1, ("CVBS", "RGB", "S-Video") );
28         config.av.aspectratio = configElement("config.av.aspectratio", configSelection, 0, ("4:3 Letterbox", "4:3 PanScan", "16:9", "16:9 always") );
29         config.av.tvsystem = configElement("config.av.tvsystem", configSelection, 0, ("PAL", "PAL + PAL60", "Multi", "NTSC") );
30         config.av.wss = configElement("config.av.wss", configSelection, 0, ("Enable", "Disable") );
31         config.av.defaultac3 = configElement("config.av.defaultac3", configSelection, 1, ("Enable", "Disable") );
32         config.av.vcrswitch = configElement("config.av.vcrswitch", configSelection, 0, ("Enable", "Disable") );
33
34         iAVSwitch = AVSwitch()
35
36         def setColorFormat(configElement):
37                 iAVSwitch.setColorFormat(configElement.value);
38         def setAspectRatio(configElement):
39                 iAVSwitch.setAspectRatio(configElement.value);
40         def setSystem(configElement):
41                 iAVSwitch.setSystem(configElement.value);
42         def setWSS(configElement):
43                 iAVSwitch.setWSS(configElement.value);
44
45         # this will call the "setup-val" initial
46         config.av.colorformat.addNotifier(setColorFormat);
47         config.av.aspectratio.addNotifier(setAspectRatio);
48         config.av.tvsystem.addNotifier(setSystem);
49         config.av.wss.addNotifier(setWSS);
50