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 Screens.Ci import CiHandler
7 from ServiceReference import ServiceReference
9 from Components.Clock import Clock
10 from Components.ActionMap import ActionMap, HelpableActionMap
11 from Components.ServicePosition import ServicePosition, ServicePositionGauge
13 from Tools.Notifications import AddNotificationWithCallback
15 from Screens.InfoBarGenerics import InfoBarShowHide, \
16 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
17 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
18 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
19 InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
20 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
21 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions
23 from Screens.HelpMenu import HelpableScreen, HelpMenu
29 class InfoBar(InfoBarShowHide,
30 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
31 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
32 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
33 InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
34 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, Screen):
36 def __init__(self, session):
37 Screen.__init__(self, session)
39 CiHandler.setSession(session)
41 self["actions"] = HelpableActionMap(self, "InfobarActions",
43 "showMovies": (self.showMovies, _("Play recorded movies...")),
44 "showRadio": (self.showRadio, _("Show the radio player..."))
47 for x in HelpableScreen, \
49 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
50 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
51 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
52 InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
53 InfoBarTeletextPlugin, InfoBarExtensions:
56 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
57 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
59 self["CurrentTime"] = Clock()
60 # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
63 self.session.open(ChannelSelectionRadio)
66 self.session.openWithCallback(self.movieSelected, MovieSelection)
68 def movieSelected(self, service):
69 if service is not None:
70 self.session.open(MoviePlayer, service)
72 class MoviePlayer(InfoBarShowHide, \
74 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
75 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
76 InfoBarSummarySupport, InfoBarTeletextPlugin, Screen):
78 def __init__(self, session, service):
79 Screen.__init__(self, session)
81 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
83 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
86 for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
87 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
88 InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
89 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
90 InfoBarSummarySupport, InfoBarTeletextPlugin:
93 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
94 self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
95 self["PositionGauge"] = ServicePositionGauge(self.session.nav)
99 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
100 self.session.nav.playService(service)
102 def leavePlayer(self):
103 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
105 def leavePlayerConfirmed(self, answer):
107 self.session.nav.playService(self.lastservice)
110 def showMovies(self):
111 ref = self.session.nav.getCurrentlyPlayingServiceReference()
112 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
114 def movieSelected(self, service):
115 if service is not None:
116 self.session.nav.playService(service)