comparison src/sound.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3a7e78e1142d
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
124 #ifdef HAVE_NAS_SOUND 124 #ifdef HAVE_NAS_SOUND
125 if (DEVICE_CONNECTED_TO_NAS_P (d)) 125 if (DEVICE_CONNECTED_TO_NAS_P (d))
126 { 126 {
127 char *fileext; 127 char *fileext;
128 128
129 GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext); 129 TO_EXTERNAL_FORMAT (LISP_STRING, file,
130 C_STRING_ALLOCA, fileext,
131 Qfile_name);
130 /* #### NAS code should allow specification of a device. */ 132 /* #### NAS code should allow specification of a device. */
131 if (nas_play_sound_file (fileext, vol)) 133 if (nas_play_sound_file (fileext, vol))
132 return Qnil; 134 return Qnil;
133 } 135 }
134 #endif /* HAVE_NAS_SOUND */ 136 #endif /* HAVE_NAS_SOUND */
136 #ifdef HAVE_ESD_SOUND 138 #ifdef HAVE_ESD_SOUND
137 if (DEVICE_CONNECTED_TO_ESD_P (d)) 139 if (DEVICE_CONNECTED_TO_ESD_P (d))
138 { 140 {
139 char *fileext; 141 char *fileext;
140 142
141 GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext); 143 TO_EXTERNAL_FORMAT (LISP_STRING, file,
144 C_STRING_ALLOCA, fileext,
145 Qfile_name);
142 if (esd_play_sound_file (fileext, vol)) 146 if (esd_play_sound_file (fileext, vol))
143 return Qnil; 147 return Qnil;
144 } 148 }
145 #endif /* HAVE_ESD_SOUND */ 149 #endif /* HAVE_ESD_SOUND */
146 150
147 #ifdef HAVE_NATIVE_SOUND 151 #ifdef HAVE_NATIVE_SOUND
148 if (NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d)) 152 if (NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d))
149 { 153 {
150 CONST char *fileext; 154 CONST char *fileext;
151 155
152 GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext); 156 TO_EXTERNAL_FORMAT (LISP_STRING, file,
157 C_STRING_ALLOCA, fileext,
158 Qfile_name);
153 /* The sound code doesn't like getting SIGIO interrupts. 159 /* The sound code doesn't like getting SIGIO interrupts.
154 Unix sucks! */ 160 Unix sucks! */
155 stop_interrupts (); 161 stop_interrupts ();
156 play_sound_file ((char *) fileext, vol); 162 play_sound_file ((char *) fileext, vol);
157 start_interrupts (); 163 start_interrupts ();
312 if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound)) 318 if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound))
313 { 319 {
314 CONST Extbyte *soundext; 320 CONST Extbyte *soundext;
315 Extcount soundextlen; 321 Extcount soundextlen;
316 322
317 GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); 323 TO_EXTERNAL_FORMAT (LISP_STRING, sound,
324 ALLOCA, (soundext, soundextlen),
325 Qbinary);
318 if (nas_play_sound_data ((unsigned char*)soundext, soundextlen, vol)) 326 if (nas_play_sound_data ((unsigned char*)soundext, soundextlen, vol))
319 return Qnil; 327 return Qnil;
320 } 328 }
321 #endif /* HAVE_NAS_SOUND */ 329 #endif /* HAVE_NAS_SOUND */
322 330
324 if (DEVICE_CONNECTED_TO_ESD_P (d) && STRINGP (sound)) 332 if (DEVICE_CONNECTED_TO_ESD_P (d) && STRINGP (sound))
325 { 333 {
326 Extbyte *soundext; 334 Extbyte *soundext;
327 Extcount soundextlen; 335 Extcount soundextlen;
328 336
329 GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); 337 TO_EXTERNAL_FORMAT (LISP_STRING, sound, ALLOCA, (soundext, soundextlen),
338 Qbinary);
330 if (esd_play_sound_data (soundext, soundextlen, vol)) 339 if (esd_play_sound_data (soundext, soundextlen, vol))
331 return Qnil; 340 return Qnil;
332 } 341 }
333 #endif /* HAVE_ESD_SOUND */ 342 #endif /* HAVE_ESD_SOUND */
334 343
337 && STRINGP (sound)) 346 && STRINGP (sound))
338 { 347 {
339 CONST Extbyte *soundext; 348 CONST Extbyte *soundext;
340 Extcount soundextlen; 349 Extcount soundextlen;
341 350
342 GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); 351 TO_EXTERNAL_FORMAT (LISP_STRING, sound,
352 ALLOCA, (soundext, soundextlen),
353 Qbinary);
343 /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */ 354 /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */
344 stop_interrupts (); 355 stop_interrupts ();
345 play_sound_data ((unsigned char*)soundext, soundextlen, vol); 356 play_sound_data ((unsigned char*)soundext, soundextlen, vol);
346 start_interrupts (); 357 start_interrupts ();
347 QUIT; 358 QUIT;