diff options
author | Ted Gould <ted@gould.cx> | 2014-02-11 15:34:24 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-02-11 15:34:24 -0600 |
commit | eb1dc0ff1ae607763635ad220b7b914ec9235417 (patch) | |
tree | 10f334e1d1d66756f9e167ab1d23a897f6f6c6e3 /src/service.vala | |
parent | a38509fd4b0023456c48fcb014f6ba0063b16f23 (diff) | |
download | ayatana-indicator-sound-eb1dc0ff1ae607763635ad220b7b914ec9235417.tar.gz ayatana-indicator-sound-eb1dc0ff1ae607763635ad220b7b914ec9235417.tar.bz2 ayatana-indicator-sound-eb1dc0ff1ae607763635ad220b7b914ec9235417.zip |
Update the player based on which one is running
Diffstat (limited to 'src/service.vala')
-rw-r--r-- | src/service.vala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala index b6ed0a5..25f3011 100644 --- a/src/service.vala +++ b/src/service.vala @@ -275,12 +275,24 @@ public class IndicatorSound.Service { } bool update_player_actions () { + bool clear_accounts_player = true; + foreach (var player in this.players) { SimpleAction? action = this.actions.lookup_action (player.id) as SimpleAction; if (action != null) { action.set_state (this.action_state_for_player (player)); action.set_enabled (player.can_raise); } + + /* If we're playing then put that data in accounts service */ + if (player.is_running && accounts_service != null) { + accounts_service.player = player; + clear_accounts_player = false; + } + } + + if (clear_accounts_player && accounts_service != null) { + accounts_service.player = null; } this.player_action_update_id = 0; |