X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7eb0843c6a7745d110b163d2dc21ae01238d3efd..d85c75fc186d91f497d5997982db94259b041280:/lib/python/Screens/SubservicesQuickzap.py diff --git a/lib/python/Screens/SubservicesQuickzap.py b/lib/python/Screens/SubservicesQuickzap.py index d7961079..09f2e727 100644 --- a/lib/python/Screens/SubservicesQuickzap.py +++ b/lib/python/Screens/SubservicesQuickzap.py @@ -4,14 +4,14 @@ from Components.Label import Label from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox -from InfoBarGenerics import InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarTimeshift, InfoBarSeek, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport +from InfoBarGenerics import InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarTimeshift, InfoBarSeek, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection from enigma import eTimer -class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, Screen): +class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection, Screen): def __init__(self, session, subservices): Screen.__init__(self, session) - for x in [InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarSubtitleSupport, InfoBarExtensions]: + for x in [InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarSubtitleSupport, InfoBarExtensions, InfoBarAudioSelection]: x.__init__(self) self.restoreService = self.session.nav.getCurrentlyPlayingServiceReference() @@ -56,18 +56,22 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info def nextSubservice(self): self.updateSubservices() - if self.currentlyPlayingSubservice == self.n - 1: - self.playSubservice(0) - else: - self.playSubservice(self.currentlyPlayingSubservice + 1) + if self.n: + if self.currentlyPlayingSubservice >= self.n - 1: + self.playSubservice(0) + else: + self.playSubservice(self.currentlyPlayingSubservice + 1) def previousSubservice(self): self.updateSubservices() - if self.currentlyPlayingSubservice == 0: - self.playSubservice(self.n - 1) - else: - self.playSubservice(self.currentlyPlayingSubservice - 1) - + if self.n: + if self.currentlyPlayingSubservice > self.n: + self.currentlyPlayingSubservice = self.n + if self.currentlyPlayingSubservice == 0: + self.playSubservice(self.n - 1) + else: + self.playSubservice(self.currentlyPlayingSubservice - 1) + def getSubserviceIndex(self, service): self.updateSubservices() for x in range(self.n): @@ -109,12 +113,12 @@ class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, Info self.close() def playSubservice(self, number = 0): - print "playSubservice" newservice = self.subservices.getSubservice(number) if newservice.valid(): del self.subservices del self.service self.lastservice = self.currentlyPlayingSubservice + self.session.nav.stopService() self.session.nav.playService(newservice) self.currentlyPlayingSubservice = number self.currentSubserviceNumberLabel.setText(str(number))