aboutsummaryrefslogtreecommitdiff
path: root/src/volume-control-pulse.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-control-pulse.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-control-pulse.vala')
-rw-r--r--src/volume-control-pulse.vala47
1 files changed, 0 insertions, 47 deletions
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;
}
}