diff src/main.c @ 4561:9df99116840a

[gaim-migrate @ 4842] This is the new sound subsystem Lots of stuff got renamed, and everything sound-wise is documented. Gaim now uses libaudiofile and libao to play sounds. Lots of ugly hacks were removed, and now we support playing audio through anything that libao will support. If you need to (you shouldn't) you can force libao to use a specific output driver, by putting a line into ~/.libao like: default_driver=esd You shouldn't need to do this, libao is pretty good at figuring out what driver to use. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 09 Feb 2003 01:55:35 +0000
parents 7521e29658bc
children 4b1e24835bbf
line wrap: on
line diff
--- a/src/main.c	Sun Feb 09 00:47:57 2003 +0000
+++ b/src/main.c	Sun Feb 09 01:55:35 2003 +0000
@@ -47,6 +47,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include "prpl.h"
+#include "sound.h"
 #include "gaim.h"
 #include "gaim-socket.h"
 #if HAVE_SIGNAL_H
@@ -71,6 +72,7 @@
 
 GtkWidget *mainwindow = NULL;
 
+
 int opt_away = 0;
 char *opt_away_arg = NULL;
 char *opt_rcfile_arg = NULL;
@@ -133,12 +135,11 @@
 	gtk_main_quit();
 }
 
-static int snd_tmout;
-int logins_not_muted = 1;
+static guint snd_tmout = 0;
 static gboolean sound_timeout(gpointer data)
 {
-	logins_not_muted = 1;
-	g_source_remove(snd_tmout);
+	gaim_sound_set_login_mute(FALSE);
+	snd_tmout = 0;
 	return FALSE;
 }
 
@@ -148,7 +149,10 @@
 void gaim_setup(struct gaim_connection *gc)
 {
 	if ((sound_options & OPT_SOUND_LOGIN) && (sound_options & OPT_SOUND_SILENT_SIGNON)) {
-		logins_not_muted = 0;
+		if(snd_tmout) {
+			g_source_remove(snd_tmout);
+		}
+		gaim_sound_set_login_mute(TRUE);
 		snd_tmout = g_timeout_add(10000, sound_timeout, NULL);
 	}
 }
@@ -526,6 +530,8 @@
 
 	setup_stock();
 
+	gaim_sound_init();
+
 #ifndef _WIN32
 	/* use the nice PNG icon for all the windows */
 	icon_path = g_build_filename(DATADIR, "pixmaps", "gaim.png", NULL);
@@ -899,7 +905,7 @@
 
 	gtk_main();
 	core_quit();
-	/* don't need ui_quit here because ui doesn't create anything */
+	gaim_sound_quit();
 #ifdef _WIN32
 	wgaim_cleanup();
 #endif