4 import NavigationInstance
5 import ServiceReference
7 # TODO: remove pNavgation, eNavigation and rewrite this stuff in python.
10 if NavigationInstance.instance is not None:
11 raise NavigationInstance.instance
13 NavigationInstance.instance = self
14 self.ServiceHandler = eServiceCenter.getInstance()
16 import Navigation as Nav
19 self.pnav = pNavigation()
20 self.pnav.m_event.get().append(self.callEvent)
22 self.currentlyPlayingService = None
23 self.currentlyPlayingServiceReference = None
25 self.RecordTimer = RecordTimer.RecordTimer()
27 def callEvent(self, i):
31 def playService(self, ref):
33 self.currentlyPlayingServiceReference = None
38 if not self.pnav.playService(ref):
39 self.currentlyPlayingServiceReference = ref
43 def getCurrentlyPlayingServiceReference(self):
44 return self.currentlyPlayingServiceReference
46 def recordService(self, ref):
47 print "recording service: %s" % (str(ref))
48 if isinstance(ref, ServiceReference.ServiceReference):
50 service = self.pnav.recordService(ref)
53 print "record returned non-zero"
58 def getCurrentService(self):
59 service = self.pnav.getCurrentService()
66 def stopService(self):
67 self.pnav.stopService()
70 return self.pnav.pause(p)
72 def recordWithTimer(self, ref, begin, end, name, description, eit):
73 if isinstance(ref, eServiceReference):
74 ref = ServiceReference.ServiceReference(ref)
75 entry = RecordTimer.RecordTimerEntry(ref, begin, end, name, description, eit)
76 self.RecordTimer.record(entry)
80 self.RecordTimer.shutdown()
83 def stopUserServices(self):