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 Tools.Notifications import AddNotificationWithCallback
12 from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \
13 InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
14 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \
15 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish
17 from Screens.HelpMenu import HelpableScreen, HelpMenu
23 class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey,
24 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
25 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
26 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish):
28 def __init__(self, session):
29 Screen.__init__(self, session)
31 self["actions"] = ActionMap( [ "InfobarActions" ],
33 "showMovies": self.showMovies,
36 for x in HelpableScreen, \
37 InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
38 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
39 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
40 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish:
43 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
45 self["CurrentTime"] = Clock()
48 self.session.openWithCallback(self.movieSelected, MovieSelection)
50 def movieSelected(self, service):
51 if service is not None:
52 self.session.open(MoviePlayer, service)
54 class MoviePlayer(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
56 InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications):
58 def __init__(self, session, service):
59 Screen.__init__(self, session)
61 self["actions"] = ActionMap( [ "MoviePlayerActions" ],
63 "leavePlayer": self.leavePlayer
66 for x in HelpableScreen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection, InfoBarNotifications:
69 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
71 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
72 self.session.nav.playService(service)
74 def leavePlayer(self):
75 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
77 def leavePlayerConfirmed(self, answer):
79 self.session.nav.playService(self.lastservice)