diff src/sgiplay.c @ 609:13e3d7ae7155

[xemacs-hg @ 2001-06-06 12:34:42 by ben] nitpicky fixes: emodules.c, tooltalk.c, process-unix.c: Fix warnings pointed out by Martin. lisp.h: Correct usage of CBufbyte. esd.c: indentation changes. bytecode.c, eval.c, fileio.c: Use CBufbyte instead of char for error/warning functions. linuxplay.c, miscplay.c, sgiplay.c, sunplay.c: Define DONT_ENCAPSULATE. (All encapsulation is removed in my pending Mule workspace.) sgiplay.c: Put back #include <audio.h> accidentally removed. Make play_sound_data return an int, like all other such functions in *play.c. sound.c: Fix up documentation of `play-sound'. sysfile.h: Don't include sys/fcntl.h, as per Martin's advice.
author ben
date Wed, 06 Jun 2001 12:34:47 +0000
parents 183866b06e0b
children 943eaba38521
line wrap: on
line diff
--- a/src/sgiplay.c	Mon Jun 04 17:00:02 2001 +0000
+++ b/src/sgiplay.c	Wed Jun 06 12:34:47 2001 +0000
@@ -23,6 +23,8 @@
 
 /* This file Mule-ized by Ben Wing, 5-15-01. */
 
+#define DONT_ENCAPSULATE
+
 #include <config.h>
 #include "lisp.h"
 
@@ -31,6 +33,8 @@
 #include "sysfile.h"
 #include "sysproc.h" /* netinet/in.h for ntohl() etc. */
 
+#include <audio.h>
+
 /* Configuration options */
 
 /* ability to parse Sun/NeXT (.au or .snd) audio file headers.  The
@@ -173,7 +177,7 @@
 
 static Lisp_Object close_sound_file (Lisp_Object);
 static AudioContext audio_initialize (UChar_Binary *, int, int);
-static void play_internal (UChar_Binary *, int, AudioContext);
+static int play_internal (UChar_Binary *, int, AudioContext);
 static void drain_audio_port (AudioContext);
 static void write_mulaw_8_chunk (void *, void *, AudioContext);
 static void write_linear_chunk (void *, void *, AudioContext);
@@ -253,18 +257,20 @@
   return Qnil;
 }
 
-void
+int
 play_sound_data (UChar_Binary *data, int length, int volume)
 {
   int count = specpdl_depth ();
   AudioContext ac;
+  int result;
 
   ac = audio_initialize (data, length, volume);
   if (ac == (AudioContext) 0)
-    return;
-  play_internal (data, length, ac);
+    return 0;
+  result = play_internal (data, length, ac);
   drain_audio_port (ac);
   unbind_to (count, Qnil);
+  return result;
 }
 
 static AudioContext
@@ -311,12 +317,12 @@
   return ac;
 }
 
-static void
+static int
 play_internal (UChar_Binary *data, int length, AudioContext ac)
 {
   UChar_Binary * limit;
   if (ac == (AudioContext) 0)
-    return;
+    return 0;
 
   data = (UChar_Binary *) ac->ac_data;
   limit = data + ac->ac_size;
@@ -332,6 +338,8 @@
       (* ac->ac_write_chunk_function) (data, chunklimit, ac);
       data = chunklimit;
     }
+
+  return 1;
 }
 
 static void