changeset 3284:7b867d79da96

[gaim-migrate @ 3302] Lex Spoon--perhaps the coolest name I've ever seen submit a patch (it's between him and Chris Blizzard) made it so commands can play sounds! Brilliant! committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Fri, 31 May 2002 02:26:53 +0000
parents f4f4232f4e83
children e71ade93b98f
files ChangeLog src/sound.c
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 31 02:00:41 2002 +0000
+++ b/ChangeLog	Fri May 31 02:26:53 2002 +0000
@@ -23,6 +23,7 @@
 	* Zephyr fixes (thanks, Arun A. Tharuvai)
 	* Aliases in buddy ticker
 	* Perl scripts can play Gaim sounds (thanks Andrew Rodland)
+	* Internal sounds can be played by commands (thanks Lex Spoon)
 	
 version 0.58 (05/13/2002):
 	* Bulgarian translation added (Thanks, Igel Itzo)
--- a/src/sound.c	Fri May 31 02:00:41 2002 +0000
+++ b/src/sound.c	Fri May 31 02:26:53 2002 +0000
@@ -481,7 +481,19 @@
 	}
 
 	else if ((sound_options & OPT_SOUND_CMD) && sound_cmd[0]) {
-		debug_printf("can't play internal sound with external command -- skipping\n");
+		char command[4096];
+		FILE *child;
+
+		g_snprintf(command, sizeof(command), sound_cmd, "-");
+		
+		child=popen(command, "w");
+		if(child == NULL) {
+			perror("popen");
+			return;
+ 	     }
+ 
+		fwrite(data, size, 1, child);
+		pclose(child);
 		return;
 	}