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, ))
32 print "StreamService execBegin", self.ref.toString()
33 self.__service = self.navcore.recordService(self.ref)
34 self.navcore.record_event.append(self.recordEvent)
35 if self.__service is not None:
36 self.__service.prepareStreaming()
37 self.__service.start()
40 print "StreamService execEnd", self.ref.toString()
41 self.navcore.record_event.remove(self.recordEvent)
42 if self.__service is not None:
43 self.navcore.stopRecordService(self.__service)