From 7666c62a307e3cb23994add9f58c8d03478f152f Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Thu, 7 Jan 2016 01:00:27 +0100 Subject: Change added/removed signal argument from name to object --- backends/alsa/alsa-backend.c | 23 ++++++++------------ backends/alsa/alsa-device.c | 25 +++++---------------- backends/alsa/alsa-stream.c | 30 ++++++++------------------ backends/oss/oss-backend.c | 23 ++++++++------------ backends/oss/oss-device.c | 15 +++---------- backends/oss/oss-stream.c | 12 ++++------- backends/pulse/pulse-backend.c | 49 +++++++++++++++++++++--------------------- backends/pulse/pulse-device.c | 12 ++++++----- backends/pulse/pulse-sink.c | 12 ++++------- backends/pulse/pulse-source.c | 12 ++++------- 10 files changed, 79 insertions(+), 134 deletions(-) (limited to 'backends') diff --git a/backends/alsa/alsa-backend.c b/backends/alsa/alsa-backend.c index 45bee15..6445057 100644 --- a/backends/alsa/alsa-backend.c +++ b/backends/alsa/alsa-backend.c @@ -79,7 +79,7 @@ static void remove_device_by_list_item (AlsaBackend *alsa, GList *item); static void remove_stream (AlsaBackend *alsa, - const gchar *name); + MateMixerStream *stream); static void select_default_input_stream (AlsaBackend *alsa); static void select_default_output_stream (AlsaBackend *alsa); @@ -401,7 +401,7 @@ add_device (AlsaBackend *alsa, AlsaDevice *device) g_signal_emit_by_name (G_OBJECT (alsa), "device-added", - mate_mixer_device_get_name (MATE_MIXER_DEVICE (device))); + MATE_MIXER_DEVICE (device)); /* Load the device elements after emitting device-added, because the load * function will most likely emit stream-added on the device and backend */ @@ -451,29 +451,24 @@ remove_device_by_list_item (AlsaBackend *alsa, GList *item) g_hash_table_remove (alsa->priv->devices_ids, ALSA_DEVICE_GET_ID (device)); - /* The list may have been invalidated by device signals */ - free_stream_list (alsa); - g_signal_emit_by_name (G_OBJECT (alsa), "device-removed", - mate_mixer_device_get_name (MATE_MIXER_DEVICE (device))); + MATE_MIXER_DEVICE (device)); g_object_unref (device); } static void -remove_stream (AlsaBackend *alsa, const gchar *name) +remove_stream (AlsaBackend *alsa, MateMixerStream *stream) { - MateMixerStream *stream; + MateMixerStream *def; - stream = mate_mixer_backend_get_default_input_stream (MATE_MIXER_BACKEND (alsa)); - - if (stream != NULL && strcmp (mate_mixer_stream_get_name (stream), name) == 0) + def = mate_mixer_backend_get_default_input_stream (MATE_MIXER_BACKEND (alsa)); + if (def == stream) select_default_input_stream (alsa); - stream = mate_mixer_backend_get_default_output_stream (MATE_MIXER_BACKEND (alsa)); - - if (stream != NULL && strcmp (mate_mixer_stream_get_name (stream), name) == 0) + def = mate_mixer_backend_get_default_output_stream (MATE_MIXER_BACKEND (alsa)); + if (def == stream) select_default_output_stream (alsa); } diff --git a/backends/alsa/alsa-device.c b/backends/alsa/alsa-device.c index fb12447..2064f79 100644 --- a/backends/alsa/alsa-device.c +++ b/backends/alsa/alsa-device.c @@ -338,27 +338,21 @@ alsa_device_close (AlsaDevice *device) /* Make each stream remove its controls and switches */ if (alsa_stream_has_controls_or_switches (device->priv->input) == TRUE) { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (device->priv->input)); - alsa_stream_remove_all (device->priv->input); free_stream_list (device); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", - name); + MATE_MIXER_STREAM (device->priv->input)); } if (alsa_stream_has_controls_or_switches (device->priv->output) == TRUE) { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (device->priv->output)); - alsa_stream_remove_all (device->priv->output); free_stream_list (device); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", - name); + MATE_MIXER_STREAM (device->priv->output)); } close_mixer (device); @@ -481,16 +475,13 @@ add_element (AlsaDevice *device, AlsaStream *stream, AlsaElement *element) } if (add_stream == TRUE) { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream)); - free_stream_list (device); /* Pretend the stream has just been created now that we have added * the first control */ g_signal_emit_by_name (G_OBJECT (device), "stream-added", - name); + MATE_MIXER_STREAM (stream)); } el = alsa_element_get_snd_element (element); @@ -764,26 +755,20 @@ remove_elements_by_name (AlsaDevice *device, const gchar *name) if (alsa_stream_remove_elements (device->priv->input, name) == TRUE) { /* Removing last stream element "removes" the stream */ if (alsa_stream_has_controls_or_switches (device->priv->input) == FALSE) { - const gchar *stream_name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (device->priv->input)); - free_stream_list (device); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", - stream_name); + MATE_MIXER_STREAM (device->priv->input)); } } if (alsa_stream_remove_elements (device->priv->output, name) == TRUE) { /* Removing last stream element "removes" the stream */ if (alsa_stream_has_controls_or_switches (device->priv->output) == FALSE) { - const gchar *stream_name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (device->priv->output)); - free_stream_list (device); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", - stream_name); + MATE_MIXER_STREAM (device->priv->output)); } } } diff --git a/backends/alsa/alsa-stream.c b/backends/alsa/alsa-stream.c index fc72f65..7e9c89f 100644 --- a/backends/alsa/alsa-stream.c +++ b/backends/alsa/alsa-stream.c @@ -113,19 +113,15 @@ alsa_stream_new (const gchar *name, void alsa_stream_add_control (AlsaStream *stream, AlsaStreamControl *control) { - const gchar *name; - g_return_if_fail (ALSA_IS_STREAM (stream)); g_return_if_fail (ALSA_IS_STREAM_CONTROL (control)); - name = mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (control)); - stream->priv->controls = g_list_append (stream->priv->controls, g_object_ref (control)); g_signal_emit_by_name (G_OBJECT (stream), "control-added", - name); + MATE_MIXER_STREAM_CONTROL (control)); if (alsa_stream_has_default_control (stream) == FALSE) alsa_stream_set_default_control (stream, control); @@ -134,38 +130,30 @@ alsa_stream_add_control (AlsaStream *stream, AlsaStreamControl *control) void alsa_stream_add_switch (AlsaStream *stream, AlsaSwitch *swtch) { - const gchar *name; - g_return_if_fail (ALSA_IS_STREAM (stream)); g_return_if_fail (ALSA_IS_SWITCH (swtch)); - name = mate_mixer_switch_get_name (MATE_MIXER_SWITCH (swtch)); - stream->priv->switches = g_list_append (stream->priv->switches, g_object_ref (swtch)); g_signal_emit_by_name (G_OBJECT (stream), "switch-added", - name); + MATE_MIXER_STREAM_SWITCH (swtch)); } void alsa_stream_add_toggle (AlsaStream *stream, AlsaToggle *toggle) { - const gchar *name; - g_return_if_fail (ALSA_IS_STREAM (stream)); g_return_if_fail (ALSA_IS_TOGGLE (toggle)); - name = mate_mixer_switch_get_name (MATE_MIXER_SWITCH (toggle)); - /* Toggle is MateMixerSwitch, but not AlsaSwitch */ stream->priv->switches = g_list_append (stream->priv->switches, g_object_ref (toggle)); g_signal_emit_by_name (G_OBJECT (stream), "switch-added", - name); + MATE_MIXER_STREAM_SWITCH (toggle)); } gboolean @@ -285,7 +273,7 @@ alsa_stream_remove_elements (AlsaStream *stream, const gchar *name) g_signal_emit_by_name (G_OBJECT (stream), "control-removed", - mate_mixer_stream_control_get_name (control)); + control); g_object_unref (control); removed = TRUE; @@ -293,14 +281,14 @@ alsa_stream_remove_elements (AlsaStream *stream, const gchar *name) item = g_list_find_custom (stream->priv->switches, name, compare_switch_name); if (item != NULL) { - MateMixerSwitch *swtch = MATE_MIXER_SWITCH (item->data); + MateMixerStreamSwitch *swtch = MATE_MIXER_STREAM_SWITCH (item->data); alsa_element_close (ALSA_ELEMENT (swtch)); stream->priv->switches = g_list_delete_link (stream->priv->switches, item); g_signal_emit_by_name (G_OBJECT (stream), "switch-removed", - mate_mixer_switch_get_name (swtch)); + swtch); g_object_unref (swtch); removed = TRUE; @@ -327,7 +315,7 @@ alsa_stream_remove_all (AlsaStream *stream) stream->priv->controls = g_list_delete_link (stream->priv->controls, list); g_signal_emit_by_name (G_OBJECT (stream), "control-removed", - mate_mixer_stream_control_get_name (control)); + control); g_object_unref (control); list = next; @@ -339,7 +327,7 @@ alsa_stream_remove_all (AlsaStream *stream) /* Remove all stream switches */ list = stream->priv->switches; while (list != NULL) { - MateMixerSwitch *swtch = MATE_MIXER_SWITCH (list->data); + MateMixerStreamSwitch *swtch = MATE_MIXER_STREAM_SWITCH (list->data); GList *next = list->next; alsa_element_close (ALSA_ELEMENT (swtch)); @@ -347,7 +335,7 @@ alsa_stream_remove_all (AlsaStream *stream) stream->priv->switches = g_list_delete_link (stream->priv->switches, list); g_signal_emit_by_name (G_OBJECT (stream), "switch-removed", - mate_mixer_switch_get_name (swtch)); + swtch); g_object_unref (swtch); list = next; diff --git a/backends/oss/oss-backend.c b/backends/oss/oss-backend.c index 9726570..159107d 100644 --- a/backends/oss/oss-backend.c +++ b/backends/oss/oss-backend.c @@ -96,7 +96,7 @@ static void remove_device_by_list_item (OssBackend *oss, GList *item); static void remove_stream (OssBackend *oss, - const gchar *name); + MateMixerStream *stream); static void select_default_input_stream (OssBackend *oss); static void select_default_output_stream (OssBackend *oss); @@ -502,7 +502,7 @@ add_device (OssBackend *oss, OssDevice *device) g_signal_emit_by_name (G_OBJECT (oss), "device-added", - mate_mixer_device_get_name (MATE_MIXER_DEVICE (device))); + MATE_MIXER_DEVICE (device)); /* Load the device elements after emitting device-added, because the load * function will most likely emit stream-added on the device and backend */ @@ -558,29 +558,24 @@ remove_device_by_list_item (OssBackend *oss, GList *item) oss->priv->default_device = NULL; } - /* The list may have been invalidated by device signals */ - free_stream_list (oss); - g_signal_emit_by_name (G_OBJECT (oss), "device-removed", - mate_mixer_device_get_name (MATE_MIXER_DEVICE (device))); + MATE_MIXER_DEVICE (device)); g_object_unref (device); } static void -remove_stream (OssBackend *oss, const gchar *name) +remove_stream (OssBackend *oss, MateMixerStream *stream) { - MateMixerStream *stream; + MateMixerStream *def; - stream = mate_mixer_backend_get_default_input_stream (MATE_MIXER_BACKEND (oss)); - - if (stream != NULL && strcmp (mate_mixer_stream_get_name (stream), name) == 0) + def = mate_mixer_backend_get_default_input_stream (MATE_MIXER_BACKEND (oss)); + if (def == stream) select_default_input_stream (oss); - stream = mate_mixer_backend_get_default_output_stream (MATE_MIXER_BACKEND (oss)); - - if (stream != NULL && strcmp (mate_mixer_stream_get_name (stream), name) == 0) + def = mate_mixer_backend_get_default_output_stream (MATE_MIXER_BACKEND (oss)); + if (def == stream) select_default_output_stream (oss); } diff --git a/backends/oss/oss-device.c b/backends/oss/oss-device.c index 70f46e6..8398aed 100644 --- a/backends/oss/oss-device.c +++ b/backends/oss/oss-device.c @@ -362,29 +362,23 @@ oss_device_close (OssDevice *device) /* Make each stream remove its controls and switch */ if (device->priv->input != NULL) { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (device->priv->input)); - oss_stream_remove_all (device->priv->input); free_stream_list (device); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", - name); + MATE_MIXER_STREAM (device->priv->input)); g_clear_object (&device->priv->input); } if (device->priv->output != NULL) { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (device->priv->output)); - oss_stream_remove_all (device->priv->output); free_stream_list (device); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", - name); + MATE_MIXER_STREAM (device->priv->output)); g_clear_object (&device->priv->output); } @@ -596,16 +590,13 @@ read_mixer_devices (OssDevice *device) continue; if (oss_stream_has_controls (stream) == FALSE) { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream)); - free_stream_list (device); /* Pretend the stream has just been created now that we are adding * the first control */ g_signal_emit_by_name (G_OBJECT (device), "stream-added", - name); + MATE_MIXER_STREAM (stream)); } g_debug ("Adding device %s control %s", diff --git a/backends/oss/oss-stream.c b/backends/oss/oss-stream.c index f094537..7727dad 100644 --- a/backends/oss/oss-stream.c +++ b/backends/oss/oss-stream.c @@ -112,19 +112,15 @@ oss_stream_new (const gchar *name, void oss_stream_add_control (OssStream *stream, OssStreamControl *control) { - const gchar *name; - g_return_if_fail (OSS_IS_STREAM (stream)); g_return_if_fail (OSS_IS_STREAM_CONTROL (control)); - name = mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (control)); - stream->priv->controls = g_list_append (stream->priv->controls, g_object_ref (control)); g_signal_emit_by_name (G_OBJECT (stream), "control-added", - name); + MATE_MIXER_STREAM_CONTROL (control)); } void @@ -223,7 +219,7 @@ oss_stream_set_switch_data (OssStream *stream, gint fd, GList *options) stream->priv->switches = g_list_prepend (NULL, g_object_ref (stream->priv->swtch)); g_signal_emit_by_name (G_OBJECT (stream), "switch-added", - OSS_STREAM_SWITCH_NAME); + MATE_MIXER_STREAM_SWITCH (stream->priv->swtch)); } void @@ -243,7 +239,7 @@ oss_stream_remove_all (OssStream *stream) stream->priv->controls = g_list_delete_link (stream->priv->controls, list); g_signal_emit_by_name (G_OBJECT (stream), "control-removed", - mate_mixer_stream_control_get_name (control)); + control); g_object_unref (control); list = next; @@ -260,7 +256,7 @@ oss_stream_remove_all (OssStream *stream) g_signal_emit_by_name (G_OBJECT (stream), "switch-removed", - OSS_STREAM_SWITCH_NAME); + MATE_MIXER_STREAM_SWITCH (stream->priv->swtch)); g_clear_object (&stream->priv->swtch); } diff --git a/backends/pulse/pulse-backend.c b/backends/pulse/pulse-backend.c index 9b483b9..88926be 100644 --- a/backends/pulse/pulse-backend.c +++ b/backends/pulse/pulse-backend.c @@ -779,7 +779,7 @@ on_connection_card_info (PulseConnection *connection, free_list_devices (pulse); g_signal_emit_by_name (G_OBJECT (pulse), "device-added", - mate_mixer_device_get_name (MATE_MIXER_DEVICE (device))); + MATE_MIXER_DEVICE (device)); } else pulse_device_update (device, info); } @@ -790,21 +790,20 @@ on_connection_card_removed (PulseConnection *connection, PulseBackend *pulse) { PulseDevice *device; - gchar *name; device = g_hash_table_lookup (pulse->priv->devices, GUINT_TO_POINTER (index)); if G_UNLIKELY (device == NULL) return; - name = g_strdup (mate_mixer_device_get_name (MATE_MIXER_DEVICE (device))); - + g_object_ref (device); g_hash_table_remove (pulse->priv->devices, GUINT_TO_POINTER (index)); free_list_devices (pulse); g_signal_emit_by_name (G_OBJECT (pulse), "device-removed", - name); - g_free (name); + MATE_MIXER_DEVICE (device)); + + g_object_unref (device); } static void @@ -832,15 +831,13 @@ on_connection_sink_info (PulseConnection *connection, if (device != NULL) { pulse_device_add_stream (device, stream); } else { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream)); - - /* Only emit when not a part of the device, otherwise emitted by + /* Only emit when not a part of a device, otherwise emitted by * the main library */ g_signal_emit_by_name (G_OBJECT (pulse), "stream-added", - name); + MATE_MIXER_STREAM (stream)); } + /* We might be waiting for this sink to set it as the default */ check_pending_sink (pulse, stream); } else @@ -860,17 +857,19 @@ on_connection_sink_removed (PulseConnection *connection, return; g_object_ref (stream); - g_hash_table_remove (pulse->priv->sinks, GUINT_TO_POINTER (idx)); + free_list_streams (pulse); device = pulse_stream_get_device (stream); if (device != NULL) { pulse_device_remove_stream (device, stream); } else { + /* Only emit when not a part of a device, otherwise emitted by + * the main library */ g_signal_emit_by_name (G_OBJECT (pulse), "stream-removed", - mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream))); + MATE_MIXER_STREAM (stream)); } /* The removed stream might be one of the default streams, this happens @@ -969,15 +968,13 @@ on_connection_source_info (PulseConnection *connection, if (device != NULL) { pulse_device_add_stream (device, stream); } else { - const gchar *name = - mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream)); - - /* Only emit when not a part of the device, otherwise emitted by + /* Only emit when not a part of a device, otherwise emitted by * the main library */ g_signal_emit_by_name (G_OBJECT (pulse), "stream-added", - name); + MATE_MIXER_STREAM (stream)); } + /* We might be waiting for this source to set it as the default */ check_pending_source (pulse, stream); } else @@ -1005,9 +1002,11 @@ on_connection_source_removed (PulseConnection *connection, if (device != NULL) { pulse_device_remove_stream (device, stream); } else { + /* Only emit when not a part of a device, otherwise emitted by + * the main library */ g_signal_emit_by_name (G_OBJECT (pulse), "stream-removed", - mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream))); + MATE_MIXER_STREAM (stream)); } /* The removed stream might be one of the default streams, this happens @@ -1110,7 +1109,7 @@ on_connection_ext_stream_info (PulseConnection *connection, g_signal_emit_by_name (G_OBJECT (pulse), "stored-control-added", - mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (ext))); + MATE_MIXER_STORED_CONTROL (ext)); } else { pulse_ext_stream_update (ext, info, parent); @@ -1136,21 +1135,23 @@ static void on_connection_ext_stream_loaded (PulseConnection *connection, PulseBackend *pulse) { GHashTableIter iter; - gpointer name; gpointer ext; g_hash_table_iter_init (&iter, pulse->priv->ext_streams); - while (g_hash_table_iter_next (&iter, &name, &ext) == TRUE) { + while (g_hash_table_iter_next (&iter, NULL, &ext) == TRUE) { if (PULSE_GET_HANGING (ext) == FALSE) continue; + g_object_ref (G_OBJECT (ext)); g_hash_table_iter_remove (&iter); - free_list_ext_streams (pulse); + free_list_ext_streams (pulse); g_signal_emit_by_name (G_OBJECT (pulse), "stored-control-removed", - name); + MATE_MIXER_STORED_CONTROL (ext)); + + g_object_unref (G_OBJECT (ext)); } } diff --git a/backends/pulse/pulse-device.c b/backends/pulse/pulse-device.c index 9b75ca4..c65f304 100644 --- a/backends/pulse/pulse-device.c +++ b/backends/pulse/pulse-device.c @@ -280,7 +280,6 @@ pulse_device_add_stream (PulseDevice *device, PulseStream *stream) g_return_if_fail (PULSE_IS_STREAM (stream)); name = mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream)); - g_hash_table_insert (device->priv->streams, g_strdup (name), g_object_ref (stream)); @@ -289,7 +288,7 @@ pulse_device_add_stream (PulseDevice *device, PulseStream *stream) g_signal_emit_by_name (G_OBJECT (device), "stream-added", - name); + MATE_MIXER_STREAM (stream)); } void @@ -302,12 +301,15 @@ pulse_device_remove_stream (PulseDevice *device, PulseStream *stream) name = mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream)); - free_list_streams (device); - + g_object_ref (stream); g_hash_table_remove (device->priv->streams, name); + + free_list_streams (device); g_signal_emit_by_name (G_OBJECT (device), "stream-removed", - name); + MATE_MIXER_STREAM (stream)); + + g_object_unref (stream); } guint32 diff --git a/backends/pulse/pulse-sink.c b/backends/pulse/pulse-sink.c index 3f9573d..9edf185 100644 --- a/backends/pulse/pulse-sink.c +++ b/backends/pulse/pulse-sink.c @@ -196,7 +196,6 @@ pulse_sink_add_input (PulseSink *sink, const pa_sink_input_info *info) /* This function is used for both creating and refreshing sink inputs */ input = g_hash_table_lookup (sink->priv->inputs, GUINT_TO_POINTER (info->index)); if (input == NULL) { - const gchar *name; PulseConnection *connection; connection = pulse_stream_get_connection (PULSE_STREAM (sink)); @@ -210,10 +209,9 @@ pulse_sink_add_input (PulseSink *sink, const pa_sink_input_info *info) free_list_controls (sink); - name = mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (input)); g_signal_emit_by_name (G_OBJECT (sink), "control-added", - name); + MATE_MIXER_STREAM_CONTROL (input)); return TRUE; } @@ -225,7 +223,6 @@ void pulse_sink_remove_input (PulseSink *sink, guint32 index) { PulseSinkInput *input; - gchar *name; g_return_if_fail (PULSE_IS_SINK (sink)); @@ -233,15 +230,14 @@ pulse_sink_remove_input (PulseSink *sink, guint32 index) if G_UNLIKELY (input == NULL) return; - name = g_strdup (mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (input))); - + g_object_ref (input); g_hash_table_remove (sink->priv->inputs, GUINT_TO_POINTER (index)); free_list_controls (sink); g_signal_emit_by_name (G_OBJECT (sink), "control-removed", - name); - g_free (name); + MATE_MIXER_STREAM_CONTROL (input)); + g_object_unref (input); } void diff --git a/backends/pulse/pulse-source.c b/backends/pulse/pulse-source.c index b70cbe4..6393743 100644 --- a/backends/pulse/pulse-source.c +++ b/backends/pulse/pulse-source.c @@ -193,7 +193,6 @@ pulse_source_add_output (PulseSource *source, const pa_source_output_info *info) /* This function is used for both creating and refreshing source outputs */ output = g_hash_table_lookup (source->priv->outputs, GUINT_TO_POINTER (info->index)); if (output == NULL) { - const gchar *name; PulseConnection *connection; connection = pulse_stream_get_connection (PULSE_STREAM (source)); @@ -206,10 +205,9 @@ pulse_source_add_output (PulseSource *source, const pa_source_output_info *info) free_list_controls (source); - name = mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (output)); g_signal_emit_by_name (G_OBJECT (source), "control-added", - name); + MATE_MIXER_STREAM_CONTROL (output)); return TRUE; } @@ -221,7 +219,6 @@ void pulse_source_remove_output (PulseSource *source, guint32 index) { PulseSourceOutput *output; - gchar *name; g_return_if_fail (PULSE_IS_SOURCE (source)); @@ -229,15 +226,14 @@ pulse_source_remove_output (PulseSource *source, guint32 index) if G_UNLIKELY (output == NULL) return; - name = g_strdup (mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (output))); - + g_object_ref (output); g_hash_table_remove (source->priv->outputs, GUINT_TO_POINTER (index)); free_list_controls (source); g_signal_emit_by_name (G_OBJECT (source), "control-removed", - name); - g_free (name); + MATE_MIXER_STREAM_CONTROL (output)); + g_object_unref (output); } void -- cgit v1.2.1