[rygel/rygel-0-24] mpris: Trigger status update on connection
- From: Jens Georg <jensgeorg src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [rygel/rygel-0-24] mpris: Trigger status update on connection
 
- Date: Mon, 13 Oct 2014 20:13:51 +0000 (UTC)
 
commit 6ff9ef6a725e2a141229190478f2769de951946e
Author: Jens Georg <mail jensge org>
Date:   Sun Sep 28 20:25:19 2014 +0200
    mpris: Trigger status update on connection
    
    Signed-off-by: Jens Georg <mail jensge org>
 src/plugins/mpris/rygel-mpris-player.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/mpris/rygel-mpris-player.vala b/src/plugins/mpris/rygel-mpris-player.vala
index d4fc242..9a561b0 100644
--- a/src/plugins/mpris/rygel-mpris-player.vala
+++ b/src/plugins/mpris/rygel-mpris-player.vala
@@ -190,6 +190,20 @@ public class Rygel.MPRIS.Player : GLib.Object, Rygel.MediaPlayer {
         actual_player.g_properties_changed.connect (this.on_properties_changed);
     }
 
+    public override void constructed () {
+        base.constructed ();
+
+        // force synchronisation of current state
+        Idle.add (() => {
+            this.notify_property ("playback-state");
+            this.notify_property ("volume");
+            this.notify_property ("uri");
+            this.notify_property ("duration");
+
+            return false;
+        });
+    }
+
     public bool seek (int64 time) {
         var ret = false;
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]