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
-class SubservicesQuickzap(InfoBarShowHide, InfoBarMenu, InfoBarServiceName, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, Screen):
+from enigma import eTimer
+
+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()
self.updateSubservices()
self.currentlyPlayingSubservice = 0
-
- self.onLayoutFinish.append(self.playSubservice)
-
+
+ self.timer = eTimer()
+ self.timer.timeout.get().append(self.playSubservice)
+ self.onLayoutFinish.append(self.onLayoutFinished)
+
self["actions"] = NumberActionMap( [ "InfobarSubserviceQuickzapActions", "NumberActions", "DirectionActions", "ColorActions" ],
{
"up": self.showSelection,
"0": self.keyNumberGlobal
}, -1)
-
-
+ def onLayoutFinished(self):
+ self.timer.start(0,True)
+
def updateSubservices(self):
self.service = self.session.nav.getCurrentService()
self.subservices = self.service and self.service.subServices()
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):
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))