1 from Screen import Screen
3 from Screens.MovieSelection import MovieSelection
4 from Screens.MessageBox import MessageBox
5 from ServiceReference import ServiceReference
7 from Components.Clock import Clock
8 from Components.ActionMap import ActionMap, HelpableActionMap
9 from Components.ServicePosition import ServicePosition
11 from Tools.Notifications import AddNotificationWithCallback
13 from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \
14 InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
15 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \
16 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
17 InfoBarSubserviceSelection, InfoBarTuner
19 from Screens.HelpMenu import HelpableScreen, HelpMenu
25 class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey,
26 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
27 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
28 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
29 InfoBarSubserviceSelection, InfoBarTuner):
31 def __init__(self, session):
32 Screen.__init__(self, session)
34 self["actions"] = HelpableActionMap(self, "InfobarActions",
36 "showMovies": (self.showMovies, _("Play recorded movies..."))
39 for x in HelpableScreen, \
40 InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
41 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
42 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
43 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, InfoBarTuner:
46 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
48 self["CurrentTime"] = Clock()
51 self.session.openWithCallback(self.movieSelected, MovieSelection)
53 def movieSelected(self, service):
54 if service is not None:
55 self.session.open(MoviePlayer, service)
57 class MoviePlayer(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
59 InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications):
61 def __init__(self, session, service):
62 Screen.__init__(self, session)
64 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
66 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
69 for x in HelpableScreen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection, InfoBarNotifications:
72 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
74 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
75 self.session.nav.playService(service)
77 def leavePlayer(self):
78 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
80 def leavePlayerConfirmed(self, answer):
82 self.session.nav.playService(self.lastservice)
86 ref = self.session.nav.getCurrentlyPlayingServiceReference()
87 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
89 def movieSelected(self, service):
90 if service is not None:
91 self.session.nav.playService(service)