diff --git a/gnome/src/config/audioconf.c b/gnome/src/config/audioconf.c index bc51a652d9975efb0d498149cebfc5ad5d55e6b7..8e3bdb4173a9d907802f6f5b4647f52ade8b1adc 100644 --- a/gnome/src/config/audioconf.c +++ b/gnome/src/config/audioconf.c @@ -108,12 +108,14 @@ fill_codec_list(const account_t *account) } static GtkListStore * -create_device_list_store(gchar **list) +create_device_list_store(gchar **list, gboolean output) { GtkListStore *list_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); for (gchar **tmp = list; tmp && *tmp; ++tmp) { - gint device_index = dbus_get_audio_device_index(*tmp); + gint device_index = output + ? dbus_get_audio_output_device_index(*tmp) + : dbus_get_audio_input_device_index(*tmp); GtkTreeIter iter; gtk_list_store_append(list_store, &iter); gtk_list_store_set(list_store, &iter, 0, *tmp, 1, device_index, -1); @@ -187,14 +189,14 @@ static GtkListStore* create_output_list_store() { gchar **list = dbus_get_audio_output_device_list(); - return create_device_list_store(list); + return create_device_list_store(list, TRUE); } static GtkListStore* create_input_list_store() { gchar **list = dbus_get_audio_input_device_list(); - return create_device_list_store(list); + return create_device_list_store(list, FALSE); } static void diff --git a/gnome/src/dbus/configurationmanager-introspec.xml b/gnome/src/dbus/configurationmanager-introspec.xml index 079765a04cb1a3649ff458d31301d97db0b41e50..2d265de05db0d551f77e3e9f4f435169b0a301c7 100644 --- a/gnome/src/dbus/configurationmanager-introspec.xml +++ b/gnome/src/dbus/configurationmanager-introspec.xml @@ -267,7 +267,7 @@ <!-- For now only expose these two options to clients --> <method name="muteDtmf" tp:name-for-bindings="muteDtmf"> - <arg type="b" name="muteDtmf" direction="in"/> + <arg type="b" name="mute" direction="in"/> </method> <method name="isDtmfMuted" tp:name-for-bindings="isDtmfMuted"> <arg type="b" name="muted" direction="out"/> @@ -424,7 +424,14 @@ </arg> </method> - <method name="getAudioDeviceIndex" tp:name-for-bindings="getAudioDeviceIndex"> + <method name="getAudioInputDeviceIndex" tp:name-for-bindings="getAudioInputDeviceIndex"> + <arg type="s" name="name" direction="in"> + </arg> + <arg type="i" name="index" direction="out"> + </arg> + </method> + + <method name="getAudioOutputDeviceIndex" tp:name-for-bindings="getAudioOutputDeviceIndex"> <arg type="s" name="name" direction="in"> </arg> <arg type="i" name="index" direction="out"> diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index d04e211cc33980fa686503b5627d72a907fe2c9e..d3ef11bf9eade846de2ff89f9db92cb996d971e6 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -1602,11 +1602,25 @@ dbus_get_current_audio_devices_index() * Get index */ int -dbus_get_audio_device_index(const gchar *name) +dbus_get_audio_output_device_index(const gchar *name) { int device_index = 0; GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index(config_proxy, name, &device_index, &error); + org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_index(config_proxy, name, &device_index, &error); + check_error(error); + + return device_index; +} + +/** + * Get index + */ +int +dbus_get_audio_input_device_index(const gchar *name) +{ + int device_index = 0; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_index(config_proxy, name, &device_index, &error); check_error(error); return device_index; diff --git a/gnome/src/dbus/dbus.h b/gnome/src/dbus/dbus.h index 27112e298517ee5a2c9e3260c5f287e5a9a7e9be..5b94e1143304c92c63a71f1bd6675cbc699ee764 100644 --- a/gnome/src/dbus/dbus.h +++ b/gnome/src/dbus/dbus.h @@ -308,11 +308,18 @@ void dbus_set_audio_input_device(int index); gchar **dbus_get_current_audio_devices_index(); /** - * ConfigurationManager - Get the index of the specified audio device + * ConfigurationManager - Get the index of the specified output audio device * @param name The string description of the audio device * @return int The index of the device */ -int dbus_get_audio_device_index(const gchar *name); +int dbus_get_audio_output_device_index(const gchar *name); + +/** + * ConfigurationManager - Get the index of the specified input audio device + * @param name The string description of the audio device + * @return int The index of the device + */ +int dbus_get_audio_input_device_index(const gchar *name); /** * ConfigurationManager - Get the current output audio plugin