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):
32 self.currentlyPlayingServiceReference = None
37 if not self.pnav.playService(ref):
38 self.currentlyPlayingServiceReference = ref
42 def getCurrentlyPlayingServiceReference(self):
43 return self.currentlyPlayingServiceReference
45 def recordService(self, ref):
46 print "recording service: %s" % (str(ref))
47 if isinstance(ref, ServiceReference.ServiceReference):
49 service = self.pnav.recordService(ref)
52 print "record returned non-zero"
57 def getCurrentService(self):
58 service = self.pnav.getCurrentService()
65 def stopService(self):
66 self.pnav.stopService()
69 return self.pnav.pause(p)
71 def recordWithTimer(self, ref, begin, end, name, description, eit):
72 if isinstance(ref, eServiceReference):
73 ref = ServiceReference.ServiceReference(ref)
74 entry = RecordTimer.RecordTimerEntry(ref, begin, end, name, description, eit)
75 self.RecordTimer.record(entry)
79 self.RecordTimer.shutdown()
82 def stopUserServices(self):