Author: dmeyer
Date: Thu Jan 17 15:42:03 2008
New Revision: 10293

Log:
change some parts to new kaa.notifier namespace

Modified:
   trunk/ui/bin/freevo
   trunk/ui/src/audio/player.py
   trunk/ui/src/games/player.py
   trunk/ui/src/video/player.py

Modified: trunk/ui/bin/freevo
==============================================================================
--- trunk/ui/bin/freevo (original)
+++ trunk/ui/bin/freevo Thu Jan 17 15:42:03 2008
@@ -180,7 +180,7 @@
 
     kaa.notifier.signals['lirc'].connect(handle_key)
     log.info('daemon running')
-    kaa.notifier.loop()
+    kaa.main.start()
     log.info('daemon done')
     sys.exit(1)
 
@@ -320,7 +320,7 @@
     del splash
 
     # start main loop
-    kaa.notifier.loop()
+    kaa.main.start()
 
 except SystemExit:
     kaa.notifier.shutdown()

Modified: trunk/ui/src/audio/player.py
==============================================================================
--- trunk/ui/src/audio/player.py        (original)
+++ trunk/ui/src/audio/player.py        Thu Jan 17 15:42:03 2008
@@ -35,9 +35,9 @@
 import logging
 
 # kaa imports
+import kaa
 import kaa.utils
 import kaa.popcorn
-import kaa.notifier
 
 # Freevo imports
 from freevo.ui.event import *
@@ -57,14 +57,14 @@
         Application.__init__(self, 'audioplayer', 'audio', capabilities)
         self.player = kaa.popcorn.Player()
         self.player.signals['failed'].connect_weak(self._play_failed)
-        self.elapsed_timer = kaa.notifier.WeakTimer(self.elapsed)
+        self.elapsed_timer = kaa.WeakTimer(self.elapsed)
 
 
     def play(self, item):
         """
         play an item
         """
-        retry = kaa.notifier.Callback(self.play, item)
+        retry = kaa.Callback(self.play, item)
         if not self.status in (STATUS_IDLE, STATUS_STOPPED):
             # Already running, stop the current player by sending a STOP
             # event. The event will also get to the playlist behind the
@@ -75,7 +75,7 @@
             self.signals['stop'].connect_once(retry)
             return True
 
-        if not kaa.notifier.running:
+        if not kaa.main.is_running():
             # Freevo is in shutdown mode, do not start a new player, the old
             # only stopped because of the shutdown.
             return False
@@ -86,7 +86,7 @@
         if blocked == False:
             log.error("Can't get Audio resource.")
             return False
-        if isinstance(blocked, kaa.notifier.InProgress):
+        if isinstance(blocked, kaa.InProgress):
             blocked.connect(retry)
             return True
 
@@ -193,7 +193,7 @@
         """
         return True
 
-    @kaa.notifier.yield_execution()
+    @kaa.yield_execution()
     def suspend(self):
         """
         Release the audio resource that others can use it.
@@ -206,11 +206,11 @@
         # FIXME: what happens if we send pause() the same time the file
         # is finished? This would create a race condition.
         self.player.pause()
-        yield kaa.notifier.YieldCallback(self.player.signals['pause'])
+        yield kaa.YieldCallback(self.player.signals['pause'])
         self.free_resources()
 
     
-    @kaa.notifier.yield_execution()
+    @kaa.yield_execution()
     def resume(self):
         """
         Resume playing the audio, at the position before.
@@ -225,10 +225,10 @@
             # FIXME: what to do in this case?
             log.error('unable to get AUDIO ressource')
             yield False
-        if isinstance(blocked, kaa.notifier.InProgress):
+        if isinstance(blocked, kaa.InProgress):
             yield blocked
         self.player.resume()
-        yield kaa.notifier.YieldCallback(self.player.signals['play'])
+        yield kaa.YieldCallback(self.player.signals['play'])
 
 
 # create singleton object

Modified: trunk/ui/src/games/player.py
==============================================================================
--- trunk/ui/src/games/player.py        (original)
+++ trunk/ui/src/games/player.py        Thu Jan 17 15:42:03 2008
@@ -38,8 +38,8 @@
 import logging
 
 # kaa imports
+import kaa
 import kaa.utils
-import kaa.notifier
 
 # freevo imports
 from freevo.ui.event import *
@@ -65,7 +65,7 @@
         if player == None:
             return False
         self.player = player
-        retry = kaa.notifier.Callback(self.play, item, player)
+        retry = kaa.Callback(self.play, item, player)
         if not self.status in (STATUS_IDLE, STATUS_STOPPED):
             # Already running, stop the current player by sending a STOP
             # event. The event will also get to the playlist behind the
@@ -76,7 +76,7 @@
             self.signals['stop'].connect_once(self.play, item)
             return True
 
-        if not kaa.notifier.running:
+        if not kaa.main.is_running():
             # Freevo is in shutdown mode, do not start a new player, the old
             # only stopped because of the shutdown.
             return False
@@ -88,7 +88,7 @@
         if blocked == False:
             log.error("Can't get resource AUDIO, VIDEO, JOYSTICK")
             return False
-        if isinstance(blocked, kaa.notifier.InProgress):
+        if isinstance(blocked, kaa.InProgress):
             blocked.connect(retry)
             return True
 

Modified: trunk/ui/src/video/player.py
==============================================================================
--- trunk/ui/src/video/player.py        (original)
+++ trunk/ui/src/video/player.py        Thu Jan 17 15:42:03 2008
@@ -35,9 +35,9 @@
 import logging
 
 # kaa imports
+import kaa
 import kaa.utils
 import kaa.popcorn
-import kaa.notifier
 
 # Freevo imports
 from freevo.ui.event import *
@@ -58,14 +58,14 @@
         self.player = kaa.popcorn.Player()
         self.player.set_window(self.engine.get_window())
         self.player.signals['failed'].connect_weak(self._play_failed)
-        self.elapsed_timer = kaa.notifier.WeakTimer(self.elapsed)
+        self.elapsed_timer = kaa.WeakTimer(self.elapsed)
 
 
     def play(self, item, player=None):
         """
         play an item
         """
-        retry = kaa.notifier.Callback(self.play, item, player)
+        retry = kaa.Callback(self.play, item, player)
         retry.set_ignore_caller_args(True)
         if not self.status in (STATUS_IDLE, STATUS_STOPPED):
             # Already running, stop the current player by sending a STOP
@@ -77,7 +77,7 @@
             self.signals['stop'].connect_once(retry)
             return True
 
-        if not kaa.notifier.running:
+        if not kaa.main.is_running():
             # Freevo is in shutdown mode, do not start a new player, the old
             # only stopped because of the shutdown.
             return False
@@ -89,7 +89,7 @@
         if blocked == False:
             log.error("Can't get resource AUDIO, VIDEO")
             return False
-        if isinstance(blocked, kaa.notifier.InProgress):
+        if isinstance(blocked, kaa.InProgress):
             blocked.connect(retry)
             return True
         

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to