added missing return statement
[enigma2.git] / Navigation.py
index b71c93c..705083f 100644 (file)
@@ -12,18 +12,16 @@ class Navigation:
                
                NavigationInstance.instance = self
                self.ServiceHandler = eServiceCenter.getInstance()
                
                NavigationInstance.instance = self
                self.ServiceHandler = eServiceCenter.getInstance()
-               print self.ServiceHandler
 
                import Navigation as Nav
                Nav.navcore = self
                
 
                import Navigation as Nav
                Nav.navcore = self
                
-               print "Navcore instance set!"
-               print Nav.navcore
-               
                self.pnav = pNavigation()
                self.pnav.m_event.get().append(self.callEvent)
                self.event = [ ]
                self.currentlyPlayingService = None
                self.pnav = pNavigation()
                self.pnav.m_event.get().append(self.callEvent)
                self.event = [ ]
                self.currentlyPlayingService = None
+               self.currentlyPlayingServiceReference = None
+               self.lastServiceRef = None
                
                self.RecordTimer = RecordTimer.RecordTimer()
 
                
                self.RecordTimer = RecordTimer.RecordTimer()
 
@@ -32,12 +30,20 @@ class Navigation:
                        x(i)
        
        def playService(self, ref):
                        x(i)
        
        def playService(self, ref):
+               self.lastServiceRef = self.currentlyPlayingServiceReference
                self.currentlyPlayingServiceReference = None
                self.currentlyPlayingServiceReference = None
+               if ref is None:
+                       self.stopService()
+                       return 0
+               
                if not self.pnav.playService(ref):
                        self.currentlyPlayingServiceReference = ref
                        return 0
                return 1
        
                if not self.pnav.playService(ref):
                        self.currentlyPlayingServiceReference = ref
                        return 0
                return 1
        
+       def zapLast(self):
+               return self.playService(self.lastServiceRef)
+       
        def getCurrentlyPlayingServiceReference(self):
                return self.currentlyPlayingServiceReference
        
        def getCurrentlyPlayingServiceReference(self):
                return self.currentlyPlayingServiceReference
        
@@ -51,12 +57,8 @@ class Navigation:
                        print "record returned non-zero"
                        return None
                else:
                        print "record returned non-zero"
                        return None
                else:
-                       print "ok, recordService didn't fail"
                        return service
        
                        return service
        
-       def enqueueService(self, ref):
-               return self.pnav.enqueueService(ref)
-       
        def getCurrentService(self):
                service = self.pnav.getCurrentService()
                
        def getCurrentService(self):
                service = self.pnav.getCurrentService()
                
@@ -65,21 +67,21 @@ class Navigation:
                
                return service
        
                
                return service
        
-       def getPlaylist(self):
-               playlist = ePlaylistPtr()
-               if self.pnav.getPlaylist(playlist):
-                       return None
-               return playlist
+       def stopService(self):
+               self.pnav.stopService()
        
        def pause(self, p):
                return self.pnav.pause(p)
        
        
        def pause(self, p):
                return self.pnav.pause(p)
        
-       def recordWithTimer(self, begin, end, ref, epg, description):
+       def recordWithTimer(self, ref, begin, end, name, description, eit):
                if isinstance(ref, eServiceReference):
                        ref = ServiceReference.ServiceReference(ref)
                if isinstance(ref, eServiceReference):
                        ref = ServiceReference.ServiceReference(ref)
-               entry = RecordTimer.RecordTimerEntry(begin, end, ref, epg, description)
+               entry = RecordTimer.RecordTimerEntry(ref, begin, end, name, description, eit)
                self.RecordTimer.record(entry)
                return entry
        
        def shutdown(self):
                self.RecordTimer.shutdown()
                self.RecordTimer.record(entry)
                return entry
        
        def shutdown(self):
                self.RecordTimer.shutdown()
+
+       def stopUserServices(self):
+               self.stopService()