diff options
author | Ted Gould <ted@gould.cx> | 2014-03-20 11:43:01 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-03-20 11:43:01 -0500 |
commit | 1680e2e1552575d66898de0e3d90be0bfa354b7a (patch) | |
tree | 70e3f7a195927e9d5f2a422fd28e89c6e4550e2f /src/volume-control.vala | |
parent | 67d2b532117cc579d9589d228053042de68100b6 (diff) | |
parent | 831571ad497d790701d82305c57d8e69188a62ee (diff) | |
download | ayatana-indicator-sound-1680e2e1552575d66898de0e3d90be0bfa354b7a.tar.gz ayatana-indicator-sound-1680e2e1552575d66898de0e3d90be0bfa354b7a.tar.bz2 ayatana-indicator-sound-1680e2e1552575d66898de0e3d90be0bfa354b7a.zip |
Update to trunk and export updates
Diffstat (limited to 'src/volume-control.vala')
-rw-r--r-- | src/volume-control.vala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala index e994922..8f21b60 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -31,6 +31,7 @@ public class VolumeControl : Object private PulseAudio.Context context; private bool _mute = true; + private bool _is_playing = false; private double _volume = 0.0; private double _mic_volume = 0.0; @@ -97,6 +98,13 @@ public class VolumeControl : Object this.notify_property ("mute"); } + var playing = (i.state == PulseAudio.SinkState.RUNNING); + if (_is_playing != playing) + { + _is_playing = playing; + this.notify_property ("is-playing"); + } + if (_volume != volume_to_double (i.volume.values[0])) { _volume = volume_to_double (i.volume.values[0]); @@ -235,6 +243,14 @@ public class VolumeControl : Object } } + public bool is_playing + { + get + { + return this._is_playing; + } + } + /* Volume operations */ private static PulseAudio.Volume double_to_volume (double vol) { |