aboutsummaryrefslogtreecommitdiff
path: root/src/volume-warning.vala
diff options
context:
space:
mode:
authorcharles kerr <charlesk@canonical.com>2015-12-19 23:09:49 -0600
committercharles kerr <charlesk@canonical.com>2015-12-19 23:09:49 -0600
commita5d0e139cbd332419d2e82f45e8656462e39d029 (patch)
tree89ba5668385bb26e9ec193635f3bebd3884c1989 /src/volume-warning.vala
parentca18e99ee04c10fbc0baff2e836278f4f8817af0 (diff)
downloadayatana-indicator-sound-a5d0e139cbd332419d2e82f45e8656462e39d029.tar.gz
ayatana-indicator-sound-a5d0e139cbd332419d2e82f45e8656462e39d029.tar.bz2
ayatana-indicator-sound-a5d0e139cbd332419d2e82f45e8656462e39d029.zip
remove 'high_volume' property from volume-control
Diffstat (limited to 'src/volume-warning.vala')
-rw-r--r--src/volume-warning.vala10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/volume-warning.vala b/src/volume-warning.vala
index 5809f61..423f129 100644
--- a/src/volume-warning.vala
+++ b/src/volume-warning.vala
@@ -30,6 +30,9 @@ public class VolumeWarning : VolumeControl
// true if the warning dialog is currently active
public bool active { get; public set; default = false; }
+ // true iff we're playing unapproved loud multimedia over headphones
+ public bool high_volume { get; protected set; default = false; }
+
// FIXME: this is temporarily necessary while bootstrapping this
// code because VolumeWarning is still subclassed from VolumeControl,
// but TBH we don't need any concept of mute here.
@@ -638,7 +641,6 @@ public class VolumeWarning : VolumeControl
/** HIGH VOLUME PROPERTY **/
- private bool _high_volume = false;
public bool ignore_high_volume {
get {
if (_ignore_warning_this_time) {
@@ -650,10 +652,6 @@ public class VolumeWarning : VolumeControl
}
set { }
}
- public override bool high_volume {
- get { return this._high_volume; }
- private set { this._high_volume = value; }
- }
private void init_high_volume() {
_options.loud_changed.connect(() => update_high_volume());
update_high_volume();
@@ -674,7 +672,7 @@ public class VolumeWarning : VolumeControl
&& (stream == "multimedia");
}
- public override void clamp_to_high_volume() {
+ public void clamp_to_high_volume() {
if (_high_volume && _options.is_loud(_volume)) {
var vol = new VolumeControl.Volume();
vol.volume = _volume.volume.clamp(0, volume_to_double(_options.loud_volume()));