1 from Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.MenuList import MenuList
4 from Components.Label import Label
5 from Tools.ISO639 import LanguageCodes
7 class AudioSelection(Screen):
9 selection = self["tracks"].getCurrent()
10 print "select track " + str(selection[1])
12 self.audio.selectTrack(selection[1])
14 def __init__(self, session, audio):
15 Screen.__init__(self, session)
17 self["actions"] = ActionMap(["OkCancelActions"],
26 n = audio.getNumberOfTracks()
28 i = audio.getTrackInfo(x)
29 langCode = i.getLanguage()
31 description = i.getDescription();
33 if langCode in LanguageCodes:
34 language = LanguageCodes[langCode][0]
36 description += " (" + language + ")"
38 description = language
40 tlist.append((description, x))
42 self["tracks"] = MenuList(tlist)