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.Sources.Clock import Clock
10 from Components.Date import DateLabel
11 from Components.ProviderName import ProviderName
12 from Components.ActionMap import ActionMap, HelpableActionMap
13 from Components.config import currentConfigSelectionElement, config
15 from Tools.Notifications import AddNotificationWithCallback
17 from Screens.InfoBarGenerics import InfoBarShowHide, \
18 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
19 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
20 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
21 InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
22 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
23 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
24 InfoBarSubtitleSupport
26 from Screens.HelpMenu import HelpableScreen, HelpMenu
32 class InfoBar(InfoBarShowHide,
33 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
34 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
35 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
36 InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
37 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
38 InfoBarSubtitleSupport, Screen):
40 def __init__(self, session):
41 Screen.__init__(self, session)
43 CiHandler.setSession(session)
45 self["actions"] = HelpableActionMap(self, "InfobarActions",
47 "showMovies": (self.showMovies, _("Play recorded movies...")),
48 "showRadio": (self.showRadio, _("Show the radio player...")),
49 "showTv": (self.showTv, _("Show the tv player...")),
52 for x in HelpableScreen, \
54 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
55 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
56 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
57 InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
58 InfoBarTeletextPlugin, InfoBarExtensions, InfoBarSubtitleSupport:
61 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
62 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
64 self["CurrentTime"] = Clock()
67 self.showTvChannelList(True)
70 if currentConfigSelectionElement(config.usage.e1like_radio_mode) == "yes":
71 self.showRadioChannelList(True)
73 self.session.open(ChannelSelectionRadio)
76 self.session.openWithCallback(self.movieSelected, MovieSelection)
78 def movieSelected(self, service):
79 if service is not None:
80 self.session.open(MoviePlayer, service)
82 class MoviePlayer(InfoBarShowHide, \
84 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
85 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
86 InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport, Screen):
88 def __init__(self, session, service):
89 Screen.__init__(self, session)
91 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
93 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
96 for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
97 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
98 InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
99 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
100 InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport:
103 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
104 self.session.nav.playService(service)
106 def leavePlayer(self):
107 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
109 def leavePlayerConfirmed(self, answer):
111 self.session.nav.playService(self.lastservice)
114 def showMovies(self):
115 ref = self.session.nav.getCurrentlyPlayingServiceReference()
116 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
118 def movieSelected(self, service):
119 if service is not None:
120 self.session.nav.playService(service)