aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/AudioSelection.py
blob: 6e3a288e203a81256b5b53dd26699babe6d9b1d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from Screen import Screen
from Components.ActionMap import ActionMap
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.KeyOk,
			})

		self.audio = audio

		tlist = []
		n = audio.getNumberOfTracks()
		for x in range(n):
			i = audio.getTrackInfo(x)
			tlist.append((i.getDescription(), x))

		self["tracks"] = MenuList(tlist)