diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-01-09 16:31:12 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-01-09 16:31:12 +0000 |
commit | c49d87b94dc4a8fe3ccb2c150ad1cd34404630f2 (patch) | |
tree | 8824cfe53ae0fea3a90f6489e3eed8610e74da86 /src/music-player-bridge.vala | |
parent | ce996a8b02131d9711cc3dee67f6c3844e55b8e8 (diff) | |
parent | 33e8e6c2ac125ba3806032ea3ef730bd5c782ac8 (diff) | |
download | ayatana-indicator-sound-c49d87b94dc4a8fe3ccb2c150ad1cd34404630f2.tar.gz ayatana-indicator-sound-c49d87b94dc4a8fe3ccb2c150ad1cd34404630f2.tar.bz2 ayatana-indicator-sound-c49d87b94dc4a8fe3ccb2c150ad1cd34404630f2.zip |
mpris interface introspection working nicel to determine playlist support
Diffstat (limited to 'src/music-player-bridge.vala')
-rw-r--r-- | src/music-player-bridge.vala | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index c7391cf..7587684 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -59,8 +59,9 @@ public class MusicPlayerBridge : GLib.Object null, this.fetch_icon_name(desktop), calculate_menu_position(), + null, PlayerController.state.OFFLINE ); - this.registered_clients.set(mpris_key, ctrl); + this.registered_clients.set(mpris_key, ctrl); } } @@ -74,7 +75,9 @@ public class MusicPlayerBridge : GLib.Object } } - public void client_has_become_available ( string desktop, string dbus_name ) + public void client_has_become_available ( string desktop, + string dbus_name, + bool use_playlists ) { if (desktop == null || desktop == ""){ warning("Client %s attempting to register without desktop entry being set on the mpris root", @@ -82,8 +85,9 @@ public class MusicPlayerBridge : GLib.Object return; } if (desktop in this.settings_manager.fetch_blacklist()) { - debug ("Client %s attempting to register but it has been blacklisted", + debug ("Client %s attempting to register but I'm afraid it is blacklisted", desktop); + return; } debug ( "client_has_become_available %s", desktop ); @@ -103,6 +107,7 @@ public class MusicPlayerBridge : GLib.Object dbus_name, this.fetch_icon_name(desktop), this.calculate_menu_position(), + use_playlists, PlayerController.state.READY ); this.registered_clients.set ( mpris_key, ctrl ); debug ( "Have not seen this %s before, new controller created.", desktop ); @@ -110,6 +115,7 @@ public class MusicPlayerBridge : GLib.Object debug ( "application added to the interested list" ); } else{ + this.registered_clients[mpris_key].use_playlists = use_playlists; this.registered_clients[mpris_key].update_state ( PlayerController.state.READY ); this.registered_clients[mpris_key].activate ( dbus_name ); debug("Application has already registered - awaken the hibernation: %s \n", dbus_name ); @@ -118,7 +124,8 @@ public class MusicPlayerBridge : GLib.Object public void client_has_vanished ( string mpris_root_interface ) { - debug("MusicPlayerBridge -> on_server_removed with value %s", mpris_root_interface); + debug("MusicPlayerBridge -> client with dbus interface %s has vanished", + mpris_root_interface ); if (root_menu != null){ debug("attempt to remove %s", mpris_root_interface); var mpris_key = determine_key ( mpris_root_interface ); @@ -128,7 +135,7 @@ public class MusicPlayerBridge : GLib.Object } } } - + public void set_root_menu_item ( Dbusmenu.Menuitem menu ) { this.root_menu = menu; |