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, InfoBarSimpleEventView, \
20 InfoBarSummarySupport, InfoBarTimeshiftState
22 from Screens.HelpMenu import HelpableScreen, HelpMenu
28 class InfoBar(InfoBarShowHide, InfoBarPowerKey,
29 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
30 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
31 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
32 InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
33 InfoBarSummarySupport, InfoBarTimeshiftState, 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, \
45 InfoBarShowHide, InfoBarPowerKey, \
46 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
47 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
48 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
49 InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState:
52 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
53 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
55 self["CurrentTime"] = Clock()
56 # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
59 self.session.open(ChannelSelectionRadio)
62 self.session.openWithCallback(self.movieSelected, MovieSelection)
64 def movieSelected(self, service):
65 if service is not None:
66 self.session.open(MoviePlayer, service)
68 class MoviePlayer(InfoBarShowHide, InfoBarPowerKey, \
70 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
71 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
72 InfoBarSummarySupport, Screen):
74 def __init__(self, session, service):
75 Screen.__init__(self, session)
77 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
79 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
82 for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, \
83 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
84 InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
85 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
86 InfoBarSummarySupport:
89 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
90 self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
91 self["PositionGauge"] = ServicePositionGauge(self.session.nav)
95 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
96 self.session.nav.playService(service)
98 def leavePlayer(self):
99 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
101 def leavePlayerConfirmed(self, answer):
103 self.session.nav.playService(self.lastservice)
106 def showMovies(self):
107 ref = self.session.nav.getCurrentlyPlayingServiceReference()
108 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
110 def movieSelected(self, service):
111 if service is not None:
112 self.session.nav.playService(service)