1 from Screen import Screen
3 from Screens.MovieSelection import MovieSelection
4 from Screens.ChannelSelection import ChannelSelectionRadio
5 from Screens.MessageBox import MessageBox
6 from ServiceReference import ServiceReference
8 from Components.Clock import Clock
9 from Components.ActionMap import ActionMap, HelpableActionMap
10 from Components.ServicePosition import ServicePosition
12 from Tools.Notifications import AddNotificationWithCallback
14 from Screens.InfoBarGenerics import InfoBarShowHide, \
15 InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
16 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
17 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
18 InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift
20 from Screens.HelpMenu import HelpableScreen, HelpMenu
26 class InfoBar(Screen, InfoBarShowHide, InfoBarPowerKey,
27 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
28 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
29 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
30 InfoBarSubserviceSelection, InfoBarTuner):
32 def __init__(self, session):
33 Screen.__init__(self, session)
35 self["actions"] = HelpableActionMap(self, "InfobarActions",
37 "showMovies": (self.showMovies, _("Play recorded movies...")),
38 "showRadio": (self.showRadio, _("Show the radio player..."))
41 for x in HelpableScreen, \
42 InfoBarShowHide, InfoBarPowerKey, \
43 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
44 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
45 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
49 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
50 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
52 self["CurrentTime"] = Clock()
55 self.session.open(ChannelSelectionRadio)
58 self.session.openWithCallback(self.movieSelected, MovieSelection)
60 def movieSelected(self, service):
61 if service is not None:
62 self.session.open(MoviePlayer, service)
64 class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \
66 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications):
68 def __init__(self, session, service):
69 Screen.__init__(self, session)
71 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
73 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
76 for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, InfoBarNotifications:
79 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
81 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
82 self.session.nav.playService(service)
84 def leavePlayer(self):
85 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
87 def leavePlayerConfirmed(self, answer):
89 self.session.nav.playService(self.lastservice)
93 ref = self.session.nav.getCurrentlyPlayingServiceReference()
94 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
96 def movieSelected(self, service):
97 if service is not None:
98 self.session.nav.playService(service)