diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-06-24 01:25:13 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-06-24 01:25:13 +0100 |
commit | a07a88311d4efbaa8682354c199910a8d96eb0a7 (patch) | |
tree | 151bb2f1e55c9a5cb054dd7d3f7095530399b86e /src/music-player-bridge.vala | |
parent | 8939506a486c50d83c57a1ce21354243f71af4ab (diff) | |
download | ayatana-indicator-sound-a07a88311d4efbaa8682354c199910a8d96eb0a7.tar.gz ayatana-indicator-sound-a07a88311d4efbaa8682354c199910a8d96eb0a7.tar.bz2 ayatana-indicator-sound-a07a88311d4efbaa8682354c199910a8d96eb0a7.zip |
attempting to subscribe to client desktop file path notifications
Diffstat (limited to 'src/music-player-bridge.vala')
-rw-r--r-- | src/music-player-bridge.vala | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index b03ecbd..fb63866 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -1,5 +1,4 @@ /* -This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel. Copyright 2010 Canonical Ltd. Authors: @@ -28,9 +27,11 @@ public class MusicPlayerBridge : GLib.Object private Listener listener; private Dbusmenu.Menuitem root_menu; private HashMap<string, PlayerController> registered_clients; + private FamiliarPlayersDB playersDB; public MusicPlayerBridge() { + playersDB = new FamiliarPlayersDB(); registered_clients = new HashMap<string, PlayerController> (); listener = Listener.ref_default(); listener.indicator_added.connect(on_indicator_added); @@ -46,26 +47,24 @@ public class MusicPlayerBridge : GLib.Object root_menu = menu; } - public void on_indicator_added(Indicate.ListenerServer object, Indicate.ListenerIndicator p0) - { - debug("MusicPlayerBridge-> on_indicator_added"); - } - - public void on_indicator_removed(Indicate.ListenerServer object, Indicate.ListenerIndicator p0) - { - debug("MusicPlayerBridge -> on_indicator_removed"); - } - - public void on_indicator_modified(Indicate.ListenerServer object, Indicate.ListenerIndicator p0, string s) - { - debug("MusicPlayerBridge -> indicator_modified with vale %s", s ); - } +//static void +//desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * value, gpointer data) - public void on_server_added(Indicate.ListenerServer object, string type) + public void desktop_info_callback(Indicate.Listener listener, + Indicate.ListenerServer server, + owned string value, void* data) + { + + } + + public void on_server_added(Indicate.ListenerServer object, string type) { debug("MusicPlayerBridge -> on_server_added with value %s", type); if(server_is_not_of_interest(type)) return; string client_name = type.split(".")[1]; + listener_get_server_property_cb cb = (listener_get_server_property_cb)desktop_info_callback; + this.listener.server_get_desktop(object, cb); + if (root_menu != null && client_name != null){ PlayerController ctrl = new PlayerController(root_menu, client_name, true); registered_clients.set(client_name, ctrl); @@ -98,6 +97,20 @@ public class MusicPlayerBridge : GLib.Object { debug("MusicPlayerBridge-> on_server_count_changed with value %u", i); } + public void on_indicator_added(Indicate.ListenerServer object, Indicate.ListenerIndicator p0) + { + debug("MusicPlayerBridge-> on_indicator_added"); + } + + public void on_indicator_removed(Indicate.ListenerServer object, Indicate.ListenerIndicator p0) + { + debug("MusicPlayerBridge -> on_indicator_removed"); + } + + public void on_indicator_modified(Indicate.ListenerServer object, Indicate.ListenerIndicator p0, string s) + { + debug("MusicPlayerBridge -> indicator_modified with vale %s", s ); + } } |