From 57f30a3dfc759826d7c19d69e46cb10d55e91837 Mon Sep 17 00:00:00 2001 From: charles kerr Date: Sat, 19 Dec 2015 22:18:27 -0600 Subject: remove 'ready' property from volume-warning --- src/volume-control-pulse.vala | 5 +---- src/volume-control.vala | 2 +- src/volume-warning.vala | 13 ++++++------- 3 files changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 22c3ee4..82c4791 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -86,9 +86,6 @@ public class VolumeControlPulse : VolumeControl private bool _active_port_headphone = false; private VolumeControl.ActiveOutput _active_output = VolumeControl.ActiveOutput.SPEAKERS; - /** true when connected to the pulse server */ - public override bool ready { get; private set; } - /** true when a microphone is active **/ public override bool active_mic { get; private set; default = false; } @@ -480,7 +477,7 @@ public class VolumeControlPulse : VolumeControl c.set_subscribe_callback (context_events_cb); update_sink (); update_source (); - this.ready = true; + this.ready = true; // true because we're connected to the pulse server break; case Context.State.FAILED: diff --git a/src/volume-control.vala b/src/volume-control.vala index f1c74a0..1b4288c 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -52,7 +52,7 @@ public abstract class VolumeControl : Object } public virtual string stream { get { return ""; } } - public virtual bool ready { get { return false; } set { } } + public bool ready { get; protected set; default = false; } public virtual bool active_mic { get { return false; } set { } } public virtual bool high_volume { get { return false; } protected set { } } public virtual bool mute { get { return false; } } diff --git a/src/volume-warning.vala b/src/volume-warning.vala index 2bb4dae..2a8c79f 100644 --- a/src/volume-warning.vala +++ b/src/volume-warning.vala @@ -82,9 +82,6 @@ public class VolumeWarning : VolumeControl private bool _active_port_headphone = false; private VolumeControl.ActiveOutput _active_output = VolumeControl.ActiveOutput.SPEAKERS; - /** true when connected to the pulse server */ - public override bool ready { get; private set; } - /** true when a microphone is active **/ public override bool active_mic { get; private set; default = false; } @@ -455,6 +452,8 @@ public class VolumeWarning : VolumeControl this.active_mic = true; } + private bool _connected_to_pulse = false; + private void context_state_callback (Context c) { switch (c.get_state ()) { @@ -472,7 +471,7 @@ public class VolumeWarning : VolumeControl c.set_subscribe_callback (context_events_cb); update_sink (); update_source (); - this.ready = true; + _connected_to_pulse = true; break; case Context.State.FAILED: @@ -482,7 +481,7 @@ public class VolumeWarning : VolumeControl break; default: - this.ready = false; + _connected_to_pulse = false; break; } } @@ -496,10 +495,10 @@ public class VolumeWarning : VolumeControl void reconnect_to_pulse () { - if (this.ready) { + if (_connected_to_pulse) { this.context.disconnect (); this.context = null; - this.ready = false; + _connected_to_pulse = false; } var props = new Proplist (); -- cgit v1.2.3