eWindow: title change will now invalidate decoration.
[enigma2.git] / lib / python / Screens / AudioSelection.py
1 from Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.MenuList import MenuList
4 from Components.Label import Label
5
6 class AudioSelection(Screen):
7         def KeyOk(self):
8                 selection = self["tracks"].getCurrent()
9                 print "select track " + str(selection[1])
10                 self.audio.selectTrack(selection[1])
11                 self.close()
12         def __init__(self, session, audio):
13                 Screen.__init__(self, session)
14
15                 self["actions"] = ActionMap(["SetupActions"], 
16                         {
17                                 "cancel": self.close,
18                                 "ok": self.KeyOk,
19                         })
20
21                 self.audio = audio
22
23                 tlist = []
24                 n = audio.getNumberOfTracks()
25                 for x in range(n):
26                         i = audio.getTrackInfo(x)
27                         tlist.append((i.getDescription(), x))
28
29                 self["tracks"] = MenuList(tlist)
30
31