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, \
19 InfoBarServiceNotifications, InfoBarPVRState
21 from Screens.HelpMenu import HelpableScreen, HelpMenu
27 class InfoBar(Screen, InfoBarShowHide, InfoBarPowerKey,
28 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
29 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
30 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
31 InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek):
33 def __init__(self, session):
34 Screen.__init__(self, session)
36 self["actions"] = HelpableActionMap(self, "InfobarActions",
38 "showMovies": (self.showMovies, _("Play recorded movies...")),
39 "showRadio": (self.showRadio, _("Show the radio player..."))
42 for x in HelpableScreen, \
43 InfoBarShowHide, InfoBarPowerKey, \
44 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
45 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
46 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
47 InfoBarTuner, InfoBarTimeshift, InfoBarSeek:
50 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
51 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
53 self["CurrentTime"] = Clock()
56 self.session.open(ChannelSelectionRadio)
59 self.session.openWithCallback(self.movieSelected, MovieSelection)
61 def movieSelected(self, service):
62 if service is not None:
63 self.session.open(MoviePlayer, service)
65 class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \
67 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
68 InfoBarServiceNotifications, InfoBarPVRState):
70 def __init__(self, session, service):
71 Screen.__init__(self, session)
73 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
75 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
78 for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, \
79 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
80 InfoBarAudioSelection, InfoBarNotifications, \
81 InfoBarServiceNotifications, InfoBarPVRState:
84 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
85 self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
88 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
89 self.session.nav.playService(service)
91 def leavePlayer(self):
92 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
94 def leavePlayerConfirmed(self, answer):
96 self.session.nav.playService(self.lastservice)
100 ref = self.session.nav.getCurrentlyPlayingServiceReference()
101 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
103 def movieSelected(self, service):
104 if service is not None:
105 self.session.nav.playService(service)