aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/volume-control.vala')
-rw-r--r--src/volume-control.vala23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala
index 2f12b7f..3431ac3 100644
--- a/src/volume-control.vala
+++ b/src/volume-control.vala
@@ -28,6 +28,18 @@ public abstract class VolumeControl : Object
VOLUME_STREAM_CHANGE
}
+ public enum ActiveOutput {
+ SPEAKERS,
+ HEADPHONES,
+ BLUETOOTH_HEADPHONES,
+ BLUETOOTH_SPEAKER,
+ USB_SPEAKER,
+ USB_HEADPHONES,
+ HDMI_SPEAKER,
+ HDMI_HEADPHONES,
+ CALL_MODE
+ }
+
public class Volume : Object {
public double volume;
public VolumeReasons reason;
@@ -37,9 +49,12 @@ 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 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;
private double _max_volume = 1.0;
public virtual Volume volume { get { return _volume; } set { } }
public virtual double mic_volume { get { return 0.0; } set { } }
@@ -48,6 +63,7 @@ public abstract class VolumeControl : Object
public virtual bool high_volume_approved { get { return false; } protected set { } }
public virtual void approve_high_volume() { }
public virtual void clamp_to_high_volume() { }
+ public virtual void set_warning_volume() { }
public abstract void set_mute (bool mute);
@@ -56,5 +72,12 @@ 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);
}