6 INPUT = { "ENCODER": 0, "SCART": 1, "AUX": 2 }
10 def setColorFormat(self, value):
11 eAVSwitch.getInstance().setColorFormat(value)
13 def setAspectRatio(self, value):
14 eAVSwitch.getInstance().setAspectRatio(value)
17 def setSystem(self, value):
18 eAVSwitch.getInstance().setVideomode(value)
21 if currentConfigSelectionElement(config.av.aspectratio) == "4_3_letterbox" or currentConfigSelectionElement(config.av.aspectratio) == "4_3_panscan":
22 writevalue = "4:3_full_format"
23 elif currentConfigSelectionElement(config.av.aspectratio) == "16_9":
24 if currentConfigSelectionElement(config.av.wss) == "off":
25 writevalue = "auto(4:3_off)"
28 elif currentConfigSelectionElement(config.av.aspectratio) == "16_9_always":
29 writevalue = "16:9_full_format"
31 file = open("/proc/stb/denc/0/wss", "w")
32 file.write(writevalue)
35 print "[AVSwitch.py] Error writing to /proc/stb/denc/0/wss"
37 def setWSS(self, value = None):
40 def setInput(self, input):
41 eAVSwitch.getInstance().setInput(self.INPUT[input])
42 # FIXME why do we have to reset the colorformat? bug in avs-driver?
43 eAVSwitch.getInstance().setColorFormat(config.av.colorformat.value)
46 config.av = ConfigSubsection();
47 config.av.colorformat = configElement("config.av.colorformat", configSelection, 1, (("cvbs", _("CVBS")), ("rgb", _("RGB")), ("svideo", _("S-Video")) ))
48 config.av.aspectratio = configElement("config.av.aspectratio", configSelection, 0, (("4_3_letterbox", _("4:3 Letterbox")), ("4_3_panscan", _("4:3 PanScan")), ("16_9", _("16:9")), ("16_9_always", _("16:9 always"))) )
49 #config.av.tvsystem = configElement("config.av.tvsystem", configSelection, 0, ("PAL", "PAL + PAL60", "Multi", "NTSC") )
50 config.av.tvsystem = configElement("config.av.tvsystem", configSelection, 0, (("pal", _("PAL")), ("ntsc", _("NTSC"))) )
51 config.av.wss = configElement("config.av.wss", configSelection, 0, (("off", _("Off")), ("on", _("On"))) )
52 config.av.defaultac3 = configElement("config.av.defaultac3", configSelection, 1, (("enable", _("Enable")), ("disable", _("Disable"))))
53 config.av.vcrswitch = configElement("config.av.vcrswitch", configSelection, 1, (("enable", _("Enable")), ("disable", _("Disable"))))
55 iAVSwitch = AVSwitch()
57 def setColorFormat(configElement):
58 iAVSwitch.setColorFormat(configElement.value);
59 def setAspectRatio(configElement):
60 iAVSwitch.setAspectRatio(configElement.value);
61 def setSystem(configElement):
62 iAVSwitch.setSystem(configElement.value);
63 def setWSS(configElement):
64 iAVSwitch.setWSS(configElement.value);
66 # this will call the "setup-val" initial
67 config.av.colorformat.addNotifier(setColorFormat);
68 config.av.aspectratio.addNotifier(setAspectRatio);
69 config.av.tvsystem.addNotifier(setSystem);
70 config.av.wss.addNotifier(setWSS);
72 iAVSwitch.setInput("ENCODER") # init on startup