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 = eServiceCenterPtr()
15 self.ServiceHandler = eServiceCenter.getInstance()
17 import Navigation as Nav
20 print "Navcore instance set!"
23 self.pnav = pNavigation()
24 self.pnav.m_event.get().append(self.callEvent)
26 self.currentlyPlayingService = None
28 self.RecordTimer = RecordTimer.RecordTimer()
30 def callEvent(self, i):
34 def playService(self, ref):
35 self.currentlyPlayingServiceReference = None
36 if not self.pnav.playService(ref):
37 self.currentlyPlayingServiceReference = ref
41 def getCurrentlyPlayingServiceReference(self):
42 return self.currentlyPlayingServiceReference
44 def recordService(self, ref):
45 print "recording service: %s" % (str(ref))
46 if isinstance(ref, ServiceReference.ServiceReference):
48 service = iRecordableServicePtr()
49 if self.pnav.recordService(ref, service):
50 print "record returned non-zero"
53 print "ok, recordService didn't fail"
56 def enqueueService(self, ref):
57 return self.pnav.enqueueService(ref)
59 def getCurrentService(self):
60 service = self.pnav.getCurrentService()
67 def getPlaylist(self):
68 playlist = ePlaylistPtr()
69 if self.pnav.getPlaylist(playlist):
74 return self.pnav.pause(p)
76 def recordWithTimer(self, begin, end, ref, epg, description):
77 if isinstance(ref, eServiceReference):
78 ref = ServiceReference.ServiceReference(ref)
79 entry = RecordTimer.RecordTimerEntry(begin, end, ref, epg, description)
80 self.RecordTimer.record(entry)
84 self.RecordTimer.shutdown()