aboutsummaryrefslogtreecommitdiff
path: root/mytest.py
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-10-26 15:36:40 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-10-26 15:36:40 +0000
commite03c732afb410b4d6b9f9540c36c33c941ee38f1 (patch)
tree6726b70fe68281c956eb5044e991bd0d5ba074b1 /mytest.py
parent2acb4b8b6992707d79f7678f714c711e2c6fce1f (diff)
downloadenigma2-e03c732afb410b4d6b9f9540c36c33c941ee38f1.tar.gz
enigma2-e03c732afb410b4d6b9f9540c36c33c941ee38f1.zip
add auto vcr switching support (needs new drivers (fp.ko))
Diffstat (limited to 'mytest.py')
-rw-r--r--mytest.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/mytest.py b/mytest.py
index 15f3b7db..4c30de93 100644
--- a/mytest.py
+++ b/mytest.py
@@ -415,6 +415,31 @@ class PowerKey:
# halt
quitMainloop(1)
+from Screens.Scart import Scart
+
+class AutoScartControl:
+ def __init__(self, session):
+ self.force = False
+ self.current_vcr_sb = eAVSwitch.getInstance().getVCRSlowBlanking()
+ if self.current_vcr_sb and config.av.vcrswitch.value:
+ self.scartDialog = session.instantiateDialog(Scart, True)
+ else:
+ self.scartDialog = session.instantiateDialog(Scart, False)
+ config.av.vcrswitch.addNotifier(self.recheckVCRSb)
+ eAVSwitch.getInstance().vcr_sb_notifier.get().append(self.VCRSbChanged)
+
+ def recheckVCRSb(self, configElement):
+ self.VCRSbChanged(self.current_vcr_sb)
+
+ def VCRSbChanged(self, value):
+ #print "vcr sb changed to", value
+ self.current_vcr_sb = value
+ if config.av.vcrswitch.value or value > 2:
+ if value:
+ self.scartDialog.showMessageBox()
+ else:
+ self.scartDialog.switchToTV()
+
def runScreenTest():
plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
@@ -447,6 +472,9 @@ def runScreenTest():
vol = VolumeControl(session)
power = PowerKey(session)
+
+ # we need session.scart to access it from within menu.xml
+ session.scart = AutoScartControl(session)
runReactor()