remove ugly HACK
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 3 Jan 2007 11:12:13 +0000 (11:12 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 3 Jan 2007 11:12:13 +0000 (11:12 +0000)
send evEnd in correct order (this assumes that no one need the
currentService after evEnd is dispatched or in the evEnd callback

Navigation.py
lib/nav/core.cpp

index ece8922..06d47ac 100644 (file)
@@ -28,12 +28,10 @@ class Navigation:
                self.record_event = [ ]
                self.currentlyPlayingServiceReference = None
                self.currentlyPlayingService = None
                self.record_event = [ ]
                self.currentlyPlayingServiceReference = None
                self.currentlyPlayingService = None
-               self.state = 0
                self.RecordTimer = RecordTimer.RecordTimer()
                self.SleepTimer = SleepTimer.SleepTimer()
 
        def dispatchEvent(self, i):
                self.RecordTimer = RecordTimer.RecordTimer()
                self.SleepTimer = SleepTimer.SleepTimer()
 
        def dispatchEvent(self, i):
-               self.state = i != 1
                for x in self.event:
                        x(i)
 
                for x in self.event:
                        x(i)
 
@@ -91,11 +89,9 @@ class Navigation:
                return self.pnav and self.pnav.getRecordings()
 
        def getCurrentService(self):
                return self.pnav and self.pnav.getRecordings()
 
        def getCurrentService(self):
-               if self.state:
-                       if not self.currentlyPlayingService:
-                               self.currentlyPlayingService = self.pnav and self.pnav.getCurrentService()
-                       return self.currentlyPlayingService
-               return None
+               if not self.currentlyPlayingService:
+                       self.currentlyPlayingService = self.pnav and self.pnav.getCurrentService()
+               return self.currentlyPlayingService
 
        def stopService(self):
                print "stopService"
 
        def stopService(self):
                print "stopService"
index 45b4aa6..0b690b8 100644 (file)
@@ -59,13 +59,14 @@ RESULT eNavigation::stopService(void)
                /* check if there is a running service... */
        if (!m_runningService)
                return 1;
                /* check if there is a running service... */
        if (!m_runningService)
                return 1;
-                       /* send stop event */
-       m_event(iPlayableService::evEnd);
 
        ePtr<iPlayableService> tmp = m_runningService;
        m_runningService=0;
        tmp->stop();
 
 
        ePtr<iPlayableService> tmp = m_runningService;
        m_runningService=0;
        tmp->stop();
 
+       /* send stop event */
+       m_event(iPlayableService::evEnd);
+
                /* kill service. */
        m_service_event_conn = 0;
        return 0;
                /* kill service. */
        m_service_event_conn = 0;
        return 0;