aboutsummaryrefslogtreecommitdiff
path: root/src/volume-warning.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-03-01 10:41:41 +0100
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-03-01 10:41:41 +0100
commitf23ef0a3d5d2195d3174643bbd9df0bbe3b59ad2 (patch)
tree1e5f856d7fbc5b5050313c2e5e8ff73125d521ac /src/volume-warning.vala
parent0fe4ec98a470a992eee9f8ed7e404fe767a82076 (diff)
downloadayatana-indicator-sound-f23ef0a3d5d2195d3174643bbd9df0bbe3b59ad2.tar.gz
ayatana-indicator-sound-f23ef0a3d5d2195d3174643bbd9df0bbe3b59ad2.tar.bz2
ayatana-indicator-sound-f23ef0a3d5d2195d3174643bbd9df0bbe3b59ad2.zip
Set warning volume to the maximum allowed when the user presses cancel
Diffstat (limited to 'src/volume-warning.vala')
-rw-r--r--src/volume-warning.vala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/volume-warning.vala b/src/volume-warning.vala
index 3c0f1e6..d43d34c 100644
--- a/src/volume-warning.vala
+++ b/src/volume-warning.vala
@@ -116,7 +116,9 @@ public abstract class VolumeWarning : Object
&& multimedia_active
&& !approved
&& (multimedia_volume != PulseAudio.Volume.INVALID)
- && (multimedia_volume >= _options.loud_volume);
+ // from the sound specs:
+ // "Whenever you increase volume,..., such that acoustic output would be MORE than 85 dB
+ && (multimedia_volume > _options.loud_volume);
if (high_volume != newval) {
debug ("changing high_volume from %d to %d", (int)high_volume, (int)newval);
@@ -198,8 +200,10 @@ public abstract class VolumeWarning : Object
_notification.show ();
this.active = true;
- // lower the volume to just under the warning level
- sound_system_set_multimedia_volume (_options.loud_volume-1);
+ // lower the volume to just the warning level
+ // from the sound specs:
+ // "Whenever you increase volume,..., such that acoustic output would be MORE than 85 dB
+ sound_system_set_multimedia_volume (_options.loud_volume);
}
private void on_user_response (IndicatorSound.WarnNotification.Response response) {