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 Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \
11 InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \
12 InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \
19 class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
20 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
21 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection):
23 def __init__(self, session):
24 Screen.__init__(self, session)
26 self["actions"] = ActionMap( [ "InfobarActions" ],
28 "showMovies": self.showMovies,
31 for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
32 InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \
33 InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection:
36 self["CurrentTime"] = Clock()
39 self.session.openWithCallback(self.movieSelected, MovieSelection)
41 def movieSelected(self, service):
42 if service is not None:
43 self.session.open(MoviePlayer, service)
45 class MoviePlayer(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \
47 InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection):
49 def __init__(self, session, service):
50 Screen.__init__(self, session)
52 self["actions"] = ActionMap( [ "MoviePlayerActions" ],
54 "leavePlayer": self.leavePlayer
57 for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection:
60 self["CurrentTime"] = Clock()
61 # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
63 self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
64 self.session.nav.playService(service)
66 def leavePlayer(self):
67 self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, "Stop playing this movie?")
69 def leavePlayerConfirmed(self, answer):
71 self.session.nav.playService(self.lastservice)