diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-11-18 03:45:39 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2011-11-19 01:49:56 +0800 |
commit | 11c9648caf1056dbedf8670ee680ab90d699bb3c (patch) | |
tree | 54db886d7cb172e8e8060db3fcaa1d11399069de /src | |
parent | 080e87039579a2e2155d3ee56c59f57873cd02b6 (diff) | |
download | gsoc2013-empathy-11c9648caf1056dbedf8670ee680ab90d699bb3c.tar gsoc2013-empathy-11c9648caf1056dbedf8670ee680ab90d699bb3c.tar.gz gsoc2013-empathy-11c9648caf1056dbedf8670ee680ab90d699bb3c.tar.bz2 gsoc2013-empathy-11c9648caf1056dbedf8670ee680ab90d699bb3c.tar.lz gsoc2013-empathy-11c9648caf1056dbedf8670ee680ab90d699bb3c.tar.xz gsoc2013-empathy-11c9648caf1056dbedf8670ee680ab90d699bb3c.tar.zst gsoc2013-empathy-11c9648caf1056dbedf8670ee680ab90d699bb3c.zip |
Bind the volume button to the volume of the output
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-call-window.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 22eadb772..dc587e2d7 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -167,6 +167,7 @@ struct _EmpathyCallWindowPriv GtkWidget *audio_call_button; GtkWidget *video_call_button; GtkWidget *mic_button; + GtkWidget *volume_button; GtkWidget *camera_button; GtkWidget *dialpad_button; GtkWidget *toolbar; @@ -319,10 +320,6 @@ static gboolean empathy_call_window_bus_message (GstBus *bus, GstMessage *message, gpointer user_data); static void -empathy_call_window_volume_changed_cb (GtkScaleButton *button, - gdouble value, EmpathyCallWindow *window); - -static void empathy_call_window_show_hangup_button (EmpathyCallWindow *self, gboolean show) { @@ -1645,6 +1642,7 @@ empathy_call_window_init (EmpathyCallWindow *self) "audiocall", &priv->audio_call_button, "videocall", &priv->video_call_button, "microphone", &priv->mic_button, + "volume", &priv->volume_button, "camera", &priv->camera_button, "hangup", &priv->hangup_button, "dialpad", &priv->dialpad_button, @@ -1673,7 +1671,6 @@ empathy_call_window_init (EmpathyCallWindow *self) "hangup", "clicked", empathy_call_window_hangup_cb, "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, "camera", "toggled", empathy_call_window_camera_toggled_cb, "dialpad", "toggled", empathy_call_window_dialpad_cb, "menufullscreen", "activate", empathy_call_window_fullscreen_cb, @@ -2873,6 +2870,11 @@ empathy_call_window_get_audio_sink_pad (EmpathyCallWindow *self, priv->audio_output = empathy_audio_sink_new (); g_object_ref_sink (priv->audio_output); + /* volume button to output volume linking */ + g_object_bind_property (priv->audio_output, "volume", + priv->volume_button, "value", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + g_object_bind_property_full (content, "requested-output-volume", priv->audio_output, "volume", G_BINDING_DEFAULT, @@ -4130,19 +4132,6 @@ empathy_call_window_status_message (EmpathyCallWindow *self, gtk_label_set_label (GTK_LABEL (self->priv->status_label), message); } -static void -empathy_call_window_volume_changed_cb (GtkScaleButton *button, - gdouble value, EmpathyCallWindow *window) -{ - EmpathyCallWindowPriv *priv = GET_PRIV (window); - - if (priv->audio_output == NULL) - return; - - empathy_audio_sink_set_volume (EMPATHY_GST_AUDIO_SINK (priv->audio_output), - value); -} - GtkUIManager * empathy_call_window_get_ui_manager (EmpathyCallWindow *window) { |