aboutsummaryrefslogtreecommitdiff
path: root/src/rhythmbox-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-05-18 00:52:39 +0100
committerConor Curran <conor.curran@canonical.com>2010-05-18 00:52:39 +0100
commit19eed06d9ad20121a17a6824297312f2b5ea8a7c (patch)
tree7e1d3d5f93da5b7f08fb5b4f899f0fe4a00ec8ba /src/rhythmbox-controller.vala
parentd73292111b3c141f62508ffb28971e6c5b36d751 (diff)
downloadayatana-indicator-sound-19eed06d9ad20121a17a6824297312f2b5ea8a7c.tar.gz
ayatana-indicator-sound-19eed06d9ad20121a17a6824297312f2b5ea8a7c.tar.bz2
ayatana-indicator-sound-19eed06d9ad20121a17a6824297312f2b5ea8a7c.zip
root menuitem passed in at start up the music-bridge - vapi file for dbusmenuitem need to be fixed
Diffstat (limited to 'src/rhythmbox-controller.vala')
-rw-r--r--src/rhythmbox-controller.vala56
1 files changed, 30 insertions, 26 deletions
diff --git a/src/rhythmbox-controller.vala b/src/rhythmbox-controller.vala
index 49cc9c0..734c8bd 100644
--- a/src/rhythmbox-controller.vala
+++ b/src/rhythmbox-controller.vala
@@ -1,40 +1,44 @@
using DbusmenuGlib;
-public class RhythmboxController : GLib.Object{
+public class RhythmboxController : GLib.Object
+{
private DBus.Connection connection;
private dynamic DBus.Object rhythmbox_player;
private dynamic DBus.Object rhythmbox_shell;
private dynamic DBus.Object rhythmbox_playlistmgr;
- public RhythmboxController(){
- try{
- this.connection = DBus.Bus.get (DBus.BusType.SESSION);
- }
- catch(Error e){
- debug("Problems connecting to the session bus - %s", e.message);
- }
-
+ public RhythmboxController()
+ {
+ try {
+ this.connection = DBus.Bus.get (DBus.BusType.SESSION);
+ } catch (Error e) {
+ debug("Problems connecting to the session bus - %s", e.message);
+ }
+
this.rhythmbox_player = this.connection.get_object ("org.gnome.Rhythmbox", "/org/gnome/Rhythmbox/Player", "org.gnome.Rhythmbox.Player");
- this.rhythmbox_shell = connection.get_object ("org.gnome.Rhythmbox", "/org/gnome/Rhythmbox/Shell", "/org/gnome/Rhythmbox/Shell");
- this.rhythmbox_playlistmgr = connection.get_object ("org.gnome.Rhythmbox", "/org/gnome/Rhythmbox/PlaylistManager", "/org/gnome/Rhythmbox/PlaylistManager");
+ this.rhythmbox_shell = connection.get_object ("org.gnome.Rhythmbox", "/org/gnome/Rhythmbox/Shell", "org.gnome.Rhythmbox.Shell");
+ this.rhythmbox_playlistmgr = connection.get_object ("org.gnome.Rhythmbox", "/org/gnome/Rhythmbox/PlaylistManager", "/org/gnome/Rhythmbox/PlaylistManager");
- //this.rhythmbox_player.PlayingUriChanged += onUriChange;
- this.rhythmbox_player.elapsedChanged += onElapsedChange;
+ this.rhythmbox_player.playingUriChanged += onUriChange;
+ this.rhythmbox_player.elapsedChanged += onElapsedChange;
- this.rhythmbox_player.setMute(false);
- bool b = this.rhythmbox_player.getMute();
- this.rhythmbox_player.playPause(true);
- //this.rhythmbox_playlistmgr.getPlaylists();
- //debug("playlist = %s", [0]);
- debug("New rhythmbox controller has been instantiated %i", (int)b);
- }
+ debug("New rhythmbox controller has been instantiated");
+ }
-// private void onUriChange(dynamic DBus.Object rhythmbox, string uri){
-// debug("onUriChange, new uri : %s", uri);
-// }
+ private void onUriChange(dynamic DBus.Object rhythmbox, string uri)
+ {
+ debug("onUriChange, new uri : %s", uri);
+ //;// = new HashTable<string, string>(str_hash,str_equal);
+ HashTable<string,Value?> ht = this.rhythmbox_shell.getSongProperties(uri);
+ var l = ht.get_keys();
+ foreach(string s in l){
+ debug("key = %s", s);
+ }
+ }
- private void onElapsedChange(dynamic DBus.Object rhythmbox, uint32 time){
- debug("onElapsedChange, new time = %u", time);
- }
+ private void onElapsedChange(dynamic DBus.Object rhythmbox, uint32 time)
+ {
+ debug("onElapsedChange, new time = %u", time);
+ }
}