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)
16 def setSystem(self, value):
17 eAVSwitch.getInstance().setVideomode(value)
19 def setWSS(self, value):
25 writevalue = "auto(4:3_off)"
27 file = open("/proc/stb/denc/0/wss", "w")
28 file.write(writevalue)
31 print "[AVSwitch.py] Error writing to /proc/stb/denc/0/wss"
33 def setInput(self, input):
34 eAVSwitch.getInstance().setInput(self.INPUT[input])
35 # FIXME why do we have to reset the colorformat? bug in avs-driver?
36 eAVSwitch.getInstance().setColorFormat(config.av.colorformat.value)
39 config.av = ConfigSubsection();
40 config.av.colorformat = configElement("config.av.colorformat", configSelection, 1, (("cvbs", _("CVBS")), ("rgb", _("RGB")), ("svideo", _("S-Video")) ))
41 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"))) )
42 #config.av.tvsystem = configElement("config.av.tvsystem", configSelection, 0, ("PAL", "PAL + PAL60", "Multi", "NTSC") )
43 config.av.tvsystem = configElement("config.av.tvsystem", configSelection, 0, (("pal", _("PAL")), ("ntsc", _("NTSC"))) )
44 config.av.wss = configElement("config.av.wss", configSelection, 0, (("off", _("Off")), ("auto", _("Auto")), ("auto_no4_3", _("Auto (disable on 4:3)"))) )
45 config.av.defaultac3 = configElement("config.av.defaultac3", configSelection, 1, (("enable", _("Enable")), ("disable", _("Disable"))))
46 config.av.vcrswitch = configElement("config.av.vcrswitch", configSelection, 1, (("enable", _("Enable")), ("disable", _("Disable"))))
48 iAVSwitch = AVSwitch()
50 def setColorFormat(configElement):
51 iAVSwitch.setColorFormat(configElement.value);
52 def setAspectRatio(configElement):
53 iAVSwitch.setAspectRatio(configElement.value);
54 def setSystem(configElement):
55 iAVSwitch.setSystem(configElement.value);
56 def setWSS(configElement):
57 iAVSwitch.setWSS(configElement.value);
59 # this will call the "setup-val" initial
60 config.av.colorformat.addNotifier(setColorFormat);
61 config.av.aspectratio.addNotifier(setAspectRatio);
62 config.av.tvsystem.addNotifier(setSystem);
63 config.av.wss.addNotifier(setWSS);
65 iAVSwitch.setInput("ENCODER") # init on startup