From a5d0e139cbd332419d2e82f45e8656462e39d029 Mon Sep 17 00:00:00 2001 From: charles kerr Date: Sat, 19 Dec 2015 23:09:49 -0600 Subject: remove 'high_volume' property from volume-control --- src/volume-control-pulse.vala | 47 ------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/volume-control-pulse.vala') diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 8c09a6b..56cfba7 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -102,18 +102,11 @@ public class VolumeControlPulse : VolumeControl _mute_cancellable = new Cancellable (); _volume_cancellable = new Cancellable (); - init_all_properties(); - setup_accountsservice.begin (); this.reconnect_to_pulse (); } - private void init_all_properties() - { - init_high_volume(); - } - ~VolumeControlPulse () { stop_all_timers(); @@ -252,7 +245,6 @@ public class VolumeControlPulse : VolumeControl (active_output_now != VolumeControl.ActiveOutput.CALL_MODE && active_output_before != VolumeControl.ActiveOutput.CALL_MODE)) { this.active_output_changed (active_output_now); - update_high_volume(); } if (_pulse_use_stream_restore == false && @@ -686,45 +678,6 @@ public class VolumeControlPulse : VolumeControl && volume_changed) { start_local_volume_timer(); } - - update_high_volume(); - } - } - - /** HIGH VOLUME PROPERTY **/ - - private bool _high_volume = false; - 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(); - } - private void update_high_volume() { - var new_high_volume = calculate_high_volume(); - if (high_volume != new_high_volume) { - debug("changing high_volume from %d to %d", (int)high_volume, (int)new_high_volume); - high_volume = new_high_volume; - } - } - private bool calculate_high_volume() { - return calculate_high_volume_from_volume(_volume.volume); - } - private bool calculate_high_volume_from_volume(double volume) { - return _active_port_headphone - && _options.is_loud(_volume) - && (stream == "multimedia"); - } - - public override 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())); - vol.reason = _volume.reason; - debug("Clamping from %f down to %f", _volume.volume, vol.volume); - volume = vol; } } -- cgit v1.2.3