X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1f820106cba412af1408ba56aa9cf51657e48857..c900a62b068cf1f583b8936aa0dae18c9683b461:/lib/python/Components/Sources/CurrentService.py diff --git a/lib/python/Components/Sources/CurrentService.py b/lib/python/Components/Sources/CurrentService.py index bec6d2dc..2501c176 100644 --- a/lib/python/Components/Sources/CurrentService.py +++ b/lib/python/Components/Sources/CurrentService.py @@ -1,22 +1,34 @@ from Components.PerServiceDisplay import PerServiceBase from enigma import iPlayableService from Source import Source +from Components.Element import cached class CurrentService(PerServiceBase, Source): def __init__(self, navcore): Source.__init__(self) PerServiceBase.__init__(self, navcore, { - iPlayableService.evStart: self.changed, - iPlayableService.evEnd: self.changed - }) + iPlayableService.evStart: self.serviceEvent, + iPlayableService.evEnd: self.serviceEvent, + # FIXME: we should check 'interesting_events' + # which is not always provided. + iPlayableService.evUpdatedInfo: self.serviceEvent, + iPlayableService.evUpdatedEventInfo: self.serviceEvent, + iPlayableService.evCuesheetChanged: self.serviceEvent, + iPlayableService.evVideoSizeChanged: self.serviceEvent + }, with_event=True) self.navcore = navcore - def getCurrentService(self): - service = self.navcore.getCurrentService() - return service + def serviceEvent(self, event): + self.changed((self.CHANGED_SPECIFIC, event)) - def stopEvent(self): - self.changed() + @cached + def getCurrentService(self): + return self.navcore.getCurrentService() service = property(getCurrentService) + + def destroy(self): + PerServiceBase.destroy(self) + Source.destroy(self) +