Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
85385193
Commit
85385193
authored
Feb 13, 2008
by
Guillaume Carmel-Archambault
Browse files
DBus audio device selection and automatic selection of ALSA by default instead of OSS
parent
d7a1c2d6
Changes
12
Hide whitespace changes
Inline
Side-by-side
sflphone-gtk/src/configurationmanager-glue.h
View file @
85385193
...
...
@@ -612,6 +612,307 @@ org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_async (DBusGPro
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"setActiveCodecList"
,
org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_async_callback
,
stuff
,
g_free
,
G_TYPE_STRV
,
IN_list
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list
(
DBusGProxy
*
proxy
,
char
***
OUT_list
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"getAudioManagerList"
,
error
,
G_TYPE_INVALID
,
G_TYPE_STRV
,
OUT_list
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list_reply
)
(
DBusGProxy
*
proxy
,
char
*
*
OUT_list
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
char
**
OUT_list
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_STRV
,
&
OUT_list
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list_reply
)
data
->
cb
)
(
proxy
,
OUT_list
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list_async
(
DBusGProxy
*
proxy
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"getAudioManagerList"
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list_async_callback
,
stuff
,
g_free
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager
(
DBusGProxy
*
proxy
,
const
char
*
IN_audioManager
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"setAudioManager"
,
error
,
G_TYPE_STRING
,
IN_audioManager
,
G_TYPE_INVALID
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager_reply
)
(
DBusGProxy
*
proxy
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager_reply
)
data
->
cb
)
(
proxy
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager_async
(
DBusGProxy
*
proxy
,
const
char
*
IN_audioManager
,
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"setAudioManager"
,
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager_async_callback
,
stuff
,
g_free
,
G_TYPE_STRING
,
IN_audioManager
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list
(
DBusGProxy
*
proxy
,
char
***
OUT_list
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"getAudioOutputDeviceList"
,
error
,
G_TYPE_INVALID
,
G_TYPE_STRV
,
OUT_list
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list_reply
)
(
DBusGProxy
*
proxy
,
char
*
*
OUT_list
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
char
**
OUT_list
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_STRV
,
&
OUT_list
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list_reply
)
data
->
cb
)
(
proxy
,
OUT_list
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list_async
(
DBusGProxy
*
proxy
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"getAudioOutputDeviceList"
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list_async_callback
,
stuff
,
g_free
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device
(
DBusGProxy
*
proxy
,
const
gint
IN_index
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"setAudioOutputDevice"
,
error
,
G_TYPE_INT
,
IN_index
,
G_TYPE_INVALID
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device_reply
)
(
DBusGProxy
*
proxy
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device_reply
)
data
->
cb
)
(
proxy
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device_async
(
DBusGProxy
*
proxy
,
const
gint
IN_index
,
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"setAudioOutputDevice"
,
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device_async_callback
,
stuff
,
g_free
,
G_TYPE_INT
,
IN_index
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list
(
DBusGProxy
*
proxy
,
char
***
OUT_list
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"getAudioInputDeviceList"
,
error
,
G_TYPE_INVALID
,
G_TYPE_STRV
,
OUT_list
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list_reply
)
(
DBusGProxy
*
proxy
,
char
*
*
OUT_list
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
char
**
OUT_list
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_STRV
,
&
OUT_list
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list_reply
)
data
->
cb
)
(
proxy
,
OUT_list
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list_async
(
DBusGProxy
*
proxy
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"getAudioInputDeviceList"
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list_async_callback
,
stuff
,
g_free
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device
(
DBusGProxy
*
proxy
,
const
gint
IN_index
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"setAudioInputDevice"
,
error
,
G_TYPE_INT
,
IN_index
,
G_TYPE_INVALID
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device_reply
)
(
DBusGProxy
*
proxy
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device_reply
)
data
->
cb
)
(
proxy
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device_async
(
DBusGProxy
*
proxy
,
const
gint
IN_index
,
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"setAudioInputDevice"
,
org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device_async_callback
,
stuff
,
g_free
,
G_TYPE_INT
,
IN_index
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index
(
DBusGProxy
*
proxy
,
char
***
OUT_list
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"getCurrentAudioDevicesIndex"
,
error
,
G_TYPE_INVALID
,
G_TYPE_STRV
,
OUT_list
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index_reply
)
(
DBusGProxy
*
proxy
,
char
*
*
OUT_list
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
char
**
OUT_list
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_STRV
,
&
OUT_list
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index_reply
)
data
->
cb
)
(
proxy
,
OUT_list
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index_async
(
DBusGProxy
*
proxy
,
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"getCurrentAudioDevicesIndex"
,
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index_async_callback
,
stuff
,
g_free
,
G_TYPE_INVALID
);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_details
(
DBusGProxy
*
proxy
,
const
gint
IN_index
,
char
***
OUT_details
,
GError
**
error
)
{
return
dbus_g_proxy_call
(
proxy
,
"getAudioDeviceDetails"
,
error
,
G_TYPE_INT
,
IN_index
,
G_TYPE_INVALID
,
G_TYPE_STRV
,
OUT_details
,
G_TYPE_INVALID
);
}
typedef
void
(
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_details_reply
)
(
DBusGProxy
*
proxy
,
char
*
*
OUT_details
,
GError
*
error
,
gpointer
userdata
);
static
void
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_details_async_callback
(
DBusGProxy
*
proxy
,
DBusGProxyCall
*
call
,
void
*
user_data
)
{
DBusGAsyncData
*
data
=
(
DBusGAsyncData
*
)
user_data
;
GError
*
error
=
NULL
;
char
**
OUT_details
;
dbus_g_proxy_end_call
(
proxy
,
call
,
&
error
,
G_TYPE_STRV
,
&
OUT_details
,
G_TYPE_INVALID
);
(
*
(
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_details_reply
)
data
->
cb
)
(
proxy
,
OUT_details
,
error
,
data
->
userdata
);
return
;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall
*
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_details_async
(
DBusGProxy
*
proxy
,
const
gint
IN_index
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_details_reply
callback
,
gpointer
userdata
)
{
DBusGAsyncData
*
stuff
;
stuff
=
g_new
(
DBusGAsyncData
,
1
);
stuff
->
cb
=
G_CALLBACK
(
callback
);
stuff
->
userdata
=
userdata
;
return
dbus_g_proxy_begin_call
(
proxy
,
"getAudioDeviceDetails"
,
org_sflphone_SFLphone_ConfigurationManager_get_audio_device_details_async_callback
,
stuff
,
g_free
,
G_TYPE_INT
,
IN_index
,
G_TYPE_INVALID
);
}
#endif
/* defined DBUS_GLIB_CLIENT_WRAPPERS_org_sflphone_SFLphone_ConfigurationManager */
G_END_DECLS
sflphone-gtk/src/configwindow.c
View file @
85385193
...
...
@@ -138,7 +138,23 @@ config_window_fill_codec_list()
void
config_window_fill_audio_manager_list
()
{
GtkTreeIter
iter
;
gchar
**
list
;
gchar
*
managerName
;
gtk_list_store_clear
(
audioManagerStore
);
// Call dbus to retreive list
list
=
dbus_get_audio_manager_list
();
// For each API name included in list
int
c
=
0
;
for
(
managerName
=
list
[
c
];
managerName
!=
NULL
;
managerName
=
list
[
c
])
{
c
++
;
gtk_list_store_append
(
audioManagerStore
,
&
iter
);
gtk_list_store_set
(
audioManagerStore
,
&
iter
,
0
,
managerName
,
-
1
);
}
}
/**
...
...
@@ -147,7 +163,23 @@ config_window_fill_audio_manager_list()
void
config_window_fill_output_audio_device_list
()
{
GtkTreeIter
iter
;
gchar
**
list
;
gchar
*
audioDevice
;
gtk_list_store_clear
(
outputAudioDeviceManagerStore
);
// Call dbus to retreive list
list
=
dbus_get_audio_output_device_list
();
// For each device name included in list
int
c
=
0
;
for
(
audioDevice
=
list
[
c
];
audioDevice
!=
NULL
;
audioDevice
=
list
[
c
])
{
c
++
;
gtk_list_store_append
(
outputAudioDeviceManagerStore
,
&
iter
);
gtk_list_store_set
(
outputAudioDeviceManagerStore
,
&
iter
,
0
,
audioDevice
,
-
1
);
}
}
/**
...
...
@@ -156,7 +188,66 @@ config_window_fill_output_audio_device_list()
void
config_window_fill_input_audio_device_list
()
{
GtkTreeIter
iter
;
gchar
**
list
;
gchar
*
audioDevice
;
gtk_list_store_clear
(
inputAudioDeviceManagerStore
);
// Call dbus to retreive list
list
=
dbus_get_audio_input_device_list
();
// For each device name included in list
int
c
=
0
;
for
(
audioDevice
=
list
[
c
];
audioDevice
!=
NULL
;
audioDevice
=
list
[
c
])
{
c
++
;
gtk_list_store_append
(
inputAudioDeviceManagerStore
,
&
iter
);
gtk_list_store_set
(
inputAudioDeviceManagerStore
,
&
iter
,
0
,
audioDevice
,
-
1
);
}
}
/**
* TODO
*/
static
void
select_audio_manager
(
GtkWidget
*
widget
,
gpointer
data
)
{
dbus_set_audio_manager
(
"ALSA"
);
}
/**
*
*/
static
void
select_audio_output_device
(
GtkWidget
*
widget
,
gpointer
data
)
{
dbus_set_audio_output_device
(
8
);
}
/**
*
*/
static
void
select_audio_input_device
(
GtkWidget
*
widget
,
gpointer
data
)
{
dbus_set_audio_input_device
(
11
);
}
/**
* Refresh all audio settings
*/
static
void
detect_all_audio_settings
()
{
// TODO Remember selected entry for each list
// Update lists
config_window_fill_audio_manager_list
();
config_window_fill_output_audio_device_list
();
config_window_fill_input_audio_device_list
();
// Reselect entries or set to default
}
/**
...
...
@@ -403,7 +494,7 @@ bold_if_default_account(GtkTreeViewColumn *col,
/**
* TODO Action when restore default codecs is done
*
void
default_codecs(GtkWidget* widget, gpointer data)
{
...
...
@@ -667,7 +758,6 @@ create_audio_tab ()
GtkWidget
*
comboBox
;
GtkWidget
*
refreshButton
;
GtkCellRenderer
*
renderer
;
GtkTreeIter
iter
;
GtkWidget
*
codecTable
;
...
...
@@ -696,17 +786,18 @@ create_audio_tab ()
// Device : Audio manager
// Create title label
titleLabel
=
gtk_label_new
(
"Audio manager"
);
titleLabel
=
gtk_label_new
(
"Audio manager
:
"
);
gtk_misc_set_alignment
(
GTK_MISC
(
titleLabel
),
0
,
0
.
5
);
gtk_table_attach
(
GTK_TABLE
(
deviceTable
),
titleLabel
,
1
,
2
,
0
,
1
,
GTK_FILL
|
GTK_EXPAND
,
GTK_SHRINK
,
0
,
0
);
gtk_widget_show
(
titleLabel
);
gtk_widget_show
(
titleLabel
);
// Set choices of audio managers
audioManagerStore
=
gtk_list_store_new
(
1
,
G_TYPE_STRING
);
gtk_list_store_append
(
audioManagerStore
,
&
iter
);
gtk_list_store_set
(
audioManagerStore
,
&
iter
,
0
,
"ALSA"
,
-
1
);
config_window_fill_audio_manager_list
();
comboBox
=
gtk_combo_box_new_with_model
(
GTK_TREE_MODEL
(
audioManagerStore
));
gtk_combo_box_set_active
(
GTK_COMBO_BOX
(
comboBox
),
0
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
titleLabel
),
comboBox
);
g_signal_connect
(
G_OBJECT
(
comboBox
),
"changed"
,
G_CALLBACK
(
select_audio_manager
),
comboBox
);
// Set rendering
renderer
=
gtk_cell_renderer_text_new
();
gtk_cell_layout_pack_start
(
GTK_CELL_LAYOUT
(
comboBox
),
renderer
,
TRUE
);
...
...
@@ -722,12 +813,13 @@ create_audio_tab ()
gtk_widget_show
(
titleLabel
);
// Set choices of output devices
outputAudioDeviceManagerStore
=
gtk_list_store_new
(
1
,
G_TYPE_STRING
);
gtk_list_store_append
(
outputAudioDeviceManagerStore
,
&
iter
);
gtk_list_store_set
(
outputAudioDeviceManagerStore
,
&
iter
,
0
,
"Default"
,
-
1
);
config_window_fill_output_audio_device_list
();
comboBox
=
gtk_combo_box_new_with_model
(
GTK_TREE_MODEL
(
outputAudioDeviceManagerStore
));
gtk_combo_box_set_active
(
GTK_COMBO_BOX
(
comboBox
),
0
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
titleLabel
),
comboBox
);
// Set rendering
g_signal_connect
(
G_OBJECT
(
comboBox
),
"changed"
,
G_CALLBACK
(
select_audio_output_device
),
comboBox
);
// Set rendering
renderer
=
gtk_cell_renderer_text_new
();
gtk_cell_layout_pack_start
(
GTK_CELL_LAYOUT
(
comboBox
),
renderer
,
TRUE
);
gtk_cell_layout_set_attributes
(
GTK_CELL_LAYOUT
(
comboBox
),
renderer
,
"text"
,
0
,
NULL
);
...
...
@@ -742,12 +834,13 @@ create_audio_tab ()
gtk_widget_show
(
titleLabel
);
// Set choices of output devices
inputAudioDeviceManagerStore
=
gtk_list_store_new
(
1
,
G_TYPE_STRING
);
gtk_list_store_append
(
inputAudioDeviceManagerStore
,
&
iter
);
gtk_list_store_set
(
inputAudioDeviceManagerStore
,
&
iter
,
0
,
"Default"
,
-
1
);
config_window_fill_input_audio_device_list
();
comboBox
=
gtk_combo_box_new_with_model
(
GTK_TREE_MODEL
(
inputAudioDeviceManagerStore
));
gtk_combo_box_set_active
(
GTK_COMBO_BOX
(
comboBox
),
0
);
gtk_label_set_mnemonic_widget
(
GTK_LABEL
(
titleLabel
),
comboBox
);
// Set rendering
g_signal_connect
(
G_OBJECT
(
comboBox
),
"changed"
,
G_CALLBACK
(
select_audio_input_device
),
comboBox
);
// Set rendering
renderer
=
gtk_cell_renderer_text_new
();
gtk_cell_layout_pack_start
(
GTK_CELL_LAYOUT
(
comboBox
),
renderer
,
TRUE
);
gtk_cell_layout_set_attributes
(
GTK_CELL_LAYOUT
(
comboBox
),
renderer
,
"text"
,
0
,
NULL
);
...
...
@@ -758,6 +851,8 @@ create_audio_tab ()
refreshButton
=
gtk_button_new_with_label
(
"Detect all"
);
gtk_button_set_image
(
GTK_BUTTON
(
refreshButton
),
gtk_image_new_from_stock
(
GTK_STOCK_REFRESH
,
GTK_ICON_SIZE_BUTTON
));
gtk_table_attach
(
GTK_TABLE
(
deviceTable
),
refreshButton
,
3
,
4
,
0
,
3
,
GTK_EXPAND
,
GTK_EXPAND
,
0
,
0
);
// Set event on selection
g_signal_connect
(
G_OBJECT
(
refreshButton
),
"clicked"
,
G_CALLBACK
(
detect_all_audio_settings
),
NULL
);
// Codec section label
codecLabel
=
gtk_label_new
(
NULL
);
...
...
sflphone-gtk/src/dbus.c
View file @
85385193
...
...
@@ -2,6 +2,7 @@
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc@squidy.info>
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Guillaume Carmel-Archambault <guillaume.carmel-archambault@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -769,3 +770,190 @@ dbus_set_active_codec_list(const gchar** list)
}
}
/**
* Get a list of all supported audio managers
*/
gchar
**
dbus_get_audio_manager_list
()
{
g_print
(
"Before get audio manager list"
);
gchar
**
array
;
GError
*
error
=
NULL
;
org_sflphone_SFLphone_ConfigurationManager_get_audio_manager_list
(
configurationManagerProxy
,
&
array
,
&
error
);
g_print
(
"After"
);
if
(
error
)
{
g_printerr
(
"Failed to call get_audio_manager_list() on ConfigurationManager: %s
\n
"
,
error
->
message
);
g_error_free
(
error
);
}
else
g_print
(
"DBus called get_audio_manager_list() on ConfigurationManager
\n
"
);
return
array
;
}
/**
* Sets the audio manager from its name
* Still not used because ALSA is used by default
*/
void
dbus_set_audio_manager
(
gchar
*
audioManager
)
{
g_print
(
"Before set audio manager"
);
GError
*
error
=
NULL
;
org_sflphone_SFLphone_ConfigurationManager_set_audio_manager
(
configurationManagerProxy
,
audioManager
,
&
error
);
g_print
(
"After"
);
if
(
error
)
{
g_printerr
(
"Failed to call set_audio_manager() on ConfigurationManager: %s
\n
"
,
error
->
message
);
g_error_free
(
error
);
}
else
g_print
(
"DBus called set_audio_manager() on ConfigurationManager
\n
"
);
}
/**
* Get all output devices index supported by current audio manager
*/
gchar
**
dbus_get_audio_output_device_list
()
{
g_print
(
"Before get audio output device list"
);
gchar
**
array
;
GError
*
error
=
NULL
;
org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list
(
configurationManagerProxy
,
&
array
,
&
error
);
g_print
(
"After"
);
if
(
error
)
{
g_printerr
(
"Failed to call get_audio_output_device_list() on ConfigurationManager: %s
\n
"
,
error
->
message
);
g_error_free
(
error
);
}
else
g_print
(
"DBus called get_audio_output_device_list() on ConfigurationManager
\n
"
);
return
array
;
}
/**
* Set audio output device from its index
*/
void
dbus_set_audio_output_device
(
const
int
index
)
{
g_print
(
"Before set audio output device"
);
GError
*
error
=
NULL
;
org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device
(
configurationManagerProxy
,
index
,
&
error
);
g_print
(
"After"
);
if
(
error
)
{
g_printerr
(
"Failed to call set_audio_output_device() on ConfigurationManager: %s
\n
"
,
error
->
message
);
g_error_free
(
error
);
}
else
g_print
(
"DBus called set_audio_output_device() on ConfigurationManager
\n
"
);