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
24 self.RecordTimer = RecordTimer.RecordTimer()
26 def callEvent(self, i):
30 def playService(self, ref):
31 self.currentlyPlayingServiceReference = None
32 if not self.pnav.playService(ref):
33 self.currentlyPlayingServiceReference = ref
37 def getCurrentlyPlayingServiceReference(self):
38 return self.currentlyPlayingServiceReference
40 def recordService(self, ref):
41 print "recording service: %s" % (str(ref))
42 if isinstance(ref, ServiceReference.ServiceReference):
44 service = self.pnav.recordService(ref)
47 print "record returned non-zero"
52 def enqueueService(self, ref):
53 return self.pnav.enqueueService(ref)
55 def getCurrentService(self):
56 service = self.pnav.getCurrentService()
63 def stopService(self):
64 self.pnav.stopService()
66 def getPlaylist(self):
67 playlist = ePlaylistPtr()
68 if self.pnav.getPlaylist(playlist):
73 return self.pnav.pause(p)
75 def recordWithTimer(self, begin, end, ref, epg, description):
76 if isinstance(ref, eServiceReference):
77 ref = ServiceReference.ServiceReference(ref)
78 entry = RecordTimer.RecordTimerEntry(begin, end, ref, epg, description)
79 self.RecordTimer.record(entry)
83 self.RecordTimer.shutdown()