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