filepush: do not loop anymore on eof, but signal an event
[enigma2.git] / Navigation.py
index 7e7c0f218d72235fbfc6bf90bd7c7b2e67c04d48..705083f69baf68fe8e5e0c23a34a61e03f4b9d3f 100644 (file)
@@ -21,6 +21,7 @@ class Navigation:
                self.event = [ ]
                self.currentlyPlayingService = None
                self.currentlyPlayingServiceReference = None
+               self.lastServiceRef = None
                
                self.RecordTimer = RecordTimer.RecordTimer()
 
@@ -29,12 +30,20 @@ class Navigation:
                        x(i)
        
        def playService(self, ref):
+               self.lastServiceRef = self.currentlyPlayingServiceReference
                self.currentlyPlayingServiceReference = None
+               if ref is None:
+                       self.stopService()
+                       return 0
+               
                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
        
@@ -50,9 +59,6 @@ class Navigation:
                else:
                        return service
        
-       def enqueueService(self, ref):
-               return self.pnav.enqueueService(ref)
-       
        def getCurrentService(self):
                service = self.pnav.getCurrentService()
                
@@ -64,21 +70,18 @@ class Navigation:
        def stopService(self):
                self.pnav.stopService()
        
-       def getPlaylist(self):
-               playlist = ePlaylistPtr()
-               if self.pnav.getPlaylist(playlist):
-                       return None
-               return playlist
-       
        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)
-               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()
+
+       def stopUserServices(self):
+               self.stopService()