Infobar split
[enigma2.git] / lib / python / Screens / InfoBar.py
1 from Screen import Screen
2
3 from Components.Clock import Clock
4 from Components.ActionMap import ActionMap
5 from Screens.AudioSelection import AudioSelection
6
7 from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \
8         InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
9         InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord
10
11 from enigma import *
12
13 import time
14
15 class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
16         InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
17         InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord):
18         def __init__(self, session):
19                 Screen.__init__(self, session)
20                 
21                 for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
22                         InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
23                         InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord:
24                         x.__init__(self)
25
26                 self["actions"] = ActionMap( [ "InfobarActions" ], 
27                         {
28                                 "showMovies": self.showMovies,
29                                 #"quit": self.quit,
30                                 "audioSelection": self.audioSelection,
31                         })
32
33                 self["CurrentTime"] = Clock()
34                 # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
35                 # Clock()
36
37         def showMovies(self):
38                 self.session.open(MovieSelection)
39
40         def audioSelection(self):
41                 service = self.session.nav.getCurrentService()
42                 audio = service.audioTracks()
43                 n = audio.getNumberOfTracks()
44                 if n > 0:
45                         self.session.open(AudioSelection, audio)