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.Date import DateLabel
11 from Components.ProviderName import ProviderName
12 from Components.ActionMap import ActionMap, HelpableActionMap
13 from Components.ServicePosition import ServicePosition, ServicePositionGauge
14 from Components.config import currentConfigSelectionElement, config
16 from Tools.Notifications import AddNotificationWithCallback
18 from Screens.InfoBarGenerics import InfoBarShowHide, \
19 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
20 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
21 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
22 InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
23 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
24 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
25 InfoBarSubtitleSupport
27 from Screens.HelpMenu import HelpableScreen, HelpMenu
33 class InfoBar(InfoBarShowHide,
34 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
35 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
36 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
37 InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
38 InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
39 InfoBarSubtitleSupport, Screen):
41 def __init__(self, session):
42 Screen.__init__(self, session)
44 CiHandler.setSession(session)
46 self["actions"] = HelpableActionMap(self, "InfobarActions",
48 "showMovies": (self.showMovies, _("Play recorded movies...")),
49 "showRadio": (self.showRadio, _("Show the radio player...")),
50 "showTv": (self.showTv, _("Show the tv player...")),
53 for x in HelpableScreen, \
55 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
56 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
57 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
58 InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
59 InfoBarTeletextPlugin, InfoBarExtensions, InfoBarSubtitleSupport:
62 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
63 self.helpList.append((self["actions"], "InfobarActions", [("showRadio", "Hear Radio...")]))
65 self["CurrentTime"] = Clock()
66 # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
67 self["CurrentDate"] = DateLabel()
68 self["CurrentProvider"] = ProviderName(self.session.nav)
71 self.showTvChannelList(True)
74 if currentConfigSelectionElement(config.usage.e1like_radio_mode) == "yes":
75 self.showRadioChannelList(True)
77 self.session.open(ChannelSelectionRadio)
80 self.session.openWithCallback(self.movieSelected, MovieSelection)
82 def movieSelected(self, service):
83 if service is not None:
84 self.session.open(MoviePlayer, service)
86 class MoviePlayer(InfoBarShowHide, \
88 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
89 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
90 InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport, Screen):
92 def __init__(self, session, service):
93 Screen.__init__(self, session)
95 self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
97 "leavePlayer": (self.leavePlayer, _("leave movie player..."))
100 for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
101 InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
102 InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
103 InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
104 InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport:
107 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
108 self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
109 self["PositionGauge"] = ServicePositionGauge(self.session.nav)
113 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
114 self.session.nav.playService(service)
116 def leavePlayer(self):
117 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
119 def leavePlayerConfirmed(self, answer):
121 self.session.nav.playService(self.lastservice)
124 def showMovies(self):
125 ref = self.session.nav.getCurrentlyPlayingServiceReference()
126 self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
128 def movieSelected(self, service):
129 if service is not None:
130 self.session.nav.playService(service)