1 from Screen import Screen
3 from Screens.MovieSelection import MovieSelection
4 from Screens.MessageBox import MessageBox
6 from Components.Clock import Clock
7 from Components.ActionMap import ActionMap
8 from Components.ServicePosition import ServicePosition
10 from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \
11 InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
12 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \
15 from Screens.HelpMenu import HelpableScreen, HelpMenu
21 class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
22 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
23 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
26 def __init__(self, session):
27 Screen.__init__(self, session)
29 self["actions"] = ActionMap( [ "InfobarActions" ],
31 "showMovies": self.showMovies,
34 for x in HelpableScreen, \
35 InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
36 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
37 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection:
40 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
42 self["CurrentTime"] = Clock()
45 self.session.openWithCallback(self.movieSelected, MovieSelection)
47 def movieSelected(self, service):
48 if service is not None:
49 self.session.open(MoviePlayer, service)
51 class MoviePlayer(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
53 InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection):
55 def __init__(self, session, service):
56 Screen.__init__(self, session)
58 self["actions"] = ActionMap( [ "MoviePlayerActions" ],
60 "leavePlayer": self.leavePlayer
63 for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection:
66 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
68 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
69 self.session.nav.playService(service)
71 def leavePlayer(self):
72 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
74 def leavePlayerConfirmed(self, answer):
76 self.session.nav.playService(self.lastservice)