add vcr scart switch to main menu
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 25 Dec 2005 23:29:43 +0000 (23:29 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 25 Dec 2005 23:29:43 +0000 (23:29 +0000)
data/menu.xml
data/skin.xml
lib/driver/avswitch.cpp
lib/driver/avswitch.h
lib/python/Components/AVSwitch.py
lib/python/Screens/Makefile.am
lib/python/Screens/Scart.py [new file with mode: 0644]

index 9aacc98a2f0f3bc75c012b4de482208eb6ae3929..7f0df1448b9e52f863ec978efe4412507b80e825 100644 (file)
@@ -18,6 +18,7 @@
                <!--<item text="CI"><screen module="Ci" screen="CiSelection" /></item>-->
                <!--<item text="Radio"><code>print "radio mode"</code></item>-->
                <item text="Timer"><screen module="TimerEdit" screen="TimerEditList" /></item>
+               <item text="VCR scart"><screen module="Scart" screen="Scart" /></item>
 
                <menu text="Information">
                        <item text="Service"><screen module="ServiceInfo" screen="ServiceInfo"/></item>
index 4be94751a037b658937a9abc64e853f9aa487fa6..3a253e76a82227e38bff507f7610ca9eda4dfc51 100644 (file)
@@ -41,7 +41,7 @@
                        <!--<widget name="menu" position="10,55" size="280,150" font="Regular;23" />-->
                        <widget name="menu" position="10,55" size="290,175" scrollbarMode="showOnDemand" />
                </screen>
-               <screen name="ScartLoopThrough" position="0,0" size="720,576">
+               <screen name="Scart" position="0,0" size="720,576">
                </screen>
                <screen name="ServiceInfo" position="160,120" size="400,330" title="Serviceinfo">
                        <widget name="infolist" position="20,10" size="360,325" selectionDisabled="1"/>
index 40db19ae03bc52b3eb4a6b04145c6dacd5eef748..482a0f062b4fb383d2d4a525b43139261591fac2 100644 (file)
@@ -46,6 +46,13 @@ void eAVSwitch::setInput(int val)
        write(fd, input[val], strlen(input[val]));
        close(fd);
        
+       if (val == 1)
+               setFastBlank(0);
+}
+
+void eAVSwitch::setFastBlank(int val)
+{
+       int fd;
        char *fb[] = {"low", "high", "vcr"};
 
        
@@ -54,7 +61,7 @@ void eAVSwitch::setInput(int val)
                return;
        }
 
-       write(fd, input[val], strlen(fb[0]));
+       write(fd, fb[val], strlen(fb[0]));
        close(fd);
 }
 
index ec7d5c136a0ea3ac3e394faefe9f18e219a951f3..9f6eccb7fd9569d65362456122cf3ad138699fc2 100644 (file)
@@ -11,7 +11,8 @@ public:
        ~eAVSwitch();
 
        static eAVSwitch *getInstance();
-
+       
+       void setFastBlank(int val);
        void setColorFormat(int format);
        void setAspectRatio(int ratio);
        void setVideomode(int mode);
index 768b08e948cdd5d3187544043b599c54063a66b4..33ea66009c378ef32e23e2e017a1acc33e0b4335 100644 (file)
@@ -3,6 +3,7 @@ import os
 from enigma import *
 
 class AVSwitch:
+       INPUT = { "ENCODER": 0, "SCART": 1, "AUX": 2 }
        def __init__(self):
                pass
 
@@ -19,6 +20,9 @@ class AVSwitch:
        def setWSS(self, value):
                #print "wss:" + str(value)
                pass
+       
+       def setInput(self, input):
+               eAVSwitch.getInstance().setInput(self.INPUT[input])
 
 def InitAVSwitch():
        config.av = ConfigSubsection();
@@ -46,4 +50,5 @@ def InitAVSwitch():
        config.av.aspectratio.addNotifier(setAspectRatio);
        config.av.tvsystem.addNotifier(setSystem);
        config.av.wss.addNotifier(setWSS);
-
+       
+       iAVSwitch.setInput("ENCODER") # init on startup
\ No newline at end of file
index 03c01e9ed110f147d93c6e83b19bfdc90d33637c..95f3a04e5cf62ec0ec27db219f26bf7ad9d9bfad 100644 (file)
@@ -8,4 +8,4 @@ install_PYTHON = \
        EpgSelection.py EventView.py Mute.py Standby.py ServiceInfo.py \
        AudioSelection.py InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \
        Dish.py SubserviceSelection.py LanguageSelection.py StartWizard.py \
-       TutorialWizard.py PluginBrowser.py MinuteInput.py
+       TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py
diff --git a/lib/python/Screens/Scart.py b/lib/python/Screens/Scart.py
new file mode 100644 (file)
index 0000000..50e65f1
--- /dev/null
@@ -0,0 +1,23 @@
+from Screen import Screen
+from MessageBox import MessageBox
+
+from Components.AVSwitch import AVSwitch
+
+from enigma import *
+
+class Scart(Screen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               
+               self.avswitch = AVSwitch()
+               
+               self.avswitch.setInput("SCART")
+               
+               self.onShown.append(self.showMessageBox)
+                               
+       def showMessageBox(self):
+               self.session.openWithCallback(self.switchToTV, MessageBox, _("If you see this, something is wrong with\nyour scart connection. Press OK to return."), MessageBox.TYPE_ERROR)
+               
+       def switchToTV(self, val):
+               self.avswitch.setInput("ENCODER")
+               self.close()
\ No newline at end of file