diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-08-10 23:48:37 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2015-08-10 23:48:37 -0500 |
commit | 20f6bd10f17dfeecea93d03873e3b74ecef54782 (patch) | |
tree | 04af30fa7f36ea0f2a971ec1c73f1a4a9ec89187 /src/volume-control.vala | |
parent | 4b736bd0c19e85674add330ee6a00ddd6deb512a (diff) | |
download | ayatana-indicator-sound-20f6bd10f17dfeecea93d03873e3b74ecef54782.tar.gz ayatana-indicator-sound-20f6bd10f17dfeecea93d03873e3b74ecef54782.tar.bz2 ayatana-indicator-sound-20f6bd10f17dfeecea93d03873e3b74ecef54782.zip |
huge pile of diff that consolidates pulse-specific audio work into volume-control-pulse. Work in progress. Promising but currently ugly.
Diffstat (limited to 'src/volume-control.vala')
-rw-r--r-- | src/volume-control.vala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/volume-control.vala b/src/volume-control.vala index 3f1c799..36d7083 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -36,12 +36,23 @@ public abstract class VolumeControl : Object public virtual string stream { get { return ""; } } 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; } } + public virtual bool high_volume { get { return false; } protected set { } } public virtual bool mute { get { return false; } } public virtual bool is_playing { get { return false; } } private Volume _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; set; } + + public virtual bool high_volume_approved { get { return false; } protected set { } } + public virtual void approve_high_volume() { } public abstract void set_mute (bool mute); + + public void set_volume_clamp (double unclamped, VolumeControl.VolumeReasons reason) { + var v = new VolumeControl.Volume(); + v.volume = unclamped.clamp (0.0, this.max_volume); + v.reason = reason; + this.volume = v; + } } |