+ def updateAspect(self, cfgelement):
+ # determine aspect = {any,4:3,16:9,16:10}
+ # determine policy = {bestfit,letterbox,panscan,nonlinear}
+
+ # based on;
+ # config.av.videoport.value: current video output device
+ # Scart:
+ # config.av.aspect:
+ # 4_3: use policy_169
+ # 16_9,16_10: use policy_43
+ # auto always "bestfit"
+ # config.av.policy_169
+ # letterbox use letterbox
+ # panscan use panscan
+ # scale use bestfit
+ # config.av.policy_43
+ # pillarbox use panscan
+ # panscan use letterbox ("panscan" is just a bad term, it's inverse-panscan)
+ # nonlinear use nonlinear
+ # scale use bestfit
+
+ port = config.av.videoport.value
+ if port not in config.av.videomode:
+ print "current port not available, not setting videomode"
+ return
+ mode = config.av.videomode[port].value
+
+ force_widescreen = self.isWidescreenMode(port, mode)
+
+ is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"]
+ is_auto = config.av.aspect.value == "auto"
+
+ if is_widescreen:
+ if force_widescreen:
+ aspect = "16:9"
+ else:
+ aspect = {"16_9": "16:9", "16_10": "16:10"}[config.av.aspect.value]
+ policy = {"pillarbox": "panscan", "panscan": "letterbox", "nonlinear": "nonlinear", "scale": "bestfit"}[config.av.policy_43.value]
+ elif is_auto:
+ aspect = "any"
+ policy = "bestfit"
+ else:
+ aspect = "4:3"
+ policy = {"letterbox": "letterbox", "panscan": "panscan", "scale": "bestfit"}[config.av.policy_169.value]
+
+ if not config.av.wss.value:
+ wss = "auto(4:3_off)"
+ else:
+ wss = "auto"
+
+ print "-> setting aspect, policy, wss", aspect, policy, wss
+ open("/proc/stb/video/aspect", "w").write(aspect)
+ open("/proc/stb/video/policy", "w").write(policy)
+ open("/proc/stb/denc/0/wss", "w").write(wss)
+ self.updateSlowblank()
+ self.updateFastblank()
+
+ def updateSlowblank(self):
+ if self.standby:
+ from Components.SystemInfo import SystemInfo
+ if SystemInfo["ScartSwitch"]:
+ input = "scart"
+ sb = "vcr"
+ else:
+ input = "off"
+ sb = "0"
+ else:
+ input = "encoder"
+ sb = "auto"
+
+ open("/proc/stb/avs/0/sb", "w").write(sb)
+ open("/proc/stb/avs/0/input", "w").write(input)
+
+ def updateStandby(self):
+ self.updateSlowblank()
+ self.updateFastblank()
+
+ def updateFastblank(self, *args):
+ if self.standby:
+ from Components.SystemInfo import SystemInfo
+ if SystemInfo["ScartSwitch"]:
+ fb = "vcr"
+ else:
+ fb = "low"
+ else:
+ if self.current_port == "Scart" and config.av.colorformat.value == "rgb":
+ fb = "high"
+ else:
+ fb = "low"
+ open("/proc/stb/avs/0/fb", "w").write(fb)
+