aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control.vala
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-01-05 15:08:24 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2016-01-05 15:08:24 +0000
commitde52ce976216ffb25bfb2c3ff3729b6fcf2ec9f4 (patch)
treeb0b4a1fa061be766576e663ac67c63fd2b445563 /src/volume-control.vala
parente1feb61a02a1353b42fcd85ced8e0489c711a451 (diff)
parent6f4f8c2b9caee08499a3a9ee3fd434c2b6a0f3ca (diff)
downloadayatana-indicator-sound-de52ce976216ffb25bfb2c3ff3729b6fcf2ec9f4.tar.gz
ayatana-indicator-sound-de52ce976216ffb25bfb2c3ff3729b6fcf2ec9f4.tar.bz2
ayatana-indicator-sound-de52ce976216ffb25bfb2c3ff3729b6fcf2ec9f4.zip
Adds an action to signal the UI to sync the current volume when we are waiting for the user to confirm or reject the high volume notification. Fixes: #1512798, #1520548
Approved by: PS Jenkins bot, Charles Kerr, Nick Dedekind
Diffstat (limited to 'src/volume-control.vala')
-rw-r--r--src/volume-control.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala
index 30dcfcf..90fc325 100644
--- a/src/volume-control.vala
+++ b/src/volume-control.vala
@@ -49,11 +49,13 @@ public abstract class VolumeControl : Object
public virtual bool ready { get { return false; } set { } }
public virtual bool active_mic { get { return false; } set { } }
public virtual bool high_volume { get { return false; } protected set { } }
+ public virtual bool ignore_high_volume { get { return false; } protected set { } }
public virtual bool below_warning_volume { get { return false; } protected set { } }
public virtual bool mute { get { return false; } }
public virtual bool is_playing { get { return false; } }
public virtual VolumeControl.ActiveOutput active_output { get { return VolumeControl.ActiveOutput.SPEAKERS; } }
private Volume _volume;
+ private double _pre_clamp_volume;
public virtual Volume volume { get { return _volume; } set { } }
public virtual double mic_volume { get { return 0.0; } set { } }
public virtual double max_volume { get { return 1.0; } protected set { } }
@@ -70,6 +72,11 @@ public abstract class VolumeControl : Object
v.volume = unclamped.clamp (0.0, this.max_volume);
v.reason = reason;
this.volume = v;
+ _pre_clamp_volume = unclamped;
+ }
+
+ public double get_pre_clamped_volume () {
+ return _pre_clamp_volume;
}
public signal void active_output_changed (VolumeControl.ActiveOutput active_output);