aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-03-20 11:37:34 -0500
committerTed Gould <ted@gould.cx>2014-03-20 11:37:34 -0500
commit05ea9196dfbb9ea2a2482625103e9cccbd13b0ec (patch)
treead372c10cb146cbfca352c343b2338c37999c0b1 /src/volume-control.vala
parent006c044b3063c905a5c7aa8c31e91a4545acedae (diff)
parentb237767cb787f20e13fe564d0b07b33c38e58123 (diff)
downloadayatana-indicator-sound-05ea9196dfbb9ea2a2482625103e9cccbd13b0ec.tar.gz
ayatana-indicator-sound-05ea9196dfbb9ea2a2482625103e9cccbd13b0ec.tar.bz2
ayatana-indicator-sound-05ea9196dfbb9ea2a2482625103e9cccbd13b0ec.zip
Updating to trunk
Diffstat (limited to 'src/volume-control.vala')
-rw-r--r--src/volume-control.vala16
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)
{