diff options
Diffstat (limited to 'lib/python/Components/Sources/StreamService.py')
| -rw-r--r-- | lib/python/Components/Sources/StreamService.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/python/Components/Sources/StreamService.py b/lib/python/Components/Sources/StreamService.py new file mode 100644 index 00000000..ac8db34d --- /dev/null +++ b/lib/python/Components/Sources/StreamService.py @@ -0,0 +1,44 @@ +from Source import Source +from Components.Element import cached +from enigma import eServiceReference + +class StreamService(Source): + def __init__(self, navcore): + Source.__init__(self) + self.ref = None + self.__service = None + self.navcore = navcore + + def serviceEvent(self, event): + pass + + @cached + def getService(self): + return self.__service + + service = property(getService) + + def handleCommand(self, cmd): + print "StreamService handle command", cmd + self.ref = eServiceReference(cmd) + + def recordEvent(self, service, event): + if service is self.__service: + return + print "RECORD event for us:", service + self.changed((self.CHANGED_ALL, )) + + def execBegin(self): + print "StreamService execBegin", self.ref.toString() + self.__service = self.navcore.recordService(self.ref) + self.navcore.record_event.append(self.recordEvent) + if self.__service is not None: + self.__service.prepareStreaming() + self.__service.start() + + def execEnd(self): + print "StreamService execEnd", self.ref.toString() + self.navcore.record_event.remove(self.recordEvent) + if self.__service is not None: + self.navcore.stopRecordService(self.__service) + self.__service = None |
