From 3297337f253efc9ae15b07b78d3e1e9a0611e5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mirco=20M=C3=BCller?= Date: Fri, 19 Sep 2014 19:41:50 +0200 Subject: Trigger synchronous notification upon every volume-change attempt, thus the user gets to see visual and audible feedback every time a volume-key is pressed. --- src/volume-control.vala | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/volume-control.vala b/src/volume-control.vala index 8de5d2f..33ba878 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -76,7 +76,6 @@ public class VolumeControl : Object _notification.set_hint ("value", 0); _notification.set_hint ("x-canonical-private-synchronous", "true"); _notification.set_hint ("x-canonical-non-shaped-icon", "true"); - _notification.set_hint ("sound-file", "/usr/share/sounds/ubuntu/stereo/message.ogg"); setup_accountsservice.begin (); @@ -350,18 +349,19 @@ public class VolumeControl : Object public void set_volume (double 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 (); + 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.set_hint ("sound-file", "/usr/share/sounds/ubuntu/stereo/message.ogg"); + _notification.show (); + if (set_volume_internal (volume)) { start_local_volume_timer(); } } -- cgit v1.2.3