changeset 11082:e25575a59f01

[gaim-migrate @ 13099] Use libao to play stuff over NAS instead of accessing NAS directly. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 10 Jul 2005 22:12:37 +0000
parents 3fc99df46dae
children 8faabf4081ca
files ChangeLog configure.ac src/gtkdialogs.c src/gtkprefs.c src/gtksound.c
diffstat 5 files changed, 11 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jul 10 20:33:19 2005 +0000
+++ b/ChangeLog	Sun Jul 10 22:12:37 2005 +0000
@@ -42,6 +42,8 @@
 	* Newly installed plugins can now be activated without restarting Gaim
 	  (Sadrul Habib Chowdhury)
 	* The Evolution Integration plugin now supports Groupwise contacts
+	* Use libao for playing sounds via NAS instead of accessing NAS
+	  directly
 
 	Bug fixes:
 	* People using input methods can now use Enter again.
--- a/configure.ac	Sun Jul 10 20:33:19 2005 +0000
+++ b/configure.ac	Sun Jul 10 22:12:37 2005 +0000
@@ -245,7 +245,6 @@
 AM_CONDITIONAL(DYNAMIC_ZEPHYR, test "x$dynamic_zephyr" = "xyes")
 
 AC_ARG_ENABLE(audio,   [  --disable-audio         compile without libao/libaudiofile for sound playing],,enable_audio=yes)
-AC_ARG_ENABLE(nas,     [  --enable-nas            enable NAS (Network Audio System) support],,enable_nas=no)
 AC_ARG_ENABLE(plugins, [  --disable-plugins       compile without plugin support],,enable_plugins=yes)
 AC_ARG_ENABLE(perl,    [  --disable-perl          compile without perl scripting],,enable_perl=yes)
 AC_ARG_ENABLE(tcl,     [  --disable-tcl	          compile without Tcl scripting],,enable_tcl=yes)
@@ -1065,11 +1064,6 @@
 	fi
 fi
 
-if test "$enable_nas" = yes ; then
-	AC_DEFINE(USE_NAS_AUDIO, 1, [Define if we have NAS sound support.])
-	SOUND_LIBS="$SOUND_LIBS -laudio -lXt"
-fi
-
 if test "$enable_audio" = yes ; then
 	GAIM_PATH_AO(found_ao_lib=true)
 
@@ -1309,7 +1303,6 @@
 echo Build with Tcl support........ : $enable_tcl
 echo Build with Tk support......... : $enable_tk
 echo Build with Audio support...... : $enable_audio
-echo Build with NAS support........ : $enable_nas
 echo Build with GtkSpell support... : $enable_gtkspell
 echo Build with DBUS support....... : $enable_dbus
 echo Has you....................... : yes
--- a/src/gtkdialogs.c	Sun Jul 10 20:33:19 2005 +0000
+++ b/src/gtkdialogs.c	Sun Jul 10 22:12:37 2005 +0000
@@ -388,12 +388,6 @@
 	g_string_append(str, "    <b>libao:</b> Disabled<br/>");
 #endif
 
-#ifdef USE_NAS_AUDIO
-	g_string_append(str, "    <b>Network Audio System (NAS):</b> Enabled<br/>");
-#else
-	g_string_append(str, "    <b>Network Audio System (NAS):</b> Disabled<br/>");
-#endif
-
 #ifdef HAVE_NSS
 	g_string_append(str, "    <b>Network Security Services (NSS):</b> Enabled<br/>");
 #else
--- a/src/gtkprefs.c	Sun Jul 10 20:33:19 2005 +0000
+++ b/src/gtkprefs.c	Sun Jul 10 22:12:37 2005 +0000
@@ -1557,7 +1557,7 @@
 	GtkWidget *hbox;
 	int j;
 	const char *file;
-	char *pref;	
+	char *pref;
 #ifndef _WIN32
 	GtkWidget *dd;
 	GtkWidget *label;
@@ -1577,10 +1577,8 @@
 			_("Console beep"), "beep",
 #ifdef USE_AO
 			_("Automatic"), "automatic",
+			"Arts", "arts",
 			"ESD", "esd",
-			"Arts", "arts",
-#endif
-#ifdef USE_NAS_AUDIO
 			"NAS", "nas",
 #endif
 			_("Command"), "custom",
--- a/src/gtksound.c	Sun Jul 10 20:33:19 2005 +0000
+++ b/src/gtksound.c	Sun Jul 10 22:12:37 2005 +0000
@@ -36,11 +36,6 @@
 # include <audiofile.h>
 #endif /* USE_AO */
 
-#ifdef USE_NAS_AUDIO
-# include <audio/audiolib.h>
-# include <audio/soundlib.h>
-#endif /* USE_NAS_AUDIO */
-
 #include "debug.h"
 #include "notify.h"
 #include "prefs.h"
@@ -117,6 +112,8 @@
 		ao_driver = ao_driver_id("esd");
 	else if(!strcmp(val, "arts"))
 		ao_driver = ao_driver_id("arts");
+	else if(!strcmp(val, "nas"))
+		ao_driver = ao_driver_id("nas");
 	else if(!strcmp(val, "automatic"))
 		ao_driver = ao_default_driver_id();
 
@@ -126,11 +123,6 @@
 						"Sound output driver loaded: %s\n", info->name);
 	}
 #endif /* USE_AO */
-#ifdef USE_NAS
-	if (!strcmp(val, "nas"))
-		gaim_debug_info("sound",
-						"Sound output driver loaded: NAS output\n");
-#endif /* USE_NAS */
 }
 
 const char *
@@ -220,24 +212,7 @@
 	gaim_debug_unregister_category("sound");
 }
 
-#ifdef USE_NAS_AUDIO
-static gboolean
-play_file_nas(const char *filename)
-{
-	AuServer *nas_serv;
-	gboolean ret = FALSE;
-
-	if((nas_serv = AuOpenServer(NULL, 0, NULL, 0, NULL, NULL))) {
-		ret = AuSoundPlaySynchronousFromFile(nas_serv, filename, 100);
-		AuCloseServer(nas_serv);
-	}
-
-	return ret;
-}
-
-#endif /* USE_NAS_AUDIO */
-
-#if defined(USE_NAS_AUDIO) || defined(USE_AO)
+#if defined(USE_AO)
 static gboolean
 expire_old_child(gpointer data)
 {
@@ -260,7 +235,7 @@
 gaim_gtk_sound_play_file(const char *filename)
 {
 	const char *method;
-#if defined(USE_NAS_AUDIO) || defined(USE_AO)
+#if defined(USE_AO)
 	pid_t pid;
 #ifdef USE_AO
 	AFfilehandle file;
@@ -320,18 +295,11 @@
 		g_free(command);
 		return;
 	}
-#if defined(USE_NAS_AUDIO) || defined(USE_AO)
+#if defined(USE_AO)
 	pid = fork();
 	if (pid < 0)
 		return;
 	else if (pid == 0) {
-#ifdef USE_NAS_AUDIO
-		if (!strcmp(method, "nas")) {
-			if (play_file_nas(filename))
-				_exit(0);
-		}
-#endif /* USE_NAS_AUDIO */
-
 #ifdef USE_AO
 		file = afOpenFile(filename, "rb", NULL);
 		if(file) {
@@ -387,10 +355,10 @@
 	} else {
 		gaim_timeout_add(PLAY_SOUND_TIMEOUT, expire_old_child, GINT_TO_POINTER(pid));
 	}
-#else /* USE_NAS_AUDIO || USE_AO */
+#else /* USE_AO */
 	gdk_beep();
 	return;
-#endif /* USE_NAS_AUDIO || USE_AO */
+#endif /* USE_AO */
 #else /* _WIN32 */
 	gaim_debug_info("sound", "Playing %s\n", filename);