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, ServicePositionGauge
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, InfoBarCueSheetSupport
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()
54 # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
57 self.session.open(ChannelSelectionRadio)
60 self.session.openWithCallback(self.movieSelected, MovieSelection)
62 def movieSelected(self, service):
63 if service is not None:
64 self.session.open(MoviePlayer, service)
66 class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \
68 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
69 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport):
71 def __init__(self, session, service):
72 Screen.__init__(self, session)
74 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
76 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
79 for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, \
80 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
81 InfoBarAudioSelection, InfoBarNotifications, \
82 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport:
85 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
86 self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
87 self["PositionGauge"] = ServicePositionGauge(self.session.nav)
91 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
92 self.session.nav.playService(service)
94 def leavePlayer(self):
95 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
97 def leavePlayerConfirmed(self, answer):
99 self.session.nav.playService(self.lastservice)
102 def showMovies(self):
103 ref = self.session.nav.getCurrentlyPlayingServiceReference()
104 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
106 def movieSelected(self, service):
107 if service is not None:
108 self.session.nav.playService(service)