Commit 830d32e0 authored by Adrien Béraud's avatar Adrien Béraud Committed by Tristan Matthews

gnome: follow getAudioDeviceIndex daemon API change

Issue: #46286
Change-Id: I8c459a0e3c2d828cbec3ea87cd63c62aa9e0a7a2
parent a2940856
......@@ -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
......
......@@ -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">
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment