diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-11-15 03:57:19 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-11-15 03:57:19 +0000 |
| commit | 364dcf5cdfa9f39414074a48501f25d714117729 (patch) | |
| tree | 7890a4b0536ee3605a970d97f733f8fbfcc2d0de /lib/python/Screens/InfoBar.py | |
| parent | abf92f8e291a1b4515926085ef34f41362133217 (diff) | |
| download | enigma2-364dcf5cdfa9f39414074a48501f25d714117729.tar.gz enigma2-364dcf5cdfa9f39414074a48501f25d714117729.zip | |
add CMoviePlayer
Diffstat (limited to 'lib/python/Screens/InfoBar.py')
| -rw-r--r-- | lib/python/Screens/InfoBar.py | 64 |
1 files changed, 45 insertions, 19 deletions
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index def45d69..2dcef59f 100644 --- a/lib/python/Screens/InfoBar.py +++ b/lib/python/Screens/InfoBar.py @@ -1,13 +1,16 @@ from Screen import Screen +from Screens.MovieSelection import MovieSelection +from Screens.MessageBox import MessageBox + from Components.Clock import Clock from Components.ActionMap import ActionMap -from Screens.AudioSelection import AudioSelection -from Screens.MovieSelection import MovieSelection +from Components.ServicePosition import ServicePosition from Screens.InfoBarGenerics import InfoBarVolumeControl, InfoBarShowHide, \ InfoBarPowerKey, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, \ - InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord + InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord, \ + InfoBarAudioSelection from enigma import * @@ -15,32 +18,55 @@ import time class InfoBar(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \ - InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord): + InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection): + def __init__(self, session): Screen.__init__(self, session) + + self["actions"] = ActionMap( [ "InfobarActions" ], + { + "showMovies": self.showMovies, + }) for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \ InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, \ - InfoBarEvent, InfoBarServiceName, InfoBarPVR, InfoBarInstantRecord: + InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection: x.__init__(self) - self["actions"] = ActionMap( [ "InfobarActions" ], + self["CurrentTime"] = Clock() + + def showMovies(self): + self.session.openWithCallback(self.movieSelected, MovieSelection) + + def movieSelected(self, service): + if service is not None: + self.session.open(MoviePlayer, service) + +class MoviePlayer(Screen, InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, \ + InfoBarMenu, \ + InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection): + + def __init__(self, session, service): + Screen.__init__(self, session) + + self["actions"] = ActionMap( [ "MoviePlayerActions" ], { - "showMovies": self.showMovies, - #"quit": self.quit, - "audioSelection": self.audioSelection, + "leavePlayer": self.leavePlayer }) + + for x in InfoBarVolumeControl, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, InfoBarServiceName, InfoBarPVR, InfoBarAudioSelection: + x.__init__(self) self["CurrentTime"] = Clock() # ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING) - # Clock() + + self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference() + self.session.nav.playService(service) - def showMovies(self): - self.session.open(MovieSelection) - - def audioSelection(self): - service = self.session.nav.getCurrentService() - audio = service.audioTracks() - n = audio.getNumberOfTracks() - if n > 0: - self.session.open(AudioSelection, audio) + def leavePlayer(self): + self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, "Stop playing this movie?") + + def leavePlayerConfirmed(self, answer): + if answer == True: + self.session.nav.playService(self.lastservice) + self.close() |
