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 enqueueService(self, ref):
58 return self.pnav.enqueueService(ref)
60 def getCurrentService(self):
61 service = self.pnav.getCurrentService()
68 def stopService(self):
69 self.pnav.stopService()
71 def getPlaylist(self):
72 playlist = ePlaylistPtr()
73 if self.pnav.getPlaylist(playlist):
78 return self.pnav.pause(p)
80 def recordWithTimer(self, begin, end, ref, epg, description):
81 if isinstance(ref, eServiceReference):
82 ref = ServiceReference.ServiceReference(ref)
83 entry = RecordTimer.RecordTimerEntry(begin, end, ref, epg, description)
84 self.RecordTimer.record(entry)
88 self.RecordTimer.shutdown()