aboutsummaryrefslogtreecommitdiff
path: root/src/rhythmbox-controller.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-05-07 19:06:16 +0200
committerConor Curran <conor.curran@canonical.com>2010-05-07 19:06:16 +0200
commit4a17bff0cb034345ecce8e623a82026e8f60be3c (patch)
treee633e5aa418569c65e14fe26ed67dc706d43c194 /src/rhythmbox-controller.vala
parentff088da3bd5e436af0f205f01cf858a9c0a7004d (diff)
downloadayatana-indicator-sound-4a17bff0cb034345ecce8e623a82026e8f60be3c.tar.gz
ayatana-indicator-sound-4a17bff0cb034345ecce8e623a82026e8f60be3c.tar.bz2
ayatana-indicator-sound-4a17bff0cb034345ecce8e623a82026e8f60be3c.zip
music bridge in place
Diffstat (limited to 'src/rhythmbox-controller.vala')
-rw-r--r--src/rhythmbox-controller.vala40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/rhythmbox-controller.vala b/src/rhythmbox-controller.vala
new file mode 100644
index 0000000..da10daf
--- /dev/null
+++ b/src/rhythmbox-controller.vala
@@ -0,0 +1,40 @@
+using DbusmenuGlib;
+
+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);
+ }
+
+ 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_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);
+ }
+
+ private void onUriChange(dynamic DBus.Object rhythmbox, string uri){
+ debug("onUriChange, new uri : %s", uri);
+ }
+
+ private void onElapsedChange(dynamic DBus.Object rhythmbox, uint32 time){
+ debug("onElapsedChange, new time = %u", time);
+ }
+
+}