diff options
author | Mirco Müller <mirco.mueller@ubuntu.com> | 2014-08-05 11:13:51 +0200 |
---|---|---|
committer | Mirco Müller <mirco.mueller@ubuntu.com> | 2014-08-05 11:13:51 +0200 |
commit | e6886725945a09d3f286d35b313e23c94c2a091b (patch) | |
tree | f24a866bfed805a9304158ee8f0e5bc01876ac2b | |
parent | e964fb77076144d577f85260896a18648b5b40f8 (diff) | |
download | ayatana-indicator-sound-e6886725945a09d3f286d35b313e23c94c2a091b.tar.gz ayatana-indicator-sound-e6886725945a09d3f286d35b313e23c94c2a091b.tar.bz2 ayatana-indicator-sound-e6886725945a09d3f286d35b313e23c94c2a091b.zip |
Move the triggering of the volume up/down notification into set_volume().
-rw-r--r-- | src/volume-control.vala | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala index 5a16621..6148b79 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -310,12 +310,8 @@ public class VolumeControl : Object private void set_volume_success_cb (Context c, int success) { - if ((bool)success) { + if ((bool)success) volume_changed (_volume); - _notification.update ("Volume", "", "audio-volume-medium"); - _notification.set_hint ("value", _volume); - _notification.show (); - } } private void sink_info_set_volume_cb (Context c, SinkInfo? i, int eol) @@ -353,8 +349,20 @@ public class VolumeControl : Object public void set_volume (double volume) { - if (set_volume_internal (volume)) + if (set_volume_internal (volume)) { + if (_volume == 0.0) + _notification.update ("Volume", "", "audio-volume-muted"); + if (_volume > 0.0 && _volume <= 0.33) + _notification.update ("Volume", "", "audio-volume-low"); + if (_volume > 0.33 && _volume <= 0.66) + _notification.update ("Volume", "", "audio-volume-medium"); + if (_volume > 0.66 && _volume <= 1.0) + _notification.update ("Volume", "", "audio-volume-high"); + _notification.set_hint ("value", _volume * 100.0); + _notification.show (); + start_local_volume_timer(); + } } void set_mic_volume_success_cb (Context c, int success) |