From 9956b2a9465c538c8792235c1ee02d2f90b84641 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Wed, 20 Aug 2014 17:43:30 +0200 Subject: Notify on mute from main library and add a debug message --- backends/alsa/alsa-stream-control.c | 2 -- libmatemixer/matemixer-stream-control.c | 22 +++++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/backends/alsa/alsa-stream-control.c b/backends/alsa/alsa-stream-control.c index 97a0f8b..b5500d1 100644 --- a/backends/alsa/alsa-stream-control.c +++ b/backends/alsa/alsa-stream-control.c @@ -291,8 +291,6 @@ alsa_stream_control_set_mute (MateMixerStreamControl *mmsc, gboolean mute) for (i = 0; i < control->priv->data.channels; i++) control->priv->data.m[i] = mute; - - _mate_mixer_stream_control_set_mute (mmsc, mute); } return TRUE; } diff --git a/libmatemixer/matemixer-stream-control.c b/libmatemixer/matemixer-stream-control.c index b2b2dad..80f9559 100644 --- a/libmatemixer/matemixer-stream-control.c +++ b/libmatemixer/matemixer-stream-control.c @@ -465,8 +465,11 @@ mate_mixer_stream_control_set_mute (MateMixerStreamControl *control, gboolean mu klass = MATE_MIXER_STREAM_CONTROL_GET_CLASS (control); - if G_LIKELY (klass->set_mute != NULL) - return klass->set_mute (control, mute); + if (klass->set_mute == NULL || + klass->set_mute (control, mute) == FALSE) + return FALSE; + + _mate_mixer_stream_control_set_mute (control, mute); } return FALSE; } @@ -786,7 +789,6 @@ mate_mixer_stream_control_get_monitor_enabled (MateMixerStreamControl *control) if (klass->get_monitor_enabled != NULL) return klass->get_monitor_enabled (control); } - return FALSE; } @@ -806,10 +808,17 @@ mate_mixer_stream_control_set_monitor_enabled (MateMixerStreamControl *control, MateMixerStreamControlClass *klass; klass = MATE_MIXER_STREAM_CONTROL_GET_CLASS (control); - if (klass->set_monitor_enabled != NULL) - return klass->set_monitor_enabled (control, enabled); - } + if (klass->set_monitor_enabled == NULL || + klass->set_monitor_enabled (control, enabled) == FALSE) + return FALSE; + if (enabled == TRUE) + g_debug ("Control %s monitor enabled", + control->priv->name); + else + g_debug ("Control %s monitor disabled", + control->priv->name); + } return FALSE; } @@ -904,7 +913,6 @@ _mate_mixer_stream_control_set_flags (MateMixerStreamControl *control, g_object_notify_by_pspec (G_OBJECT (control), properties[PROP_FLAGS]); } -/* Protected functions */ void _mate_mixer_stream_control_set_stream (MateMixerStreamControl *control, MateMixerStream *stream) -- cgit v1.2.1