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, InfoBarRdsDecoder, \
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, InfoBarRdsDecoder,
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, InfoBarRdsDecoder, \
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.rds_display.hide() # in InfoBarRdsDecoder
71 self.session.openWithCallback(self.ChannelSelectionRadioClosed, ChannelSelectionRadio, self)
73 def ChannelSelectionRadioClosed(self, *arg):
74 self.rds_display.show() # in InfoBarRdsDecoder
77 self.session.openWithCallback(self.movieSelected, MovieSelection)
79 def movieSelected(self, service):
80 if service is not None:
81 self.session.open(MoviePlayer, service)
83 class MoviePlayer(InfoBarShowHide, \
85 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
86 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
87 InfoBarSummarySupport, InfoBarSubtitleSupport, Screen, InfoBarExtensions, InfoBarTeletextPlugin,
88 InfoBarServiceErrorPopupSupport):
90 ENABLE_RESUME_SUPPORT = True
93 def __init__(self, session, service):
94 Screen.__init__(self, session)
96 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
98 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
101 for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
102 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
103 InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
104 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
105 InfoBarSummarySupport, InfoBarSubtitleSupport, InfoBarExtensions, \
106 InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport:
109 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
110 self.session.nav.playService(service)
112 def leavePlayer(self):
113 self.is_closing = True
114 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
116 def leavePlayerConfirmed(self, answer):
118 self.session.nav.playService(self.lastservice)
121 def showMovies(self):
122 ref = self.session.nav.getCurrentlyPlayingServiceReference()
123 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
125 def movieSelected(self, service):
126 if service is not None:
127 self.session.nav.playService(service)