aboutsummaryrefslogtreecommitdiff
path: root/src/service.vala
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-04-09 11:56:31 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-04-09 11:56:31 +0200
commit7fec353c5c10a320eb11fb4757ddeef3f544f4ec (patch)
treebeb428cd4c0f29bf0cc2c9f6047bc34c33a55d45 /src/service.vala
parente0e9e9bc1e6a0bf393134c9fa6927f2fccc525f2 (diff)
downloadayatana-indicator-sound-7fec353c5c10a320eb11fb4757ddeef3f544f4ec.tar.gz
ayatana-indicator-sound-7fec353c5c10a320eb11fb4757ddeef3f544f4ec.tar.bz2
ayatana-indicator-sound-7fec353c5c10a320eb11fb4757ddeef3f544f4ec.zip
Add information about the current track to the player actions
Diffstat (limited to 'src/service.vala')
-rw-r--r--src/service.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala
index 9b9900c..69ca6d1 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -152,6 +152,13 @@ public class IndicatorSound.Service {
Variant action_state_for_player (MediaPlayer player) {
var builder = new VariantBuilder (new VariantType ("a{sv}"));
builder.add ("{sv}", "running", new Variant ("b", player.is_running));
+ builder.add ("{sv}", "state", new Variant ("s", player.state));
+ if (player.current_track != null) {
+ builder.add ("{sv}", "title", new Variant ("s", player.current_track.title));
+ builder.add ("{sv}", "artist", new Variant ("s", player.current_track.artist));
+ builder.add ("{sv}", "album", new Variant ("s", player.current_track.album));
+ builder.add ("{sv}", "art-url", new Variant ("s", player.current_track.art_url));
+ }
return builder.end ();
}