Author: dmeyer
Date: Sun Jan 29 17:54:04 2006
New Revision: 7894

Modified:
   trunk/ui/src/plugins/mbus.py

Log:
move to new mbus.status code

Modified: trunk/ui/src/plugins/mbus.py
==============================================================================
--- trunk/ui/src/plugins/mbus.py        (original)
+++ trunk/ui/src/plugins/mbus.py        Sun Jan 29 17:54:04 2006
@@ -18,9 +18,6 @@
 
         mbus = freevo.ipc.Instance()
         mbus.connect('freevo.ipc.status')
-        mbus.connect_rpc(self.play, 'home-theatre.play')
-        mbus.connect_rpc(self.stop, 'home-theatre.stop')
-        mbus.connect_rpc(self.status, 'home-theatre.status')
 
         self.status = mbus.status
         self.status.set('idle', 0)
@@ -37,6 +34,25 @@
         self.__timer.start(60)
 
         
+    def eventhandler(self, event):
+        # each event resets the idle time
+        if event == PLAY_START and event.arg and hasattr(event.arg, 'url'):
+            self.status.set('playing', event.arg.url)
+        if event == PLAY_END:
+            self.status.set('playing', '')
+        self.idle_time = 0
+        return True
+
+
+    def update_idle_time(self):
+        app = application.get_active()
+        if app and app.get_name() == 'menu':
+            self.idle_time += 1
+            self.status.set('idle', self.idle_time)
+        return True
+
+
+    @freevo.ipc.expose('home-theatre.play')
     def play(self, file):
         app = application.get_active()
         if not app or app.get_name() != 'menu':
@@ -51,35 +67,7 @@
         raise RuntimeError('no player found')
 
 
+    @freevo.ipc.expose('home-theatre.stop')
     def stop(self):
         STOP.post()
         return []
-
-
-    def status(self):
-        """
-        Send status on rpc status request.
-        """
-        app = application.get_active()
-        if not app or app.get_name() != 'menu':
-            self.idle_time = 0
-        status = { 'idle': self.idle_time }
-        return status
-
-
-    def eventhandler(self, event):
-        # each event resets the idle time
-        if event == PLAY_START and event.arg and hasattr(event.arg, 'url'):
-            self.status.set('playing', event.arg.url)
-        if event == PLAY_END:
-            self.status.set('playing', '')
-        self.idle_time = 0
-        return True
-
-
-    def update_idle_time(self):
-        app = application.get_active()
-        if app and app.get_name() == 'menu':
-            self.idle_time += 1
-            self.status.set('idle', self.idle_time)
-        return True


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to