arm the video wizard
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 11 Feb 2008 12:58:36 +0000 (12:58 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 11 Feb 2008 12:58:36 +0000 (12:58 +0000)
lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py
lib/python/Plugins/SystemPlugins/Videomode/videowizard.xml

index 0969873..a6d886c 100644 (file)
@@ -105,6 +105,7 @@ class VideoHardware:
                return True
 
        def setMode(self, port, mode, rate, force = None):
                return True
 
        def setMode(self, port, mode, rate, force = None):
+               print "setMode - port:", port, "mode:", mode, "rate:", rate
                # we can ignore "port"
                self.current_mode = mode
                modes = self.rates[mode][rate]
                # we can ignore "port"
                self.current_mode = mode
                modes = self.rates[mode][rate]
index 8fffa5a..32052e2 100644 (file)
@@ -55,9 +55,17 @@ class VideoWizard(Wizard):
        def inputSelectionMade(self, index):
                print "inputSelectionMade:", index
                self.port = index
        def inputSelectionMade(self, index):
                print "inputSelectionMade:", index
                self.port = index
+               self.inputSelect(index)
                
        def inputSelectionMoved(self):
                
        def inputSelectionMoved(self):
-               print "selection moved:", self.selection
+               print "input selection moved:", self.selection
+               self.inputSelect(self.selection)
+               
+       def inputSelect(self, port):
+               print "inputSelect:", port
+               modeList = self.hw.getModeList(self.selection)
+               print "modeList:", modeList
+               self.hw.setMode(port = port, mode = modeList[0][0], rate = modeList[0][1][0])
                
        def listModes(self):
                list = []
                
        def listModes(self):
                list = []
@@ -69,22 +77,37 @@ class VideoWizard(Wizard):
        def modeSelectionMade(self, index):
                print "modeSelectionMade:", index
                self.mode = index
        def modeSelectionMade(self, index):
                print "modeSelectionMade:", index
                self.mode = index
+               self.modeSelect(index)
                
        def modeSelectionMoved(self):
                
        def modeSelectionMoved(self):
-               print "selection moved:", self.selection
+               print "mode selection moved:", self.selection
+               self.modeSelect(self.selection)
+               
+       def modeSelect(self, mode):
+               ratesList = self.listRates(mode)
+               print "ratesList:", ratesList
+               self.hw.setMode(port = self.port, mode = mode, rate = ratesList[0][0])
                
                
-       def listRates(self):
+       def listRates(self, querymode = None):
+               if querymode is None:
+                       querymode = self.mode
                list = []
                list = []
-               print "modes for port", self.port
+               print "modes for port", self.port, "and mode", querymode
                for mode in self.hw.getModeList(self.port):
                        print mode
                for mode in self.hw.getModeList(self.port):
                        print mode
-                       if mode[0] == self.mode:
+                       if mode[0] == querymode:
                                for rate in mode[1]:
                                        list.append((rate, rate))
                return list
        
        def rateSelectionMade(self, index):
                print "rateSelectionMade:", index
                                for rate in mode[1]:
                                        list.append((rate, rate))
                return list
        
        def rateSelectionMade(self, index):
                print "rateSelectionMade:", index
+               self.rateSelect(index)
                
        def rateSelectionMoved(self):
                
        def rateSelectionMoved(self):
-               print "selection moved:", self.selection
+               print "rate selection moved:", self.selection
+               self.rateSelect(self.selection)
+
+       def rateSelect(self, rate):
+               self.hw.setMode(port = self.port, mode = self.mode, rate = rate)
+
index 852c48e..1c0ded8 100644 (file)
@@ -58,6 +58,7 @@ self["arrowup"].moveTo(800, 232, 1)
 self["arrowup"].startMoving()
 self["rc"].moveTo(500, 50, 1)
 self["rc"].startMoving()
 self["arrowup"].startMoving()
 self["rc"].moveTo(500, 50, 1)
 self["rc"].startMoving()
+self.rateSelect("60Hz")
                </code>
        </step>
        <step id="dvirateselection" timeout="10" timeoutaction="changestep" timeoutstep="notworking50Hz">
                </code>
        </step>
        <step id="dvirateselection" timeout="10" timeoutaction="changestep" timeoutstep="notworking50Hz">
@@ -76,6 +77,10 @@ self["arrowup"].moveTo(800, 232, 1)
 self["arrowup"].startMoving()
 self["rc"].moveTo(500, 50, 1)
 self["rc"].startMoving()
 self["arrowup"].startMoving()
 self["rc"].moveTo(500, 50, 1)
 self["rc"].startMoving()
+self.rateSelect("50Hz")
+               </code>
+               <code pos="after">
+self.rateSelect("60Hz")                        
                </code>
        </step>
        <step id="notworking50Hz" nextstep="end">
                </code>
        </step>
        <step id="notworking50Hz" nextstep="end">
@@ -106,14 +111,16 @@ self["arrowup"].moveTo(800, 232, 1)
 self["arrowup"].startMoving()
 self["rc"].moveTo(500, 50, 1)
 self["rc"].startMoving()
 self["arrowup"].startMoving()
 self["rc"].moveTo(500, 50, 1)
 self["rc"].startMoving()
+self.rateSelect("50Hz")
                </code>
        </step>
        <step id="end">
                </code>
        </step>
        <step id="end">
-               <text value="The input port should be configured now.\nYou can now configure the screen by displaying some test pictures. Do you want to do that now?" />
+               <!--text value="The input port should be configured now.\nYou can now configure the screen by displaying some test pictures. Do you want to do that now?" /-->
+               <text value="You have successfully finished the video setup. If you want to change the settings later, you can do this in the settings menu."/>
                <displaytext value="No picture on TV? Press EXIT and retry." />
                <displaytext value="No picture on TV? Press EXIT and retry." />
-               <list evaluation="rateSelectionMade" onselect="rateSelectionMoved">
+               <!--list>
                        <listentry caption="Yes" step="yes" />
                        <listentry caption="No" step="no" />
                        <listentry caption="Yes" step="yes" />
                        <listentry caption="No" step="no" />
-               </list>
+               </list-->
                </step>
 </wizard>
                </step>
 </wizard>