changeset 6199:eb0fedc1ac09

[gaim-migrate @ 6685] music to my ears committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 18 Jul 2003 01:36:53 +0000
parents fcc28f5dd0c8
children ad3897fb6965
files ChangeLog src/gtksound.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 18 01:34:45 2003 +0000
+++ b/ChangeLog	Fri Jul 18 01:36:53 2003 +0000
@@ -11,6 +11,7 @@
 	* MSN messages with newlines are now sent correctly to MSN clients.
 	* Italian translation updated (Claudio Satriano)
 	* British English "translation" added (Sam Halliday)
+	* Fix some sound initialization stuff
 
 version 0.65 (07/16/2003):
 	* French translation updated (Eric (Zongo) Boumaour)
--- a/src/gtksound.c	Fri Jul 18 01:34:45 2003 +0000
+++ b/src/gtksound.c	Fri Jul 18 01:36:53 2003 +0000
@@ -54,6 +54,7 @@
 
 static gboolean mute_login_sounds = FALSE;
 static gboolean mute_sounds = FALSE;
+static gboolean sound_initialized = FALSE;
 static char *sound_cmd = NULL;
 
 static struct gaim_sound_event sounds[GAIM_NUM_SOUNDS] = {
@@ -115,7 +116,6 @@
 
 	gaim_prefs_connect_callback("/gaim/gtk/sound/method",
 			_pref_sound_method_changed, NULL);
-	gaim_prefs_trigger_callback("/gaim/gtk/sound/method");
 }
 
 
@@ -124,6 +124,7 @@
 #ifdef USE_AO
 	ao_shutdown();
 #endif
+	sound_initialized = FALSE;
 }
 
 static void gaim_gtk_sound_play_file(const char *filename)
@@ -136,6 +137,9 @@
 #endif
 #endif
 
+	if (!sound_initialized)
+		gaim_prefs_trigger_callback("/gaim/gtk/sound/method");
+
 	if (mute_sounds)
 		return;
 
@@ -308,6 +312,8 @@
 
 static void _pref_sound_method_changed(const char *name, GaimPrefType type,
 		gpointer val, gpointer data) {
+	sound_initialized = TRUE;
+
 	if(type != GAIM_PREF_STRING || strcmp(name, "/gaim/gtk/sound/method"))
 		return;
 #ifdef USE_AO