aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c5
-rw-r--r--src/service.vala4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index f8635c8..0a893b3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,9 +21,12 @@ main (int argc, char ** argv) {
/* Initialize libnotify */
notify_init ("indicator-sound");
+ MediaPlayerList * playerlist = MEDIA_PLAYER_LIST(media_player_list_mpris_new());
- service = indicator_sound_service_new ();
+ service = indicator_sound_service_new (playerlist);
result = indicator_sound_service_run (service);
+
+ g_object_unref(playerlist);
g_object_unref(service);
return result;
diff --git a/src/service.vala b/src/service.vala
index 25f3011..7b88e1b 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -18,12 +18,12 @@
*/
public class IndicatorSound.Service {
- public Service () {
+ public Service (MediaPlayerList playerlist) {
this.settings = new Settings ("com.canonical.indicator.sound");
this.volume_control = new VolumeControl ();
- this.players = new MediaPlayerList ();
+ this.players = playerlist;
this.players.player_added.connect (this.player_added);
this.players.player_removed.connect (this.player_removed);