aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-12-25 23:29:43 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-12-25 23:29:43 +0000
commit389ae07e59aaf1b8e504801cd49409072f7d3b6b (patch)
tree97d2d95ef91ea825c23c550da92a3d81b20e4076
parent7843cbf34ccb5b867ae49fc9e7731247e525f81e (diff)
downloadenigma2-389ae07e59aaf1b8e504801cd49409072f7d3b6b.tar.gz
enigma2-389ae07e59aaf1b8e504801cd49409072f7d3b6b.zip
add vcr scart switch to main menu
-rw-r--r--data/menu.xml1
-rw-r--r--data/skin.xml2
-rw-r--r--lib/driver/avswitch.cpp9
-rw-r--r--lib/driver/avswitch.h3
-rw-r--r--lib/python/Components/AVSwitch.py7
-rw-r--r--lib/python/Screens/Makefile.am2
-rw-r--r--lib/python/Screens/Scart.py23
7 files changed, 42 insertions, 5 deletions
diff --git a/data/menu.xml b/data/menu.xml
index 9aacc98a..7f0df144 100644
--- a/data/menu.xml
+++ b/data/menu.xml
@@ -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>
diff --git a/data/skin.xml b/data/skin.xml
index 4be94751..3a253e76 100644
--- a/data/skin.xml
+++ b/data/skin.xml
@@ -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"/>
diff --git a/lib/driver/avswitch.cpp b/lib/driver/avswitch.cpp
index 40db19ae..482a0f06 100644
--- a/lib/driver/avswitch.cpp
+++ b/lib/driver/avswitch.cpp
@@ -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);
}
diff --git a/lib/driver/avswitch.h b/lib/driver/avswitch.h
index ec7d5c13..9f6eccb7 100644
--- a/lib/driver/avswitch.h
+++ b/lib/driver/avswitch.h
@@ -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);
diff --git a/lib/python/Components/AVSwitch.py b/lib/python/Components/AVSwitch.py
index 768b08e9..33ea6600 100644
--- a/lib/python/Components/AVSwitch.py
+++ b/lib/python/Components/AVSwitch.py
@@ -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
diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am
index 03c01e9e..95f3a04e 100644
--- a/lib/python/Screens/Makefile.am
+++ b/lib/python/Screens/Makefile.am
@@ -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
index 00000000..50e65f17
--- /dev/null
+++ b/lib/python/Screens/Scart.py
@@ -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