]> git.0d.be Git - empathy.git/commitdiff
Remove call input volume configuration
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Thu, 17 Nov 2011 20:14:01 +0000 (20:14 +0000)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Fri, 18 Nov 2011 17:49:56 +0000 (17:49 +0000)
As we rely on pulseaudio there is no point in saving our own volume
configuration, pulseaudio does that for us. If we do save it, then we
have no idea which volume to pick after connecting to pulse (the one we
save, the one pulse saved, a random value?).

On top of that our configuration implementation is plain ugly, the
level meter didn't work etc. This is all much better configured using
the gnome-control-center sound panel, which is pretty nice for inputs
and saves its volume on pulse for us to re-use :)

data/org.gnome.Empathy.gschema.xml.in
libempathy/empathy-gsettings.h
src/empathy-call-window.c
src/empathy-preferences.c
src/empathy-preferences.ui

index de57af80c97a192e21f7a20b1c331bb43f9de9b2..f3975fce2980af4794aeb6fad734bc66a600b2fb 100644 (file)
@@ -233,12 +233,6 @@ present them to the user immediately.</_description>
     </key>
   </schema>
   <schema id="org.gnome.Empathy.call" path="/org/gnome/empathy/call/">
-    <key name="volume" type="d">
-      <range min="0" max="150"/>
-      <default>100.0</default>
-      <_summary>Call volume</_summary>
-      <_description>Call volume, as a percentage.</_description>
-    </key>
     <key name="camera-device" type="s">
       <default>''</default>
       <_summary>Camera device</_summary>
index fb44b5893d12011f298b3d743681e0c519f28de9..ad55a9442d377fbcd369fb432d26583d63468064 100644 (file)
@@ -51,7 +51,6 @@ G_BEGIN_DECLS
 #define EMPATHY_PREFS_SOUNDS_CONTACT_LOGOUT        "sounds-contact-logout"
 
 #define EMPATHY_PREFS_CALL_SCHEMA EMPATHY_PREFS_SCHEMA ".call"
-#define EMPATHY_PREFS_CALL_SOUND_VOLUME            "volume"
 #define EMPATHY_PREFS_CALL_CAMERA_DEVICE           "camera-device"
 #define EMPATHY_PREFS_CALL_ECHO_CANCELLATION       "echo-cancellation"
 
index a2b89f2ba2aa286b0850c4c212f6fddf79d717ac..5b7c6e1c17eed353079b03ab56f45a0b1b3322c3 100644 (file)
@@ -200,8 +200,6 @@ struct _EmpathyCallWindowPriv
   gulong video_output_motion_handler_id;
   guint bus_message_source_id;
 
-  gdouble volume;
-
   /* String that contains the queued tones to send after the current ones
      are sent */
   GString *tones;
@@ -410,39 +408,6 @@ dtmf_start_tone_cb (EmpathyDialpadWidget *dialpad,
   empathy_call_window_maybe_emit_tones (self);
 }
 
-static void
-empathy_call_window_mic_volume_changed (EmpathyCallWindow *self)
-{
-  EmpathyCallWindowPriv *priv = GET_PRIV (self);
-  gdouble volume;
-
-  volume = g_settings_get_double (priv->settings,
-      EMPATHY_PREFS_CALL_SOUND_VOLUME) / 100.0;
-
-  /* Don't store the volume because of muting */
-  if (volume > 0 || gtk_toggle_tool_button_get_active (
-        GTK_TOGGLE_TOOL_BUTTON (priv->mic_button)))
-    priv->volume = volume;
-
-  /* Ensure that the toggle button is active if the volume is > 0 and inactive
-   * if it's smaller than 0 */
-  if ((volume > 0) != gtk_toggle_tool_button_get_active (
-        GTK_TOGGLE_TOOL_BUTTON (priv->mic_button)))
-    gtk_toggle_tool_button_set_active (
-      GTK_TOGGLE_TOOL_BUTTON (priv->mic_button), volume > 0);
-
-  empathy_audio_src_set_volume (EMPATHY_GST_AUDIO_SRC (priv->audio_input),
-    volume);
-}
-
-static void
-empathy_call_window_prefs_volume_changed_cb (GSettings *settings,
-    gchar *key,
-    EmpathyCallWindow *self)
-{
-  empathy_call_window_mic_volume_changed (self);
-}
-
 static void
 empathy_call_window_raise_actors (EmpathyCallWindow *self)
 {
@@ -1904,13 +1869,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
 
   empathy_call_window_show_hangup_button (self, TRUE);
 
-  /* Retrieve initial volume */
-  priv->volume = g_settings_get_double (priv->settings,
-      EMPATHY_PREFS_CALL_SOUND_VOLUME) / 100.0;
-
-  g_signal_connect (priv->settings, "changed::"EMPATHY_PREFS_CALL_SOUND_VOLUME,
-      G_CALLBACK (empathy_call_window_prefs_volume_changed_cb), self);
-
   empathy_geometry_bind (GTK_WINDOW (self), "call-window");
   /* These signals are used to track the window position and save it
    * when the window is destroyed. We need to do this as we don't want
@@ -4094,12 +4052,6 @@ empathy_call_window_restart_call (EmpathyCallWindow *window)
       (GtkCallback) gtk_widget_destroy, NULL);
 
   create_video_output_widget (window);
-
-  /* While the call was disconnected, the input volume might have changed.
-   * However, since the audio_input source was destroyed, its volume has not
-   * been updated during that time. That's why we manually update it here */
-  empathy_call_window_mic_volume_changed (window);
-
   priv->outgoing = TRUE;
   empathy_call_window_set_state_connecting (window);
 
index 3eb9e608dbc49e1f788f64f37b6970795f0a1ef7..60807ee5bdbdd5b5d056fa5113d0702c61dd141c 100644 (file)
@@ -83,8 +83,6 @@ struct _EmpathyPreferencesPriv {
        GtkWidget *checkbutton_notifications_contact_signin;
        GtkWidget *checkbutton_notifications_contact_signout;
 
-       GtkWidget *scale_call_volume;
-       GtkWidget *adj_call_volume;
        GtkWidget *echo_cancellation;
 
        GtkWidget *treeview_spell_checker;
@@ -272,12 +270,6 @@ preferences_setup_widgets (EmpathyPreferences *preferences)
                         "active",
                         G_SETTINGS_BIND_DEFAULT);
 
-       g_settings_bind (priv->gsettings_call,
-                        EMPATHY_PREFS_CALL_SOUND_VOLUME,
-                        priv->adj_call_volume,
-                        "value",
-                        G_SETTINGS_BIND_DEFAULT);
-
        g_settings_bind (priv->gsettings_call,
                         EMPATHY_PREFS_CALL_ECHO_CANCELLATION,
                         priv->echo_cancellation,
@@ -1108,13 +1100,6 @@ preferences_themes_setup (EmpathyPreferences *preferences)
                          preferences);
 }
 
-static gchar *
-preferences_call_format_volume_cb (GtkScale *scale,
-                                  gdouble value)
-{
-       return g_strdup_printf ("%g%%", value);
-}
-
 static void
 empathy_preferences_response (GtkDialog *widget,
                              gint response)
@@ -1162,8 +1147,6 @@ empathy_preferences_init (EmpathyPreferences *preferences)
        GtkBuilder                *gui;
        gchar                     *filename;
        GtkWidget                 *page;
-       GtkWidget                 *call_volume_scale_box;
-       GtkWidget                 *call_volume_bar_box;
 
        priv = preferences->priv = G_TYPE_INSTANCE_GET_PRIVATE (preferences,
                        EMPATHY_TYPE_PREFERENCES, EmpathyPreferencesPriv);
@@ -1206,10 +1189,6 @@ empathy_preferences_init (EmpathyPreferences *preferences)
                "checkbutton_location_resource_network", &priv->checkbutton_location_resource_network,
                "checkbutton_location_resource_cell", &priv->checkbutton_location_resource_cell,
                "checkbutton_location_resource_gps", &priv->checkbutton_location_resource_gps,
-               "call_volume_scale_box", &call_volume_scale_box,
-               "call_volume_bar_box", &call_volume_bar_box,
-               "call_volume_scale", &priv->scale_call_volume,
-               "call_volume_adjustment", &priv->adj_call_volume,
                "call_echo_cancellation", &priv->echo_cancellation,
                NULL);
        g_free (filename);
@@ -1235,15 +1214,6 @@ empathy_preferences_init (EmpathyPreferences *preferences)
                          preferences, 0);
        preferences_preview_theme_changed_cb (priv->theme_manager, preferences);
 
-       g_signal_connect (priv->scale_call_volume, "format-value",
-                         G_CALLBACK (preferences_call_format_volume_cb),
-                         preferences);
-
-#ifndef HAVE_CALL
-       gtk_widget_hide (call_volume_scale_box);
-       gtk_widget_hide (call_volume_bar_box);
-#endif
-
        preferences_themes_setup (preferences);
 
        preferences_setup_widgets (preferences);
index 46d6879015d29016702ad630d07c65edc3a629a6..03a628cb6a9414418bd266ce6ae98db3439e39fb 100644 (file)
                     <property name="can_focus">False</property>
                     <property name="orientation">vertical</property>
                     <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkBox" id="call_volume_scale_box">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkLabel" id="label12">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Input volume:</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkScale" id="call_volume_scale">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="adjustment">call_volume_adjustment</property>
-                            <property name="round_digits">0</property>
-                            <property name="digits">0</property>
-                            <property name="value_pos">bottom</property>
-                          </object>
-                          <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkBox" id="call_volume_bar_box">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkLabel" id="label13">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Input level:</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkProgressBar" id="progressbar2">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                          </object>
-                          <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
                     <child>
                       <object class="GtkCheckButton" id="call_echo_cancellation">
                         <property name="label" translatable="yes">Use _echo cancellation to improve call quality</property>
       </packing>
     </child>
   </object>
-  <object class="GtkSizeGroup" id="sizegroup1">
-    <widgets>
-      <widget name="label12"/>
-      <widget name="label13"/>
-    </widgets>
-  </object>
 </interface>