Mercurial > hg > xemacs-beta
comparison src/sound.c @ 265:8efd647ea9ca r20-5b31
Import from CVS: tag r20-5b31
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:25:37 +0200 |
parents | 51092a27c943 |
children | c5d627a313b1 |
comparison
equal
deleted
inserted
replaced
264:682d2a9d41a5 | 265:8efd647ea9ca |
---|---|
97 { | 97 { |
98 /* #### This is crockish. It might be a better idea to try | 98 /* #### This is crockish. It might be a better idea to try |
99 to open the file, and use report_file_error() if it | 99 to open the file, and use report_file_error() if it |
100 fails. --hniksic */ | 100 fails. --hniksic */ |
101 if (NILP (Ffile_exists_p (file))) | 101 if (NILP (Ffile_exists_p (file))) |
102 signal_simple_continuable_error ("File does not exist", file); | 102 file = |
103 signal_simple_continuable_error ("File does not exist", file); | |
103 else | 104 else |
104 signal_simple_continuable_error ("File is unreadable", file); | 105 file = |
106 signal_simple_continuable_error ("File is unreadable", file); | |
105 } | 107 } |
106 } | 108 } |
107 UNGCPRO; | 109 UNGCPRO; |
108 | 110 |
109 #ifdef HAVE_NAS_SOUND | 111 #ifdef HAVE_NAS_SOUND |
283 Else just beep. | 285 Else just beep. |
284 */ | 286 */ |
285 #ifdef HAVE_NAS_SOUND | 287 #ifdef HAVE_NAS_SOUND |
286 if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound)) | 288 if (DEVICE_CONNECTED_TO_NAS_P (d) && STRINGP (sound)) |
287 { | 289 { |
288 Extbyte *soundext; | 290 CONST Extbyte *soundext; |
289 Extcount soundextlen; | 291 Extcount soundextlen; |
290 | 292 |
291 GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); | 293 GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); |
292 if (nas_play_sound_data (soundext, soundextlen, vol)) | 294 if (nas_play_sound_data ((char*)soundext, soundextlen, vol)) |
293 return Qnil; | 295 return Qnil; |
294 } | 296 } |
295 #endif /* HAVE_NAS_SOUND */ | 297 #endif /* HAVE_NAS_SOUND */ |
296 | 298 |
297 #ifdef HAVE_NATIVE_SOUND | 299 #ifdef HAVE_NATIVE_SOUND |
298 if ((NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d)) | 300 if ((NILP (Vnative_sound_only_on_console) || DEVICE_ON_CONSOLE_P (d)) |
299 && STRINGP (sound)) | 301 && STRINGP (sound)) |
300 { | 302 { |
301 Extbyte *soundext; | 303 CONST Extbyte *soundext; |
302 Extcount soundextlen; | 304 Extcount soundextlen; |
303 | 305 |
304 GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); | 306 GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen); |
305 /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */ | 307 /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */ |
306 stop_interrupts (); | 308 stop_interrupts (); |
307 play_sound_data (soundext, soundextlen, vol); | 309 play_sound_data ((char*)soundext, soundextlen, vol); |
308 start_interrupts (); | 310 start_interrupts (); |
309 QUIT; | 311 QUIT; |
310 return Qnil; | 312 return Qnil; |
311 } | 313 } |
312 #endif /* HAVE_NATIVE_SOUND */ | 314 #endif /* HAVE_NATIVE_SOUND */ |
418 #ifdef HAVE_NATIVE_SOUND | 420 #ifdef HAVE_NATIVE_SOUND |
419 | 421 |
420 static void | 422 static void |
421 init_native_sound (struct device *d) | 423 init_native_sound (struct device *d) |
422 { | 424 { |
423 if (DEVICE_TTY_P (d) || DEVICE_STREAM_P (d)) | 425 if (DEVICE_TTY_P (d) || DEVICE_STREAM_P (d) || DEVICE_MSWINDOWS_P(d)) |
424 DEVICE_ON_CONSOLE_P (d) = 1; | 426 DEVICE_ON_CONSOLE_P (d) = 1; |
425 #ifdef HAVE_X_WINDOWS | 427 #ifdef HAVE_X_WINDOWS |
426 else | 428 else |
427 { | 429 { |
428 /* When running on a machine with native sound support, we cannot use | 430 /* When running on a machine with native sound support, we cannot use |