aboutsummaryrefslogtreecommitdiff
path: root/src/voip-input-menu-item.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-02-18 16:22:58 +0000
committerConor Curran <conor.curran@canonical.com>2011-02-18 16:22:58 +0000
commit5882cc24cda26ab021224c66abf579b6b603617b (patch)
tree3d72715c49d3fdba026bd765cc846d0e3b91b23a /src/voip-input-menu-item.c
parentfca4da8d8a9dd24d8abdf2a92cf19a0c6d596e48 (diff)
downloadayatana-indicator-sound-5882cc24cda26ab021224c66abf579b6b603617b.tar.gz
ayatana-indicator-sound-5882cc24cda26ab021224c66abf579b6b603617b.tar.bz2
ayatana-indicator-sound-5882cc24cda26ab021224c66abf579b6b603617b.zip
and unmutes on slider activation
Diffstat (limited to 'src/voip-input-menu-item.c')
-rw-r--r--src/voip-input-menu-item.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/voip-input-menu-item.c b/src/voip-input-menu-item.c
index 337420b..19bc92d 100644
--- a/src/voip-input-menu-item.c
+++ b/src/voip-input-menu-item.c
@@ -85,7 +85,7 @@ voip_input_menu_item_init (VoipInputMenuItem *self)
priv->source_index = DEVICE_NOT_ACTIVE;
priv->sink_input_index = DEVICE_NOT_ACTIVE;
priv->client_index = DEVICE_NOT_ACTIVE;
- priv->mute = 0;
+ priv->mute = DEVICE_NOT_ACTIVE;
}
static void
@@ -125,6 +125,10 @@ handle_event (DbusmenuMenuitem * mi,
pa_cvolume_set(&new_volume, 1, new_volume_value);
pm_update_mic_gain (priv->source_index, new_volume);
+ // finally unmute if needed
+ if (priv->mute == 1) {
+ pm_update_mic_mute (priv->source_index, 0);
+ }
//active_sink_update_volume (priv->a_sink, volume_input);
//active_sink_ensure_sink_is_unmuted (priv->a_sink);
}
@@ -155,8 +159,15 @@ voip_input_menu_item_update (VoipInputMenuItem* item,
priv->source_index = source->index;
}
priv->volume = voip_input_menu_item_construct_mono_volume (&source->volume);
-
+ pa_volume_t vol = pa_cvolume_max (&source->volume);
+ gdouble update = ((gdouble) vol * 100) / PA_VOLUME_NORM;
+
+ GVariant* new_volume = g_variant_new_double(update);
+ dbusmenu_menuitem_property_set_variant(DBUSMENU_MENUITEM(item),
+ DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL,
+ new_volume);
// Only send over the mute updates if the state has changed.
+ // in this order - volume first mute last!!
if (priv->mute != source->mute){
g_debug ("voip menu item - update - mute = %i", priv->mute);
@@ -168,13 +179,6 @@ voip_input_menu_item_update (VoipInputMenuItem* item,
priv->mute = source->mute;
- pa_volume_t vol = pa_cvolume_max (&source->volume);
- gdouble update = ((gdouble) vol * 100) / PA_VOLUME_NORM;
-
- GVariant* new_volume = g_variant_new_double(update);
- dbusmenu_menuitem_property_set_variant(DBUSMENU_MENUITEM(item),
- DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL,
- new_volume);
}
gboolean