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 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
16 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
17 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
18 InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
19 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
20 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions
22 from Screens.HelpMenu import HelpableScreen, HelpMenu
28 class InfoBar(InfoBarShowHide,
29 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
30 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
31 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
32 InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
33 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, Screen):
35 def __init__(self, session):
36 Screen.__init__(self, session)
38 self["actions"] = HelpableActionMap(self, "InfobarActions",
40 "showMovies": (self.showMovies, _("Play recorded movies...")),
41 "showRadio": (self.showRadio, _("Show the radio player..."))
44 for x in HelpableScreen, \
46 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
47 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
48 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
49 InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
50 InfoBarTeletextPlugin, InfoBarExtensions:
53 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
54 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
56 self["CurrentTime"] = Clock()
57 # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
60 self.session.open(ChannelSelectionRadio)
63 self.session.openWithCallback(self.movieSelected, MovieSelection)
65 def movieSelected(self, service):
66 if service is not None:
67 self.session.open(MoviePlayer, service)
69 class MoviePlayer(InfoBarShowHide, \
71 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
72 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
73 InfoBarSummarySupport, InfoBarTeletextPlugin, Screen):
75 def __init__(self, session, service):
76 Screen.__init__(self, session)
78 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
80 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
83 for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
84 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
85 InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
86 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
87 InfoBarSummarySupport, InfoBarTeletextPlugin:
90 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
91 self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
92 self["PositionGauge"] = ServicePositionGauge(self.session.nav)
96 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
97 self.session.nav.playService(service)
99 def leavePlayer(self):
100 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
102 def leavePlayerConfirmed(self, answer):
104 self.session.nav.playService(self.lastservice)
107 def showMovies(self):
108 ref = self.session.nav.getCurrentlyPlayingServiceReference()
109 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
111 def movieSelected(self, service):
112 if service is not None:
113 self.session.nav.playService(service)