audioselection is working now
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 14 Nov 2005 23:18:16 +0000 (23:18 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 14 Nov 2005 23:18:16 +0000 (23:18 +0000)
lib/python/Screens/AudioSelection.py

index a3700ce..6e3a288 100644 (file)
@@ -4,24 +4,28 @@ from Components.MenuList import MenuList
 from Components.Label import Label
 
 class AudioSelection(Screen):
+       def KeyOk(self):
+               selection = self["tracks"].getCurrent()
+               print "select track " + str(selection[1])
+               self.audio.selectTrack(selection[1])
+               self.close()
        def __init__(self, session, audio):
                Screen.__init__(self, session)
 
                self["actions"] = ActionMap(["SetupActions"], 
                        {
                                "cancel": self.close,
-                               "ok": self.close,
+                               "ok": self.KeyOk,
                        })
 
-               tlist = []
+               self.audio = audio
 
+               tlist = []
                n = audio.getNumberOfTracks()
-               print "AUDIO TRACKS:"
                for x in range(n):
                        i = audio.getTrackInfo(x)
-                       print i.getDescription()
                        tlist.append((i.getDescription(), x))
 
                self["tracks"] = MenuList(tlist)
-               #self["tracks"] = Label("Blasel")
+
                
\ No newline at end of file