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
8 from Components.Sources.Clock import Clock
9 from Components.ActionMap import HelpableActionMap
10 from Components.config import config
12 from Tools.Notifications import AddNotificationWithCallback
14 from Screens.InfoBarGenerics import InfoBarShowHide, \
15 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRadioText, \
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, \
21 InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport
23 from Screens.HelpMenu import HelpableScreen, HelpMenu
25 class InfoBar(InfoBarShowHide,
26 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText,
27 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
28 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
29 InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
30 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
31 InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport,
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...")),
45 "showTv": (self.showTv, _("Show the tv player...")),
48 for x in HelpableScreen, \
50 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText, \
51 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
52 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
53 InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
54 InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarSleepTimer, \
55 InfoBarPlugins, InfoBarServiceErrorPopupSupport:
58 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", _("view recordings..."))]))
59 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", _("hear radio..."))]))
61 self["CurrentTime"] = Clock()
64 self.showTvChannelList(True)
67 if config.usage.e1like_radio_mode.value:
68 self.showRadioChannelList(True)
70 self.session.open(ChannelSelectionRadio)
73 self.session.openWithCallback(self.movieSelected, MovieSelection)
75 def movieSelected(self, service):
76 if service is not None:
77 self.session.open(MoviePlayer, service)
79 class MoviePlayer(InfoBarShowHide, \
81 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
82 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
83 InfoBarSummarySupport, InfoBarSubtitleSupport, Screen, InfoBarExtensions, InfoBarTeletextPlugin,
84 InfoBarServiceErrorPopupSupport):
86 ENABLE_RESUME_SUPPORT = True
89 def __init__(self, session, service):
90 Screen.__init__(self, session)
92 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
94 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
97 for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
98 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
99 InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
100 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
101 InfoBarSummarySupport, InfoBarSubtitleSupport, InfoBarExtensions, \
102 InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport:
105 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
106 self.session.nav.playService(service)
108 def leavePlayer(self):
109 self.is_closing = True
110 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
112 def leavePlayerConfirmed(self, answer):
114 self.session.nav.playService(self.lastservice)
117 def showMovies(self):
118 ref = self.session.nav.getCurrentlyPlayingServiceReference()
119 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
121 def movieSelected(self, service):
122 if service is not None:
123 self.session.nav.playService(service)