diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-08-07 22:35:55 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-08-07 22:35:55 +0000 |
commit | 6f29148f8d0379684e6d6e53ce6e0095bed0c923 (patch) | |
tree | 5bad24f90f1ee3164b1c14f26ab27abc72f9786e /src/volume-control-pulse.vala | |
parent | 5a30dde1f09e55729ec0b0b7ed451f15c6e635fa (diff) | |
parent | 4b736bd0c19e85674add330ee6a00ddd6deb512a (diff) | |
download | ayatana-indicator-sound-6f29148f8d0379684e6d6e53ce6e0095bed0c923.tar.gz ayatana-indicator-sound-6f29148f8d0379684e6d6e53ce6e0095bed0c923.tar.bz2 ayatana-indicator-sound-6f29148f8d0379684e6d6e53ce6e0095bed0c923.zip |
Revised UI volume warnings to comply with EU requirements. Fixes: #1481913
Approved by: PS Jenkins bot, Ted Gould
Diffstat (limited to 'src/volume-control-pulse.vala')
-rw-r--r-- | src/volume-control-pulse.vala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 3d4d113..d3e93c5 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -44,6 +44,7 @@ public class VolumeControlPulse : VolumeControl private bool _is_playing = false; private VolumeControl.Volume _volume = new VolumeControl.Volume(); private double _mic_volume = 0.0; + private Settings _settings = new Settings ("com.canonical.indicator.sound"); /* Used by the pulseaudio stream restore extension */ private DBusConnection _pconn; @@ -95,7 +96,14 @@ public class VolumeControlPulse : VolumeControl /** true when high volume warnings should be shown */ public override bool high_volume { get { - return this._volume.volume > 0.75 && _active_port_headphone && stream == "multimedia"; + if (!_active_port_headphone) { + return false; + } + if (stream != "multimedia") { + return false; + } + var high_volume_level = this._settings.get_double("high-volume-level"); + return this._volume.volume > high_volume_level; } } |