diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-08-10 17:16:04 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-08-10 17:16:04 +0100 |
commit | 161c8c52715995d2c9e0b9cb04236aaa078c4e8f (patch) | |
tree | e739b873d9a333bf4e93a19f01fd536fc6a1f55a /src/music-player-bridge.vala | |
parent | 7cb21f1a155f52646030e987ab60503b02a04496 (diff) | |
parent | 82a8f86a7088a2e144c89373174c8e03a597f277 (diff) | |
download | ayatana-indicator-sound-161c8c52715995d2c9e0b9cb04236aaa078c4e8f.tar.gz ayatana-indicator-sound-161c8c52715995d2c9e0b9cb04236aaa078c4e8f.tar.bz2 ayatana-indicator-sound-161c8c52715995d2c9e0b9cb04236aaa078c4e8f.zip |
player and track specific support is in
Diffstat (limited to 'src/music-player-bridge.vala')
-rw-r--r-- | src/music-player-bridge.vala | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index b5932fa..72c9bdb 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -27,7 +27,7 @@ public class MusicPlayerBridge : GLib.Object private SettingsManager settings_manager; private Dbusmenu.Menuitem root_menu; - private HashMap<string, PlayerController> registered_clients; + private HashMap<string, PlayerController> registered_clients; private Mpris2Watcher watcher; public MusicPlayerBridge() @@ -158,10 +158,31 @@ public class MusicPlayerBridge : GLib.Object this.watcher.client_disappeared.connect (this.client_has_vanished); } - private static AppInfo? create_app_info ( string desktop ) + public void enable_player_specific_items_for_client (string object_path, + string desktop_id) { - DesktopAppInfo info = new DesktopAppInfo ( desktop ) ; + var mpris_key = determine_key ( desktop_id ); + if (this.registered_clients.has_key (mpris_key) == false){ + warning ("we don't have a client with desktop id %s registered", desktop_id); + return; + } + this.registered_clients[mpris_key].enable_player_specific_items(object_path); + } + public void enable_track_specific_items_for_client (string object_path, + string desktop_id) + { + var mpris_key = determine_key ( desktop_id ); + if (this.registered_clients.has_key (mpris_key) == false){ + warning ("we don't have a client with desktop id %s registered", desktop_id); + return; + } + this.registered_clients[mpris_key].enable_track_specific_items(object_path); + } + + private static AppInfo? create_app_info ( string desktop ) + { + DesktopAppInfo info = new DesktopAppInfo ( desktop ); if ( desktop == null || info == null ){ warning ( "Could not create a desktopappinfo instance from app: %s", desktop ); return null; |