1 from Screen import Screen
3 from Screens.MovieSelection import MovieSelection
4 from Screens.MessageBox import MessageBox
6 from Components.Clock import Clock
7 from Components.ActionMap import ActionMap
8 from Components.ServicePosition import ServicePosition
10 from Tools.Notifications import AddNotificationWithCallback
12 from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \
13 InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
14 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \
15 InfoBarAudioSelection, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, \
16 InfoBarSubserviceSelection
18 from Screens.HelpMenu import HelpableScreen, HelpMenu
24 class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey,
25 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG,
26 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
27 HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
28 InfoBarSubserviceSelection):
30 def __init__(self, session):
31 Screen.__init__(self, session)
33 self["actions"] = ActionMap( [ "InfobarActions" ],
35 "showMovies": self.showMovies,
38 for x in HelpableScreen, \
39 InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
40 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
41 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \
42 InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection:
45 self.helpList.append((self["actions"], "InfobarActions", [("showMovies", "Watch a Movie...")]))
47 self["CurrentTime"] = Clock()
50 self.session.openWithCallback(self.movieSelected, MovieSelection)
52 def movieSelected(self, service):
53 if service is not None:
54 self.session.open(MoviePlayer, service)
56 class MoviePlayer(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
58 InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications):
60 def __init__(self, session, service):
61 Screen.__init__(self, session)
63 self["actions"] = ActionMap( [ "MoviePlayerActions" ],
65 "leavePlayer": self.leavePlayer
68 for x in HelpableScreen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection, InfoBarNotifications:
71 self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
73 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
74 self.session.nav.playService(service)
76 def leavePlayer(self):
77 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
79 def leavePlayerConfirmed(self, answer):
81 self.session.nav.playService(self.lastservice)