1 from Source import Source
2 from Components.Element import cached
3 from enigma import eServiceReference
5 class StreamService(Source):
6 def __init__(self, navcore):
10 self.navcore = navcore
12 def serviceEvent(self, event):
19 service = property(getService)
21 def handleCommand(self, cmd):
22 print "StreamService handle command", cmd
23 self.ref = eServiceReference(cmd)
25 def recordEvent(self, service, event):
26 if service is self.__service:
28 print "RECORD event for us:", service
29 self.changed((self.CHANGED_ALL, ))
33 print "StreamService has no service ref set."
35 print "StreamService execBegin", self.ref.toString()
36 self.__service = self.navcore.recordService(self.ref)
37 self.navcore.record_event.append(self.recordEvent)
38 if self.__service is not None:
39 self.__service.prepareStreaming()
40 self.__service.start()
43 print "StreamService execEnd", self.ref.toString()
44 self.navcore.record_event.remove(self.recordEvent)
45 if self.__service is not None:
46 self.navcore.stopRecordService(self.__service)