Re: [GnomeMeeting-devel-list] [PATCH] Sound Input only plugins?
- From: Georgi Georgiev <chutz gg3 net>
- To: gnomemeeting-devel-list gnome org
- Subject: Re: [GnomeMeeting-devel-list] [PATCH] Sound Input only plugins?
- Date: Tue, 5 Apr 2005 16:04:50 +0900
maillog: 05/04/2005-15:15:43(+0900): Георги Георгиев types
> maillog: 04/04/2005-19:53:18(+0200): Damien Sandras types
> >
> > Excellent idea! If you can implement this, it will go as is in CVS
> > because that is really the best solution.
> >
> > There is no need to present a choice to the user if it doesn't make
> > sense...
>
> Well, here it is.
>
> - The UI logic for the prefs window is added to manager_changed_nt in
> src/config.cpp (I hope that was the right place).
>
> - The druid in this patch is almost the same (GUI-wize) as the original
> one. I quickly had to revert some of my changes, so most of the split
> audio plugins code is there, it is just that the druid sets the output
> to be the same as the input.
>
> - Screenshots: http://gg3.net/~chutz/ss/gm/
> - druid-2.png shows the only noticeable difference in the interface
> (it displays both input and output managers on the last page)
> - prefs-?.png shows the prefs interface (it should probably be made a
> bit nicer, but I didn7t know how to hide the label).
Well, what do you know. I read a bit the gtk+ reference, and managed to
bring the prefs window back to its original state. :)
Screenshots of this version are the ones with an "A" in the name.
http://gg3.net/~chutz/ss/gm/
--
() Georgi Georgiev () QOTD: "When she hauled ass, it took three ()
() chutz gg3 net () trips." ()
() +81(90)2877-8845 () ()
diff -ru gnomemeeting/configure.in gnomemeeting.new/configure.in
--- gnomemeeting/configure.in 2005-04-05 14:20:48.000000000 +0900
+++ gnomemeeting.new/configure.in 2005-04-05 11:12:40.000000000 +0900
@@ -42,7 +42,7 @@
dnl ###########################################################################
dnl This is to check correct gconf installation
dnl ###########################################################################
-SCHEMA_AGE=55
+SCHEMA_AGE=56
AC_SUBST(SCHEMA_AGE)
diff -ru gnomemeeting/gnomemeeting.schemas.in.in gnomemeeting.new/gnomemeeting.schemas.in.in
--- gnomemeeting/gnomemeeting.schemas.in.in 2004-11-20 23:49:14.000000000 +0900
+++ gnomemeeting.new/gnomemeeting.schemas.in.in 2005-04-05 11:12:12.000000000 +0900
@@ -3,8 +3,19 @@
<gconfschemafile>
<schemalist>
<schema>
- <key>/schemas/apps/gnomemeeting/devices/audio/plugin</key>
- <applyto>/apps/gnomemeeting/devices/audio/plugin</applyto>
+ <key>/schemas/apps/gnomemeeting/devices/audio/output_plugin</key>
+ <applyto>/apps/gnomemeeting/devices/audio/output_plugin</applyto>
+ <owner>GnomeMeeting</owner>
+ <type>string</type>
+ <default>ALSA</default>
+ <locale name="C">
+ <short>Audio input plugin</short>
+ <long>The audio plugin that will be used to detect the devices and manage them</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/apps/gnomemeeting/devices/audio/input_plugin</key>
+ <applyto>/apps/gnomemeeting/devices/audio/input_plugin</applyto>
<owner>GnomeMeeting</owner>
<type>string</type>
<default>ALSA</default>
diff -ru gnomemeeting/src/config.cpp gnomemeeting.new/src/config.cpp
--- gnomemeeting/src/config.cpp 2005-01-31 01:35:48.000000000 +0900
+++ gnomemeeting.new/src/config.cpp 2005-04-05 14:54:46.000000000 +0900
@@ -789,7 +789,38 @@
gdk_threads_enter ();
+
+ if ((PString)gm_conf_entry_get_key(entry) == PString(AUDIO_DEVICES_KEY "input_plugin") ) {
+ // the input_plugin was changed, also change output_plugin
+ gm_conf_set_string(AUDIO_DEVICES_KEY "output_plugin", gm_conf_entry_get_string(entry));
+ }
+
GnomeMeeting::Process ()->DetectDevices ();
+
+ /*
+ * Don't try to show/hide the output_menu if we are setting input_plugin
+ * The devices are not refreshed before this function is called for the
+ * change to output_plugin, and it only disturbs the display
+ */
+ if ( (PString)gm_conf_entry_get_key(entry) != PString(AUDIO_DEVICES_KEY "input_plugin"))
+ {
+ /*
+ * Conditions for hiding the output_plugin menu:
+ * - The input and output plugins are the same
+ * - The input and output devices are the same
+ */
+ if (
+ PString(gm_conf_get_string(AUDIO_DEVICES_KEY "output_plugin")) ==
+ PString(gm_conf_get_string(AUDIO_DEVICES_KEY "input_plugin")) &&
+ GnomeMeeting::Process ()->GetAudioInputDevices() ==
+ GnomeMeeting::Process ()->GetAudioOutputDevices()
+ )
+ {
+ gm_prefs_window_display_output_plugin(GnomeMeeting::Process()->GetPrefsWindow(), FALSE);
+ } else {
+ gm_prefs_window_display_output_plugin(GnomeMeeting::Process()->GetPrefsWindow(), TRUE);
+ }
+ }
gdk_threads_leave ();
}
}
@@ -1471,8 +1502,11 @@
/* Notifiers to AUDIO_DEVICES_KEY */
- gm_conf_notifier_add (AUDIO_DEVICES_KEY "plugin",
+ gm_conf_notifier_add (AUDIO_DEVICES_KEY "input_plugin",
manager_changed_nt, prefs_window);
+ gm_conf_notifier_add (AUDIO_DEVICES_KEY "output_plugin",
+ manager_changed_nt, prefs_window);
+
gm_conf_notifier_add (AUDIO_DEVICES_KEY "output_device",
audio_device_changed_nt, NULL);
@@ -1597,6 +1631,9 @@
gm_conf_notifier_add (VIDEO_CODECS_KEY "transmitted_background_blocks",
tr_ub_changed_nt, NULL);
+ // FIXME: hide/show the output_plugin_menu... there has to be a better way.
+ gm_conf_set_string (AUDIO_DEVICES_KEY "output_plugin",
+ gm_conf_get_string(AUDIO_DEVICES_KEY "output_plugin"));
return TRUE;
}
diff -ru gnomemeeting/src/druid.cpp gnomemeeting.new/src/druid.cpp
--- gnomemeeting/src/druid.cpp 2004-11-21 01:42:36.000000000 +0900
+++ gnomemeeting.new/src/druid.cpp 2005-04-05 15:04:43.000000000 +0900
@@ -60,7 +60,9 @@
GtkWidget *video_test_button;
GtkWidget *kind_of_net;
GtkWidget *progress;
- GtkWidget *audio_manager;
+ GtkWidget *audio_input_manager;
+ // FIXME: input/output
+ // GtkWidget *audio_output_manager;
GtkWidget *video_manager;
GtkWidget *audio_player;
GtkWidget *audio_recorder;
@@ -140,6 +142,7 @@
gchar *&,
gchar *&,
gchar *&,
+ gchar *&,
gchar *&,
gchar *&,
gchar *&,
@@ -534,7 +537,8 @@
gchar * &name,
gchar * &mail,
gchar * &connection_type,
- gchar * &audio_manager,
+ gchar * &audio_input_manager,
+ gchar * &audio_output_manager,
gchar * &player,
gchar * &recorder,
gchar * &video_manager,
@@ -556,11 +560,18 @@
else
connection_type = "";
- child = GTK_BIN (dw->audio_manager)->child;
+ child = GTK_BIN (dw->audio_input_manager)->child;
+ if (child)
+ audio_input_manager = (gchar *) gtk_label_get_text (GTK_LABEL (child));
+ else
+ audio_input_manager = "";
+
+ // FIXME: input/output
+ child = GTK_BIN (dw->audio_input_manager)->child;
if (child)
- audio_manager = (gchar *) gtk_label_get_text (GTK_LABEL (child));
+ audio_output_manager = (gchar *) gtk_label_get_text (GTK_LABEL (child));
else
- audio_manager = "";
+ audio_output_manager = "";
child = GTK_BIN (dw->video_manager)->child;
if (child)
@@ -928,8 +939,8 @@
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- dw->audio_manager = gtk_option_menu_new ();
- gtk_box_pack_start (GTK_BOX (vbox), dw->audio_manager, FALSE, FALSE, 0);
+ dw->audio_input_manager = gtk_option_menu_new ();
+ gtk_box_pack_start (GTK_BOX (vbox), dw->audio_input_manager, FALSE, FALSE, 0);
label = gtk_label_new (NULL);
text = g_strdup_printf ("<i>%s</i>", _("The audio manager is the plugin that will manage your audio devices, ALSA is probably the best choice when available."));
@@ -939,6 +950,27 @@
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
+ label = gtk_label_new (" ");
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ // FIXME: input/output
+ /*
+ label = gtk_label_new (_("Please choose your audio output manager:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ dw->audio_output_manager = gtk_option_menu_new ();
+ gtk_box_pack_start (GTK_BOX (vbox), dw->audio_output_manager, FALSE, FALSE, 0);
+
+ label = gtk_label_new (NULL);
+ text = g_strdup_printf ("<i>%s</i>", _("The audio input manager is the plugin that will manage your audio input devices, ALSA is probably the best choice when available."));
+ gtk_label_set_markup (GTK_LABEL (label), text);
+ g_free (text);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
+ */
+
gtk_box_pack_start (GTK_BOX (page_standard->vbox), GTK_WIDGET (vbox),
TRUE, TRUE, 8);
@@ -1231,7 +1263,8 @@
gchar *name = NULL;
gchar *con_type = NULL;
gchar *mail = NULL;
- gchar *audio_manager = NULL;
+ gchar *audio_input_manager = NULL;
+ gchar *audio_output_manager = NULL;
gchar *player = NULL;
gchar *recorder = NULL;
gchar *video_manager = NULL;
@@ -1247,7 +1280,8 @@
name,
mail,
con_type,
- audio_manager,
+ audio_input_manager,
+ audio_output_manager,
player,
recorder,
video_manager,
@@ -1258,7 +1292,7 @@
/* Try to prevent a crossed mutex deadlock */
gdk_threads_leave ();
- ep->StartAudioTester (audio_manager, player, recorder);
+ ep->StartAudioTester (audio_input_manager, audio_output_manager, player, recorder);
gdk_threads_enter ();
}
else {
@@ -1281,7 +1315,8 @@
gchar *name = NULL;
gchar *con_type = NULL;
gchar *mail = NULL;
- gchar *audio_manager = NULL;
+ gchar *audio_input_manager = NULL;
+ gchar *audio_output_manager = NULL;
gchar *player = NULL;
gchar *recorder = NULL;
gchar *video_manager = NULL;
@@ -1295,7 +1330,8 @@
name,
mail,
con_type,
- audio_manager,
+ audio_input_manager,
+ audio_output_manager,
player,
recorder,
video_manager,
@@ -1350,7 +1386,8 @@
gchar **couple = NULL;
gchar *con_type = NULL;
gchar *mail = NULL;
- gchar *audio_manager = NULL;
+ gchar *audio_input_manager = NULL;
+ gchar *audio_output_manager = NULL;
gchar *player = NULL;
gchar *recorder = NULL;
gchar *video_manager = NULL;
@@ -1383,7 +1420,8 @@
name,
mail,
con_type,
- audio_manager,
+ audio_input_manager,
+ audio_output_manager,
player,
recorder,
video_manager,
@@ -1418,8 +1456,10 @@
/* Set the right devices and managers */
- if (audio_manager)
- gm_conf_set_string (AUDIO_DEVICES_KEY "plugin", audio_manager);
+ if (audio_input_manager)
+ gm_conf_set_string (AUDIO_DEVICES_KEY "input_plugin", audio_input_manager);
+ if (audio_output_manager)
+ gm_conf_set_string (AUDIO_DEVICES_KEY "output_plugin", audio_output_manager);
if (player)
gm_conf_set_string (AUDIO_DEVICES_KEY "output_device", player);
if (recorder)
@@ -1554,7 +1594,9 @@
gchar *mail = NULL;
gchar *text = NULL;
int kind_of_net = 0;
- gchar *audio_manager = NULL;
+ gchar *audio_input_manager = NULL;
+ // FIXME: input/output
+ // gchar *audio_output_manager = NULL;
gchar *video_manager = NULL;
BOOL ils_register = FALSE;
char **array = NULL;
@@ -1597,12 +1639,20 @@
gtk_option_menu_set_history (GTK_OPTION_MENU (dw->kind_of_net),
kind_of_net - 1);
- devs = GnomeMeeting::Process ()->GetAudioPlugins ();
+ devs = GnomeMeeting::Process ()->GetAudioInputPlugins ();
array = devs.ToCharArray ();
- audio_manager = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin");
- gm_dw_option_menu_update (dw->audio_manager, array, audio_manager);
+ audio_input_manager = gm_conf_get_string (AUDIO_DEVICES_KEY "input_plugin");
+ gm_dw_option_menu_update (dw->audio_input_manager, array, audio_input_manager);
free (array);
+ /*
+ devs = GnomeMeeting::Process ()->GetAudioOutputPlugins ();
+ array = devs.ToCharArray ();
+ audio_output_manager = gm_conf_get_string (AUDIO_DEVICES_KEY "output_plugin");
+ gm_dw_option_menu_update (dw->audio_output_manager, array, audio_output_manager);
+ free (array);
+ */
+
devs = GnomeMeeting::Process ()->GetVideoPlugins ();
array = devs.ToCharArray ();
video_manager = gm_conf_get_string (VIDEO_DEVICES_KEY "plugin");
@@ -1614,7 +1664,8 @@
gm_dw_check_name (GTK_WIDGET (data));
g_free (video_manager);
- g_free (audio_manager);
+ g_free (audio_input_manager);
+ // g_free (audio_output_manager);
g_free (mail);
g_free (firstname);
g_free (lastname);
@@ -1649,7 +1700,8 @@
GMH323EndPoint *ep = NULL;
GtkWidget *child = NULL;
- gchar *audio_manager = NULL;
+ gchar *audio_input_manager = NULL;
+ gchar *audio_output_manager = NULL;
gchar *player = NULL;
gchar *recorder = NULL;
PStringArray devices;
@@ -1666,12 +1718,20 @@
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dw->audio_test_button),
FALSE);
- child = GTK_BIN (dw->audio_manager)->child;
+ child = GTK_BIN (dw->audio_input_manager)->child;
+
+ if (child)
+ audio_input_manager = (gchar *) gtk_label_get_text (GTK_LABEL (child));
+ else
+ audio_input_manager = "";
+
+ // FIXME: input/output
+ child = GTK_BIN (dw->audio_input_manager)->child;
if (child)
- audio_manager = (gchar *) gtk_label_get_text (GTK_LABEL (child));
+ audio_output_manager = (gchar *) gtk_label_get_text (GTK_LABEL (child));
else
- audio_manager = "";
+ audio_output_manager = "";
player = gm_conf_get_string (AUDIO_DEVICES_KEY "output_device");
recorder = gm_conf_get_string (AUDIO_DEVICES_KEY "input_device");
@@ -1682,10 +1742,10 @@
* not for a random one.
*/
gnomemeeting_sound_daemons_suspend ();
- if (PString ("Quicknet") == audio_manager)
+ if (PString ("Quicknet") == audio_output_manager)
devices = OpalIxJDevice::GetDeviceNames ();
else
- devices = PSoundChannel::GetDeviceNames (audio_manager,
+ devices = PSoundChannel::GetDeviceNames (audio_output_manager,
PSoundChannel::Player);
if (devices.GetSize () == 0) {
@@ -1699,10 +1759,10 @@
gm_dw_option_menu_update (dw->audio_player, array, player);
free (array);
- if (PString ("Quicknet") == audio_manager)
+ if (PString ("Quicknet") == audio_input_manager)
devices = OpalIxJDevice::GetDeviceNames ();
else
- devices = PSoundChannel::GetDeviceNames (audio_manager,
+ devices = PSoundChannel::GetDeviceNames (audio_input_manager,
PSoundChannel::Recorder);
if (devices.GetSize () == 0) {
@@ -1809,7 +1869,8 @@
gchar *recorder = NULL;
gchar *video_recorder = NULL;
gchar *video_manager = NULL;
- gchar *audio_manager = NULL;
+ gchar *audio_input_manager = NULL;
+ gchar *audio_output_manager = NULL;
gchar *callto_url = NULL;
PStringArray devices;
@@ -1826,7 +1887,8 @@
name,
mail,
connection_type,
- audio_manager,
+ audio_input_manager,
+ audio_output_manager,
player,
recorder,
video_manager,
@@ -1835,7 +1897,7 @@
callto_url = g_strdup_printf ("callto:ils.seconix.com/%s",
mail ? mail : "");
- text = g_strdup_printf (_("You have now finished the GnomeMeeting configuration. All the settings can be changed in the GnomeMeeting preferences. Enjoy!\n\n\nConfiguration summary:\n\nUsername: %s\nConnection type: %s\nAudio manager: %s\nAudio player: %s\nAudio recorder: %s\nVideo manager: %s\nVideo input: %s\nCallto URL: %s\n"), name, connection_type, audio_manager, player, recorder, video_manager, video_recorder, !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dw->use_callto)) ? callto_url : _("None"));
+ text = g_strdup_printf (_("You have now finished the GnomeMeeting configuration. All the settings can be changed in the GnomeMeeting preferences. Enjoy!\n\n\nConfiguration summary:\n\nUsername: %s\nConnection type: %s\nAudio input manager: %s\nAudio output manager: %s\nAudio player: %s\nAudio recorder: %s\nVideo manager: %s\nVideo input: %s\nCallto URL: %s\n"), name, connection_type, audio_input_manager, audio_output_manager, player, recorder, video_manager, video_recorder, !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dw->use_callto)) ? callto_url : _("None"));
gnome_druid_page_edge_set_text (GNOME_DRUID_PAGE_EDGE (page), text);
g_free (callto_url);
diff -ru gnomemeeting/src/endpoint.cpp gnomemeeting.new/src/endpoint.cpp
--- gnomemeeting/src/endpoint.cpp 2005-02-15 05:06:38.000000000 +0900
+++ gnomemeeting.new/src/endpoint.cpp 2005-04-05 11:12:12.000000000 +0900
@@ -602,7 +602,8 @@
void
-GMH323EndPoint::StartAudioTester (gchar *audio_manager,
+GMH323EndPoint::StartAudioTester (gchar *audio_output_manager,
+ gchar *audio_input_manager,
gchar *audio_player,
gchar *audio_recorder)
{
@@ -612,7 +613,7 @@
delete (audio_tester);
audio_tester =
- new GMAudioTester (audio_manager, audio_player, audio_recorder);
+ new GMAudioTester (audio_output_manager, audio_input_manager, audio_player, audio_recorder);
}
@@ -1825,11 +1826,16 @@
#endif
{
gnomemeeting_threads_enter ();
- plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin");
if (is_encoding)
+ {
+ plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "input_plugin");
device = gm_conf_get_string (AUDIO_DEVICES_KEY "input_device");
+ }
else
+ {
+ plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "output_plugin");
device = gm_conf_get_string (AUDIO_DEVICES_KEY "output_device");
+ }
gnomemeeting_threads_leave ();
if (device.Find (_("No device found")) == P_MAX_INDEX) {
diff -ru gnomemeeting/src/endpoint.h gnomemeeting.new/src/endpoint.h
--- gnomemeeting/src/endpoint.h 2004-11-14 03:36:12.000000000 +0900
+++ gnomemeeting.new/src/endpoint.h 2005-04-05 11:12:12.000000000 +0900
@@ -380,6 +380,7 @@
*/
void StartAudioTester (gchar *,
gchar *,
+ gchar *,
gchar *);
diff -ru gnomemeeting/src/gnomemeeting.cpp gnomemeeting.new/src/gnomemeeting.cpp
--- gnomemeeting/src/gnomemeeting.cpp 2005-02-04 04:08:07.000000000 +0900
+++ gnomemeeting.new/src/gnomemeeting.cpp 2005-04-05 11:12:12.000000000 +0900
@@ -212,12 +212,14 @@
BOOL
GnomeMeeting::DetectDevices ()
{
- gchar *audio_plugin = NULL;
+ gchar *audio_output_plugin = NULL;
+ gchar *audio_input_plugin = NULL;
gchar *video_plugin = NULL;
PINDEX fake_idx;
- audio_plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin");
+ audio_output_plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "output_plugin");
+ audio_input_plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "input_plugin");
video_plugin = gm_conf_get_string (VIDEO_DEVICES_KEY "plugin");
PWaitAndSignal m(dev_access_mutex);
@@ -228,16 +230,20 @@
/* Detect the plugins */
- audio_managers = PSoundChannel::GetDriverNames ();
+ audio_output_managers = PSoundChannel::GetDriverNames ();
+ audio_input_managers = PSoundChannel::GetDriverNames ();
video_managers = PVideoInputDevice::GetDriverNames ();
fake_idx = video_managers.GetValuesIndex (PString ("FakeVideo"));
if (fake_idx != P_MAX_INDEX)
video_managers.RemoveAt (fake_idx);
- audio_managers += PString ("Quicknet");
+ audio_output_managers += PString ("Quicknet");
+ audio_input_managers += PString ("Quicknet");
- PTRACE (1, "Detected audio plugins: " << setfill (',') << audio_managers
+ PTRACE (1, "Detected audio output plugins: " << setfill (',') << audio_output_managers
+ << setfill (' '));
+ PTRACE (1, "Detected audio input plugins: " << setfill (',') << audio_input_managers
<< setfill (' '));
PTRACE (1, "Detected video plugins: " << setfill (',') << video_managers
<< setfill (' '));
@@ -250,26 +256,29 @@
/* No audio plugin => Exit */
- if (audio_managers.GetSize () == 0)
+ if (audio_output_managers.GetSize () == 0)
+ return FALSE;
+ if (audio_input_managers.GetSize () == 0)
return FALSE;
-
/* Detect the devices */
video_input_devices = PVideoInputDevice::GetDriversDeviceNames (video_plugin);
- if (PString ("Quicknet") == audio_plugin) {
+ if (PString ("Quicknet") == audio_output_plugin) {
+ audio_output_devices = OpalIxJDevice::GetDeviceNames ();
+ }
+ else {
+ audio_output_devices =
+ PSoundChannel::GetDeviceNames (audio_output_plugin, PSoundChannel::Player);
+ }
+ if (PString ("Quicknet") == audio_input_plugin) {
audio_input_devices = OpalIxJDevice::GetDeviceNames ();
- audio_output_devices = audio_input_devices;
}
else {
-
audio_input_devices =
- PSoundChannel::GetDeviceNames (audio_plugin, PSoundChannel::Recorder);
- audio_output_devices =
- PSoundChannel::GetDeviceNames (audio_plugin, PSoundChannel::Player);
+ PSoundChannel::GetDeviceNames (audio_input_plugin, PSoundChannel::Recorder);
}
-
if (audio_input_devices.GetSize () == 0)
audio_input_devices += PString (_("No device found"));
@@ -281,15 +290,16 @@
PTRACE (1, "Detected the following audio input devices: "
<< setfill (',') << audio_input_devices << setfill (' ')
- << " with plugin " << audio_plugin);
+ << " with plugin " << audio_input_plugin);
PTRACE (1, "Detected the following audio output devices: "
<< setfill (',') << audio_output_devices << setfill (' ')
- << " with plugin " << audio_plugin);
+ << " with plugin " << audio_output_plugin);
PTRACE (1, "Detected the following video input devices: "
<< setfill (',') << video_input_devices << setfill (' ')
<< " with plugin " << video_plugin);
- g_free (audio_plugin);
+ g_free (audio_input_plugin);
+ g_free (audio_output_plugin);
g_free (video_plugin);
gnomemeeting_sound_daemons_resume ();
@@ -540,7 +550,7 @@
PStringArray
-GnomeMeeting::GetAudioOutpoutDevices ()
+GnomeMeeting::GetAudioOutputDevices ()
{
PWaitAndSignal m(dev_access_mutex);
@@ -549,11 +559,19 @@
PStringArray
-GnomeMeeting::GetAudioPlugins ()
+GnomeMeeting::GetAudioOutputPlugins ()
+{
+ PWaitAndSignal m(dev_access_mutex);
+
+ return audio_output_managers;
+}
+
+PStringArray
+GnomeMeeting::GetAudioInputPlugins ()
{
PWaitAndSignal m(dev_access_mutex);
- return audio_managers;
+ return audio_input_managers;
}
diff -ru gnomemeeting/src/gnomemeeting.h gnomemeeting.new/src/gnomemeeting.h
--- gnomemeeting/src/gnomemeeting.h 2004-10-27 16:55:43.000000000 +0900
+++ gnomemeeting.new/src/gnomemeeting.h 2005-04-05 11:12:12.000000000 +0900
@@ -225,7 +225,7 @@
* for that.
* PRE : /
*/
- PStringArray GetAudioOutpoutDevices ();
+ PStringArray GetAudioOutputDevices ();
/* DESCRIPTION : /
@@ -234,7 +234,8 @@
* for that.
* PRE : /
*/
- PStringArray GetAudioPlugins ();
+ PStringArray GetAudioOutputPlugins ();
+ PStringArray GetAudioInputPlugins ();
/* DESCRIPTION : /
@@ -259,7 +260,8 @@
PStringArray video_input_devices;
PStringArray audio_input_devices;
PStringArray audio_output_devices;
- PStringArray audio_managers;
+ PStringArray audio_input_managers;
+ PStringArray audio_output_managers;
PStringArray video_managers;
diff -ru gnomemeeting/src/pref_window.cpp gnomemeeting.new/src/pref_window.cpp
--- gnomemeeting/src/pref_window.cpp 2005-01-31 01:35:48.000000000 +0900
+++ gnomemeeting.new/src/pref_window.cpp 2005-04-05 15:57:47.000000000 +0900
@@ -64,6 +64,7 @@
GtkWidget *sound_events_output;
GtkWidget *audio_recorder;
GtkWidget *video_device;
+ GtkWidget *output_plugin_menu;
};
@@ -1090,12 +1091,18 @@
subsection = gnome_prefs_subsection_new (prefs_window, container,
- _("Audio Plugin"), 1, 2);
+ _("Audio Plugins"), 1, 2);
/* Add all the fields for the audio manager */
- devs = GnomeMeeting::Process ()->GetAudioPlugins ();
+ devs = GnomeMeeting::Process ()->GetAudioInputPlugins ();
array = devs.ToCharArray ();
- gnome_prefs_string_option_menu_new (subsection, _("Audio plugin:"), array, AUDIO_DEVICES_KEY "plugin", _("The audio plugin that will be used to detect the devices and manage them."), 0);
+ gnome_prefs_string_option_menu_new (subsection, _("Audio plugin:"), array, AUDIO_DEVICES_KEY "input_plugin", _("The audio plugin that will be used to detect the devices and manage them."), 0);
+ free (array);
+
+ devs = GnomeMeeting::Process ()->GetAudioOutputPlugins ();
+ array = devs.ToCharArray ();
+ pw->output_plugin_menu =
+ gnome_prefs_string_option_menu_new (subsection, "Audio output plugin:", array, AUDIO_DEVICES_KEY "output_plugin", _("The audio plugin that will be used to detect and manage your output device."), 1);
free (array);
@@ -1105,7 +1112,7 @@
/* The player */
- devs = GnomeMeeting::Process ()->GetAudioOutpoutDevices ();
+ devs = GnomeMeeting::Process ()->GetAudioOutputDevices ();
array = devs.ToCharArray ();
pw->audio_player =
gnome_prefs_string_option_menu_new (subsection, _("Output device:"), array, AUDIO_DEVICES_KEY "output_device", _("Select the audio output device to use"), 0);
@@ -1974,3 +1981,18 @@
return window;
}
+void
+gm_prefs_window_display_output_plugin(GtkWidget *prefs_window, BOOL show)
+{
+ GmPreferencesWindow *pw = NULL;
+ g_return_if_fail (prefs_window != NULL);
+ pw = gm_pw_get_pw (prefs_window);
+ GList * w = gtk_widget_list_mnemonic_labels(pw->output_plugin_menu);
+ if (show) {
+ g_list_foreach(w, (GFunc)gtk_widget_show, NULL);
+ gtk_widget_show(pw->output_plugin_menu);
+ } else {
+ g_list_foreach(w, (GFunc)gtk_widget_hide, NULL);
+ gtk_widget_hide(pw->output_plugin_menu);
+ }
+}
diff -ru gnomemeeting/src/pref_window.h gnomemeeting.new/src/pref_window.h
--- gnomemeeting/src/pref_window.h 2004-08-18 06:09:22.000000000 +0900
+++ gnomemeeting.new/src/pref_window.h 2005-04-05 13:08:35.000000000 +0900
@@ -84,6 +84,12 @@
gm_prefs_window_new ();
+/* DESCRIPTION : /
+ * BEHAVIOR : Hides or shows the selection for the output plugin
+ * PRE : /
+ */
+void
+gm_prefs_window_display_output_plugin(GtkWidget *, BOOL);
#endif
diff -ru gnomemeeting/src/sound_handling.cpp gnomemeeting.new/src/sound_handling.cpp
--- gnomemeeting/src/sound_handling.cpp 2004-11-20 23:37:56.000000000 +0900
+++ gnomemeeting.new/src/sound_handling.cpp 2005-04-05 11:12:13.000000000 +0900
@@ -184,7 +184,7 @@
PString enable_event_conf_key;
PString event_conf_key;
- plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin");
+ plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "output_plugin");
if (event == "incoming_call_sound")
device = gm_conf_get_string (SOUND_EVENTS_KEY "output_device");
else
@@ -514,7 +514,8 @@
/* The Audio tester class */
- GMAudioTester::GMAudioTester (gchar *m,
+ GMAudioTester::GMAudioTester (gchar *mo,
+ gchar *mi,
gchar *p,
gchar *r)
:PThread (1000, NoAutoDeleteThread)
@@ -524,8 +525,10 @@
test_dialog = NULL;
test_label = NULL;
- if (m)
- audio_manager = PString (m);
+ if (mo)
+ audio_output_manager = PString (mo);
+ if (mi)
+ audio_input_manager = PString (mi);
if (p)
audio_player = PString (p);
if (r)
@@ -558,7 +561,8 @@
PWaitAndSignal m(quit_mutex);
thread_sync_point.Signal ();
- if (audio_manager.IsEmpty ()
+ if (audio_output_manager.IsEmpty ()
+ || audio_input_manager.IsEmpty ()
|| audio_recorder.IsEmpty ()
|| audio_player.IsEmpty ()
|| audio_recorder == PString (_("No device found"))
@@ -609,8 +613,8 @@
gtk_widget_show_all (GTK_DIALOG (test_dialog)->vbox);
gdk_threads_leave ();
- recorder = new GMAudioRP (this, audio_manager, audio_recorder, TRUE);
- player = new GMAudioRP (this, audio_manager, audio_player, FALSE);
+ recorder = new GMAudioRP (this, audio_input_manager, audio_recorder, TRUE);
+ player = new GMAudioRP (this, audio_output_manager, audio_player, FALSE);
while (!stop && !player->IsTerminated () && !recorder->IsTerminated ()) {
diff -ru gnomemeeting/src/sound_handling.h gnomemeeting.new/src/sound_handling.h
--- gnomemeeting/src/sound_handling.h 2004-09-10 18:44:23.000000000 +0900
+++ gnomemeeting.new/src/sound_handling.h 2005-04-05 11:12:13.000000000 +0900
@@ -115,6 +115,7 @@
*/
GMAudioTester (gchar *,
gchar *,
+ gchar *,
gchar *);
@@ -139,7 +140,8 @@
char *buffer_ring;
- PString audio_manager;
+ PString audio_output_manager;
+ PString audio_input_manager;
PString audio_player;
PString audio_recorder;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]