Skip to content
Snippets Groups Projects
Commit 830d32e0 authored by Adrien Béraud's avatar Adrien Béraud Committed by Tristan Matthews
Browse files

gnome: follow getAudioDeviceIndex daemon API change

Issue: #46286
Change-Id: I8c459a0e3c2d828cbec3ea87cd63c62aa9e0a7a2
parent a2940856
No related branches found
No related tags found
No related merge requests found
...@@ -108,12 +108,14 @@ fill_codec_list(const account_t *account) ...@@ -108,12 +108,14 @@ fill_codec_list(const account_t *account)
} }
static GtkListStore * 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); GtkListStore *list_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
for (gchar **tmp = list; tmp && *tmp; ++tmp) { 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; GtkTreeIter iter;
gtk_list_store_append(list_store, &iter); gtk_list_store_append(list_store, &iter);
gtk_list_store_set(list_store, &iter, 0, *tmp, 1, device_index, -1); gtk_list_store_set(list_store, &iter, 0, *tmp, 1, device_index, -1);
...@@ -187,14 +189,14 @@ static GtkListStore* ...@@ -187,14 +189,14 @@ static GtkListStore*
create_output_list_store() create_output_list_store()
{ {
gchar **list = dbus_get_audio_output_device_list(); gchar **list = dbus_get_audio_output_device_list();
return create_device_list_store(list); return create_device_list_store(list, TRUE);
} }
static GtkListStore* static GtkListStore*
create_input_list_store() create_input_list_store()
{ {
gchar **list = dbus_get_audio_input_device_list(); gchar **list = dbus_get_audio_input_device_list();
return create_device_list_store(list); return create_device_list_store(list, FALSE);
} }
static void static void
......
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
<!-- For now only expose these two options to clients --> <!-- For now only expose these two options to clients -->
<method name="muteDtmf" tp:name-for-bindings="muteDtmf"> <method name="muteDtmf" tp:name-for-bindings="muteDtmf">
<arg type="b" name="muteDtmf" direction="in"/> <arg type="b" name="mute" direction="in"/>
</method> </method>
<method name="isDtmfMuted" tp:name-for-bindings="isDtmfMuted"> <method name="isDtmfMuted" tp:name-for-bindings="isDtmfMuted">
<arg type="b" name="muted" direction="out"/> <arg type="b" name="muted" direction="out"/>
...@@ -424,7 +424,14 @@ ...@@ -424,7 +424,14 @@
</arg> </arg>
</method> </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 type="s" name="name" direction="in">
</arg> </arg>
<arg type="i" name="index" direction="out"> <arg type="i" name="index" direction="out">
......
...@@ -1602,11 +1602,25 @@ dbus_get_current_audio_devices_index() ...@@ -1602,11 +1602,25 @@ dbus_get_current_audio_devices_index()
* Get index * Get index
*/ */
int int
dbus_get_audio_device_index(const gchar *name) dbus_get_audio_output_device_index(const gchar *name)
{ {
int device_index = 0; int device_index = 0;
GError *error = NULL; 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); check_error(error);
return device_index; return device_index;
......
...@@ -308,11 +308,18 @@ void dbus_set_audio_input_device(int index); ...@@ -308,11 +308,18 @@ void dbus_set_audio_input_device(int index);
gchar **dbus_get_current_audio_devices_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 * @param name The string description of the audio device
* @return int The index of the 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 * ConfigurationManager - Get the current output audio plugin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment