aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-11-18 03:29:21 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-11-19 01:49:56 +0800
commit080e87039579a2e2155d3ee56c59f57873cd02b6 (patch)
treebd09b79a136003794f2ca2c14536bf31353dfa2e /src
parentad8497cb0edb8e6801e277cecf43b0c2129e6c41 (diff)
downloadgsoc2013-empathy-080e87039579a2e2155d3ee56c59f57873cd02b6.tar
gsoc2013-empathy-080e87039579a2e2155d3ee56c59f57873cd02b6.tar.gz
gsoc2013-empathy-080e87039579a2e2155d3ee56c59f57873cd02b6.tar.bz2
gsoc2013-empathy-080e87039579a2e2155d3ee56c59f57873cd02b6.tar.lz
gsoc2013-empathy-080e87039579a2e2155d3ee56c59f57873cd02b6.tar.xz
gsoc2013-empathy-080e87039579a2e2155d3ee56c59f57873cd02b6.tar.zst
gsoc2013-empathy-080e87039579a2e2155d3ee56c59f57873cd02b6.zip
Bind the mic button the sources mute property
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c43
1 files changed, 5 insertions, 38 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 5b7c6e1c1..22eadb772 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -285,9 +285,6 @@ static gboolean empathy_call_window_state_event_cb (GtkWidget *widget,
static void empathy_call_window_set_send_video (EmpathyCallWindow *window,
CameraState state);
-static void empathy_call_window_mic_toggled_cb (
- GtkToggleToolButton *toggle, EmpathyCallWindow *window);
-
static void empathy_call_window_hangup_cb (gpointer object,
EmpathyCallWindow *window);
@@ -510,6 +507,11 @@ create_audio_input (EmpathyCallWindow *self)
priv->audio_input = empathy_audio_src_new ();
gst_object_ref (priv->audio_input);
gst_object_sink (priv->audio_input);
+
+ g_object_bind_property (priv->mic_button, "active",
+ priv->audio_input, "mute",
+ G_BINDING_BIDIRECTIONAL |
+ G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE);
}
static void
@@ -1672,7 +1674,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
"audiocall", "clicked", empathy_call_window_audio_call_cb,
"videocall", "clicked", empathy_call_window_video_call_cb,
"volume", "value-changed", empathy_call_window_volume_changed_cb,
- "microphone", "toggled", empathy_call_window_mic_toggled_cb,
"camera", "toggled", empathy_call_window_camera_toggled_cb,
"dialpad", "toggled", empathy_call_window_dialpad_cb,
"menufullscreen", "activate", empathy_call_window_fullscreen_cb,
@@ -4000,40 +4001,6 @@ empathy_call_window_set_send_video (EmpathyCallWindow *window,
}
static void
-empathy_call_window_mic_toggled_cb (GtkToggleToolButton *toggle,
- EmpathyCallWindow *self)
-{
- EmpathyCallWindowPriv *priv = GET_PRIV (self);
- gboolean active;
-
- active = (gtk_toggle_tool_button_get_active (toggle));
-
- /* We don't want the settings callback to react to this change to avoid
- * a loop. */
- g_signal_handlers_block_by_func (priv->settings,
- empathy_call_window_prefs_volume_changed_cb, self);
-
- if (active)
- {
- g_settings_set_double (priv->settings, EMPATHY_PREFS_CALL_SOUND_VOLUME,
- priv->volume * 100);
- }
- else
- {
- /* TODO, Instead of setting the input volume to 0 we should probably
- * stop sending but this would cause the audio call to drop if both
- * sides mute at the same time on certain CMs AFAIK. Need to revisit this
- * in the future. GNOME #574574
- */
- g_settings_set_double (priv->settings, EMPATHY_PREFS_CALL_SOUND_VOLUME,
- 0);
- }
-
- g_signal_handlers_unblock_by_func (priv->settings,
- empathy_call_window_prefs_volume_changed_cb, self);
-}
-
-static void
empathy_call_window_hangup_cb (gpointer object,
EmpathyCallWindow *self)
{