mpris controller: update to new api
authorRafaël Carré <funman@videolan.org>
Mon, 31 Dec 2007 03:02:30 +0000 (03:02 +0000)
committerRafaël Carré <funman@videolan.org>
Mon, 31 Dec 2007 03:02:30 +0000 (03:02 +0000)
extras/mpris.py

index 9a8961a..8b157b7 100755 (executable)
@@ -271,14 +271,22 @@ def icon_clicked(widget, event):
 # get playing status, modify the Play/Pause button accordingly
 def GetPlayStatus(widget):
     global playing
+    global shuffle
+    global loop
+    global repeat
     status = player.GetStatus()
-    if status == 0:
+
+    playing = status[0] == 0
+    if playing:
         img_bt_toggle.set_from_stock("gtk-media-pause", gtk.ICON_SIZE_SMALL_TOOLBAR)
-        playing = True
     else:
         img_bt_toggle.set_from_stock("gtk-media-play", gtk.ICON_SIZE_SMALL_TOOLBAR)
-        playing = False
-
+    shuffle = status[1] == 1
+    bt_shuffle.set_active( shuffle )
+    loop = status[2] == 1
+    bt_loop.set_active( loop )
+    repeat = status[3] == 1
+    bt_repeat.set_active( repeat )
 # loads glade file from the directory where the script is,
 # so we can use /path/to/mpris.py to execute it.
 import sys