diff options
author | charles kerr <charlesk@canonical.com> | 2015-12-28 21:03:06 -0600 |
---|---|---|
committer | charles kerr <charlesk@canonical.com> | 2015-12-28 21:03:06 -0600 |
commit | c22c2005b594f2fea179222a9bd55c5d4bcb6227 (patch) | |
tree | 8ce890987859f5d9c3deea407f8fb5e55e5ba3e0 /src/volume-warning.vala | |
parent | a1714e77e44c9de2f8dd1f236ba9c39c4d5fa11c (diff) | |
download | ayatana-indicator-sound-c22c2005b594f2fea179222a9bd55c5d4bcb6227.tar.gz ayatana-indicator-sound-c22c2005b594f2fea179222a9bd55c5d4bcb6227.tar.bz2 ayatana-indicator-sound-c22c2005b594f2fea179222a9bd55c5d4bcb6227.zip |
make tab damage consistent
Diffstat (limited to 'src/volume-warning.vala')
-rw-r--r-- | src/volume-warning.vala | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/volume-warning.vala b/src/volume-warning.vala index 8f2f751..5af7972 100644 --- a/src/volume-warning.vala +++ b/src/volume-warning.vala @@ -180,24 +180,24 @@ public class VolumeWarning : Object c.set_subscribe_callback (context_events_cb); c.subscribe (PulseAudio.Context.SubscriptionMask.SINK_INPUT); pulse_update_sink_inputs(); - break; + break; - case Context.State.FAILED: - case Context.State.TERMINATED: + case Context.State.FAILED: + case Context.State.TERMINATED: pulse_reconnect_soon(); - break; + break; - default: - break; - } - } + default: + break; + } + } private void pulse_disconnect() { - if (_pulse_context != null) { - _pulse_context.disconnect (); - _pulse_context = null; - } + if (_pulse_context != null) { + _pulse_context.disconnect (); + _pulse_context = null; + } } private void pulse_reconnect_soon () @@ -206,38 +206,38 @@ public class VolumeWarning : Object _pulse_reconnect_timer = Timeout.add_seconds (2, pulse_reconnect_timeout); } - private void pulse_reconnect_soon_cancel() + private void pulse_reconnect_soon_cancel() + { + if (_pulse_reconnect_timer != 0) { + Source.remove(_pulse_reconnect_timer); + _pulse_reconnect_timer = 0; + } + } + + private bool pulse_reconnect_timeout () + { + _pulse_reconnect_timer = 0; + pulse_reconnect (); + return false; // G_SOURCE_REMOVE + } + + void pulse_reconnect () { - if (_pulse_reconnect_timer != 0) { - Source.remove(_pulse_reconnect_timer); - _pulse_reconnect_timer = 0; - } - } - - private bool pulse_reconnect_timeout () - { - _pulse_reconnect_timer = 0; - pulse_reconnect (); - return false; // G_SOURCE_REMOVE - } - - void pulse_reconnect () - { pulse_disconnect(); - var props = new Proplist (); - props.sets (Proplist.PROP_APPLICATION_NAME, "Ubuntu Audio Settings"); - props.sets (Proplist.PROP_APPLICATION_ID, "com.canonical.settings.sound"); - props.sets (Proplist.PROP_APPLICATION_ICON_NAME, "multimedia-volume-control"); - props.sets (Proplist.PROP_APPLICATION_VERSION, "0.1"); + var props = new Proplist (); + props.sets (Proplist.PROP_APPLICATION_NAME, "Ubuntu Audio Settings"); + props.sets (Proplist.PROP_APPLICATION_ID, "com.canonical.settings.sound"); + props.sets (Proplist.PROP_APPLICATION_ICON_NAME, "multimedia-volume-control"); + props.sets (Proplist.PROP_APPLICATION_VERSION, "0.1"); - _pulse_context = new PulseAudio.Context (_pgloop.get_api(), null, props); - _pulse_context.set_state_callback (pulse_context_state_callback); + _pulse_context = new PulseAudio.Context (_pgloop.get_api(), null, props); + _pulse_context.set_state_callback (pulse_context_state_callback); - var server_string = Environment.get_variable("PULSE_SERVER"); - if (_pulse_context.connect(server_string, Context.Flags.NOFAIL, null) < 0) - warning( "pa_context_connect() failed: %s\n", PulseAudio.strerror(_pulse_context.errno())); - } + var server_string = Environment.get_variable("PULSE_SERVER"); + if (_pulse_context.connect(server_string, Context.Flags.NOFAIL, null) < 0) + warning( "pa_context_connect() failed: %s\n", PulseAudio.strerror(_pulse_context.errno())); + } /// |