Commit 9b96f858 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

Merge branch 'm_savard'

parents 4a1e68a7 2345dd70
......@@ -35,9 +35,11 @@
GtkListStore *pluginlist;
GtkListStore *outputlist;
GtkListStore *inputlist;
GtkListStore *ringtonelist;
GtkWidget *output;
GtkWidget *input;
GtkWidget *ringtone;
GtkWidget *plugin;
GtkWidget *codecMoveUpButton;
GtkWidget *codecMoveDownButton;
......@@ -103,7 +105,7 @@ void preferences_dialog_fill_codec_list (account_t **a) {
* Fill store with output audio plugins
*/
void
preferences_dialog_fill_output_audio_plugin_list()
preferences_dialog_fill_audio_plugin_list()
{
GtkTreeIter iter;
gchar** list;
......@@ -112,7 +114,7 @@ preferences_dialog_fill_output_audio_plugin_list()
gtk_list_store_clear(pluginlist);
// Call dbus to retreive list
list = dbus_get_output_audio_plugin_list();
list = dbus_get_audio_plugin_list();
// For each API name included in list
int c = 0;
......@@ -127,6 +129,7 @@ preferences_dialog_fill_output_audio_plugin_list()
list = NULL;
}
/**
* Fill output audio device store
*/
......@@ -155,6 +158,37 @@ preferences_dialog_fill_output_audio_device_list()
}
}
/**
* Fill rigntone audio device store
*/
void
preferences_dialog_fill_ringtone_audio_device_list()
{
GtkTreeIter iter;
gchar** list;
gchar** audioDevice;
int index;
gtk_list_store_clear(ringtonelist);
// Call dbus to retreive output device
list = dbus_get_audio_output_device_list();
// For each device name in the list
int c = 0;
for(audioDevice = list; *list; list++) {
index = dbus_get_audio_device_index( *list );
gtk_list_store_append(ringtonelist, &iter);
gtk_list_store_set(ringtonelist, &iter, 0, *list, 1, index, -1);
c++;
}
}
/**
* Select active output audio device
*/
......@@ -194,6 +228,46 @@ select_active_output_audio_device()
}
}
/**
* Select active output audio device
*/
void
select_active_ringtone_audio_device()
{
if( SHOW_ALSA_CONF )
{
GtkTreeModel* model;
GtkTreeIter iter;
gchar** devices;
int currentDeviceIndex;
int deviceIndex;
// Select active ringtone device on server
devices = dbus_get_current_audio_devices_index();
currentDeviceIndex = atoi(devices[2]);
DEBUG("audio device index for ringtone = %d", currentDeviceIndex);
model = gtk_combo_box_get_model(GTK_COMBO_BOX(ringtone));
// Find the currently set ringtone device
gtk_tree_model_get_iter_first(model, &iter);
do {
gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1);
if(deviceIndex == currentDeviceIndex)
{
// Set current iteration the active one
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(ringtone), &iter);
return;
}
} while(gtk_tree_model_iter_next(model, &iter));
// No index was found, select first one
WARN("Warning : No active ringtone device found");
gtk_combo_box_set_active(GTK_COMBO_BOX(ringtone), 0);
}
}
/**
* Fill input audio device store
*/
......@@ -364,6 +438,29 @@ select_audio_input_device(GtkComboBox* comboBox, gpointer data UNUSED)
}
}
/**
* Set the audio ringtone device on the server with its index
*/
static void
select_audio_ringtone_device(GtkComboBox *comboBox, gpointer data UNUSED)
{
GtkTreeModel *model;
GtkTreeIter iter;
int comboBoxIndex;
int deviceIndex;
comboBoxIndex = gtk_combo_box_get_active(comboBox);
if(comboBoxIndex >= 0) {
model = gtk_combo_box_get_model(comboBox);
gtk_combo_box_get_active_iter(comboBox, &iter);
gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1);
dbus_set_audio_ringtone_device(deviceIndex);
}
}
/**
* Toggle move buttons on if a codec is selected, off elsewise
*/
......@@ -647,8 +744,7 @@ GtkWidget* codecs_box (account_t **a)
void
select_audio_manager( void )
{
DEBUG("audio manager selected\n");
DEBUG("audio manager selected");
if( !SHOW_ALSA_CONF && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ) )
{
......@@ -690,19 +786,19 @@ GtkWidget* alsa_box()
ret = gtk_hbox_new(FALSE, 10);
gtk_widget_show( ret );
table = gtk_table_new(4, 3, FALSE);
table = gtk_table_new(5, 3, FALSE);
gtk_table_set_col_spacing(GTK_TABLE(table), 0, 40);
gtk_box_pack_start( GTK_BOX(ret) , table , TRUE , TRUE , 1);
gtk_widget_show(table);
DEBUG("plugin");
DEBUG("Audio: Configuration plugin");
item = gtk_label_new(_("ALSA plugin"));
gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5);
gtk_table_attach(GTK_TABLE(table), item, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
gtk_widget_show( item );
// Set choices of audio managers
pluginlist = gtk_list_store_new(1, G_TYPE_STRING);
preferences_dialog_fill_output_audio_plugin_list();
preferences_dialog_fill_audio_plugin_list();
plugin = gtk_combo_box_new_with_model(GTK_TREE_MODEL(pluginlist));
select_active_output_audio_plugin();
gtk_label_set_mnemonic_widget(GTK_LABEL(item), plugin);
......@@ -717,7 +813,7 @@ GtkWidget* alsa_box()
// Device : Output device
// Create title label
DEBUG("output");
DEBUG("Audio: Configuration output");
item = gtk_label_new(_("Output"));
gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5);
gtk_table_attach(GTK_TABLE(table), item, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
......@@ -739,7 +835,7 @@ GtkWidget* alsa_box()
// Device : Input device
// Create title label
DEBUG("input");
DEBUG("Audio: Configuration input");
item = gtk_label_new(_("Input"));
gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5);
gtk_table_attach(GTK_TABLE(table), item, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
......@@ -760,6 +856,27 @@ GtkWidget* alsa_box()
gtk_table_attach(GTK_TABLE(table), input, 2, 3, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
gtk_widget_show(input);
DEBUG("Audio: Configuration rintgtone");
item = gtk_label_new(_("Ringtone"));
gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5);
gtk_table_attach(GTK_TABLE(table), item, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
gtk_widget_show(item);
// set choices of ringtone devices
ringtonelist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
preferences_dialog_fill_ringtone_audio_device_list();
ringtone = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ringtonelist));
select_active_ringtone_audio_device();
gtk_label_set_mnemonic_widget(GTK_LABEL(item), output);
g_signal_connect(G_OBJECT(ringtone), "changed", G_CALLBACK(select_audio_ringtone_device), output);
// Set rendering
renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(ringtone), renderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(ringtone), renderer, "text", 0, NULL);
gtk_table_attach(GTK_TABLE(table), ringtone, 2, 3, 4, 5, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
gtk_widget_show(ringtone);
gtk_widget_show_all(ret);
DEBUG("done");
......
......@@ -105,8 +105,8 @@
<tp:docstring>
</tp:docstring>
<arg type="s" name="accountID" direction="in">
<tp:docstring>
</tp:docstring>
<tp:docstring>
</tp:docstring>
</arg>
<arg type="i" name="number" direction="in">
<tp:docstring>
......@@ -118,8 +118,9 @@
<tp:docstring>
</tp:docstring>
<arg type="s" name="accountID" direction="in">
<tp:docstring>
</tp:docstring>
<tp:docstring>
Account ID
</tp:docstring>
</arg>
</method>
......@@ -206,55 +207,55 @@
<method name="addAccount" tp:name-for-bindings="addAccount">
<tp:docstring>
Add a new account. When created, the signal <tp:member-ref>accountsChanged</tp:member-ref> is emitted. The clients must then call <tp:member-ref>getAccountList</tp:member-ref> to update their internal data structure.
<tp:rationale>If no details are specified, the default parameters are used.</tp:rationale>
<tp:rationale>The core tries to register the account as soon it is created.</tp:rationale>
Add a new account. When created, the signal <tp:member-ref>accountsChanged</tp:member-ref> is emitted. The clients must then call <tp:member-ref>getAccountList</tp:member-ref> to update their internal data structure.
<tp:rationale>If no details are specified, the default parameters are used.</tp:rationale>
<tp:rationale>The core tries to register the account as soon it is created.</tp:rationale>
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/>
<arg type="a{ss}" name="details" direction="in" tp:type="String_String_Map">
<tp:docstring>
The new account settings
</tp:docstring>
<tp:docstring>
The new account settings
</tp:docstring>
</arg>
<arg type="s" name="createdAccountId" direction="out">
<tp:docstring>
A new account ID
</tp:docstring>
<tp:docstring>
A new account ID
</tp:docstring>
</arg>
</method>
<method name="setAccountsOrder" tp:name-for-bindings="setAccountsOrder">
<tp:docstring>
Update the accounts order.
<tp:rationale>When placing a call, the first registered account in the list is used.</tp:rationale>
Update the accounts order.
<tp:rationale>When placing a call, the first registered account in the list is used.</tp:rationale>
</tp:docstring>
<arg type="s" name="order" direction="in">
<tp:docstring>
An ordered list of account IDs, delimited by '/'
</tp:docstring>
<tp:docstring>
An ordered list of account IDs, delimited by '/'
</tp:docstring>
</arg>
</method>
<method name="removeAccount" tp:name-for-bindings="removeAccount">
<tp:docstring>
Remove an existing account. When removed, the signal <tp:member-ref>accountsChanged</tp:member-ref> is emitted. The clients must then call <tp:member-ref>getAccountList</tp:member-ref> to update their internal data structure.
</tp:docstring>
<arg type="s" name="accoundID" direction="in">
<tp:docstring>
The account to remove, identified by its ID
</tp:docstring>
</arg>
<tp:docstring>
Remove an existing account. When removed, the signal <tp:member-ref>accountsChanged</tp:member-ref> is emitted. The clients must then call <tp:member-ref>getAccountList</tp:member-ref> to update their internal data structure.
</tp:docstring>
<arg type="s" name="accoundID" direction="in">
<tp:docstring>
The account to remove, identified by its ID
</tp:docstring>
</arg>
</method>
<method name="getAccountList" tp:name-for-bindings="getAccountList">
<tp:docstring>
Get a list of all created accounts, as stored by the core.
</tp:docstring>
<tp:docstring>
Get a list of all created accounts, as stored by the core.
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
<tp:docstring>
A list of account IDs
</tp:docstring>
<tp:docstring>
A list of account IDs
</tp:docstring>
</arg>
</method>
......@@ -267,15 +268,15 @@
@param[in] input accountID
-->
<arg type="s" name="accountID" direction="in">
<tp:docstring>
The account ID
</tp:docstring>
<tp:docstring>
The account ID
</tp:docstring>
</arg>
<arg type="i" name="expire" direction="in">
<tp:docstring>
<p>To register, expire must be 1.</p>
<p>To un-register, expire must be 0.</p>
</tp:docstring>
<tp:docstring>
<p>To register, expire must be 1.</p>
<p>To un-register, expire must be 0.</p>
</tp:docstring>
</arg>
</method>
......@@ -284,13 +285,14 @@
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
<tp:docstring>
</tp:docstring>
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="getVersion" tp:name-for-bindings="getVersion">
<tp:docstring>
Return SFLphone-daemon version
</tp:docstring>
<arg type="s" name="version" direction="out">
<tp:docstring>
......@@ -300,16 +302,19 @@
<method name="getRingtoneList" tp:name-for-bindings="getRingtoneList">
<tp:docstring>
Return a list of valid Sun's .au sound file used
as ringtones.
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
<tp:docstring>
</tp:docstring>
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="getPlaybackDeviceList" tp:name-for-bindings="getPlaybackDeviceList">
<tp:docstring>
Provide a list of playback device from ALSA
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
......@@ -320,6 +325,7 @@
<method name="getRecordDeviceList" tp:name-for-bindings="getRecordDeviceList">
<tp:docstring>
Provide a list of record device from ALSA
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
......@@ -330,6 +336,7 @@
<method name="isRingtoneEnabled" tp:name-for-bindings="isRingtoneEnabled">
<tp:docstring>
Return true if ringtone is enabled, false otherwise
</tp:docstring>
<arg type="i" name="bool" direction="out">
<tp:docstring>
......@@ -339,24 +346,28 @@
<method name="ringtoneEnabled" tp:name-for-bindings="ringtoneEnabled">
<tp:docstring>
Unused
</tp:docstring>
</method>
<method name="getRingtoneChoice" tp:name-for-bindings="getRingtoneChoice">
<tp:docstring>
Get current ringtone .au file selected
</tp:docstring>
<arg type="s" name="tone" direction="out">
<tp:docstring>
</tp:docstring>
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="setRingtoneChoice" tp:name-for-bindings="setRingtoneChoice">
<tp:docstring>
Set current ringtone .au file from list acquired using <tp:member-ref>getAccountList</tp:member-ref>
</tp:docstring>
<arg type="s" name="tone" direction="in">
<tp:docstring>
</tp:docstring>
<tp:docstring>
A valid .au file path
</tp:docstring>
</arg>
</method>
......@@ -455,17 +466,7 @@
<!-- Audio devices methods -->
<method name="getInputAudioPluginList" tp:name-for-bindings="getInputAudioPluginList">
<tp:docstring>
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="getOutputAudioPluginList" tp:name-for-bindings="getOutputAudioPluginList">
<method name="getAudioPluginList" tp:name-for-bindings="getAudioPluginList">
<tp:docstring>
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
......@@ -512,25 +513,35 @@
</arg>
</method>
<method name="getAudioInputDeviceList" tp:name-for-bindings="getAudioInputDeviceList">
<method name="setAudioInputDevice" tp:name-for-bindings="setAudioInputDevice">
<tp:docstring>
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
<arg type="i" name="index" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="setAudioInputDevice" tp:name-for-bindings="setAudioInputDevice">
<tp:docstring>
<method name="setAudioRingtoneDevice" tp:name-for-binding="setAudioRingtoneDevice">
<tp:docstring>
</tp:docstring>
<arg type="i" name="index" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="getAudioInputDeviceList" tp:name-for-bindings="getAudioInputDeviceList">
<tp:docstring>
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="list" direction="out">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="getCurrentAudioDevicesIndex" tp:name-for-bindings="getCurrentAudioDevicesIndex">
<tp:docstring>
</tp:docstring>
......@@ -732,6 +743,7 @@
<method name="getWindowWidth" tp:name-for-bindings="getWindowWidth">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="width" direction="out">
<tp:docstring>
......@@ -741,6 +753,7 @@
<method name="getWindowHeight" tp:name-for-bindings="getWindowHeight">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="height" direction="out">
<tp:docstring>
......@@ -750,6 +763,7 @@
<method name="setWindowWidth" tp:name-for-bindings="setWindowWidth">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="width" direction="in">
<tp:docstring>
......@@ -759,6 +773,7 @@
<method name="setWindowHeight" tp:name-for-bindings="setWindowHeight">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="height" direction="in">
<tp:docstring>
......@@ -768,6 +783,7 @@
<method name="getWindowPositionX" tp:name-for-bindings="getWindowPositionX">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="posX" direction="out">
<tp:docstring>
......@@ -777,6 +793,7 @@
<method name="setWindowPositionX" tp:name-for-bindings="setWindowPositionX">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="posX" direction="in">
<tp:docstring>
......@@ -786,6 +803,7 @@
<method name="getWindowPositionY" tp:name-for-bindings="getWindowPositionY">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="posY" direction="out">
<tp:docstring>
......@@ -795,28 +813,33 @@
<method name="setWindowPositionY" tp:name-for-bindings="setWindowPositionY">
<tp:docstring>
Unused
</tp:docstring>
<arg type="i" name="posY" direction="in">
<tp:docstring>
</tp:docstring>
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="enableStatusIcon" tp:name-for-bindings="enableStatusIcon">
<tp:docstring>
Allow SFLphone icon to be displayed in system tray
</tp:docstring>
<arg type="s" name="value" direction="in">
<tp:docstring>
</tp:docstring>
<tp:docstring>
true/false
</tp:docstring>
</arg>
</method>
<method name="isStatusIconEnabled" tp:name-for-bindings="isStatusIconEnabled">
<tp:docstring>
Test if SFLphone icon is displayed in system tray.
</tp:docstring>
<arg type="s" name="value" direction="out">
<tp:docstring>
</tp:docstring>
<tp:docstring>
true/false
</tp:docstring>
</arg>
</method>
......@@ -899,100 +922,144 @@
</tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/>
<arg type="a{ss}" name="entries" direction="in">
<tp:docstring>
</tp:docstring>
<tp:docstring>
</tp:docstring>
</arg>
</method>
<signal name="accountsChanged" tp:name-for-bindings="accountsChanged">
<tp:docstring>
Signal emited on account changes. Clients should update
all account status with <tp:member-ref>getAccountDetails</tp:member-ref>
iterating over the list provided by <tp:member-ref>getAccountList</tp:member-ref>
</tp:docstring>
</signal>