Mercurial > hg > xemacs-beta
comparison src/sound.c @ 3072:4c038e89d563
[xemacs-hg @ 2005-11-16 07:22:37 by stephent]
Assorted minor fixes.
TODO comment in configure.ac:
<87irutytzq.fsf@tleepslib.sk.tsukuba.ac.jp>
Avoid warning, don't redefine integer types on Mac OS X:
<87ek5hytvq.fsf@tleepslib.sk.tsukuba.ac.jp>
Fix uninitialized variable:
<87acg5yttp.fsf@tleepslib.sk.tsukuba.ac.jp>
Eliminate warnings for unused parameters and functions:
<8764qtytrp.fsf@tleepslib.sk.tsukuba.ac.jp>
Quiet byte-compiler in select.el:
<871x1hytow.fsf@tleepslib.sk.tsukuba.ac.jp>
Quiet compiler about unused parameters in sound.el:
<87wtj9xf16.fsf@tleepslib.sk.tsukuba.ac.jp>
author | stephent |
---|---|
date | Wed, 16 Nov 2005 07:22:46 +0000 |
parents | 7844ab77b582 |
children | 34cfe24248f6 |
comparison
equal
deleted
inserted
replaced
3071:a80f978d8342 | 3072:4c038e89d563 |
---|---|
47 # include "sysproc.h" | 47 # include "sysproc.h" |
48 #endif | 48 #endif |
49 | 49 |
50 #ifdef WIN32_NATIVE | 50 #ifdef WIN32_NATIVE |
51 #include "syswindows.h" | 51 #include "syswindows.h" |
52 #endif | |
53 | |
54 #ifdef HAVE_NAS_SOUND | |
55 #define USED_IF_HAVE_NAS(decl) decl | |
56 #else | |
57 #define USED_IF_HAVE_NAS(decl) UNUSED (decl) | |
58 #endif | |
59 | |
60 #if defined(HAVE_NATIVE_SOUND) || defined(HAVE_NAS_SOUND) | |
61 #define USED_IF_HAVE_NATIVE_OR_NAS(decl) decl | |
62 #else | |
63 #define USED_IF_HAVE_NATIVE_OR_NAS(decl) UNUSED (decl) | |
64 #endif | |
65 | |
66 #if defined(HAVE_NATIVE_SOUND) || defined(HAVE_NAS_SOUND) \ | |
67 || defined(HAVE_ESD_SOUND) | |
68 #define USED_IF_HAVE_ANY(decl) decl | |
69 #else | |
70 #define USED_IF_HAVE_ANY(decl) UNUSED (decl) | |
52 #endif | 71 #endif |
53 | 72 |
54 #ifdef HAVE_ESD_SOUND | 73 #ifdef HAVE_ESD_SOUND |
55 extern int esd_play_sound_file (Extbyte *file, int vol); | 74 extern int esd_play_sound_file (Extbyte *file, int vol); |
56 extern int esd_play_sound_data (Binbyte *data, size_t length, int vol); | 75 extern int esd_play_sound_data (Binbyte *data, size_t length, int vol); |
85 On Unix machines the sound file must be in the Sun/NeXT U-LAW format | 104 On Unix machines the sound file must be in the Sun/NeXT U-LAW format |
86 except under Linux where WAV files are also supported. On Microsoft | 105 except under Linux where WAV files are also supported. On Microsoft |
87 Windows the sound file must be in WAV format. | 106 Windows the sound file must be in WAV format. |
88 DEVICE defaults to the selected device. | 107 DEVICE defaults to the selected device. |
89 */ | 108 */ |
90 (file, volume, device)) | 109 (file, volume, USED_IF_HAVE_ANY (device))) |
91 { | 110 { |
92 /* This function can call lisp */ | 111 /* This function can call lisp */ |
93 int vol; | 112 int vol; |
94 #if defined (HAVE_NATIVE_SOUND) || defined (HAVE_NAS_SOUND) \ | 113 #if defined (HAVE_NATIVE_SOUND) || defined (HAVE_NAS_SOUND) \ |
95 || defined (HAVE_ESD_SOUND) | 114 || defined (HAVE_ESD_SOUND) |
400 } | 419 } |
401 | 420 |
402 DEFUN ("device-sound-enabled-p", Fdevice_sound_enabled_p, 0, 1, 0, /* | 421 DEFUN ("device-sound-enabled-p", Fdevice_sound_enabled_p, 0, 1, 0, /* |
403 Return t if DEVICE is able to play sound. Defaults to selected device. | 422 Return t if DEVICE is able to play sound. Defaults to selected device. |
404 */ | 423 */ |
405 (device)) | 424 (USED_IF_HAVE_NATIVE_OR_NAS (device))) |
406 { | 425 { |
407 #ifdef HAVE_NAS_SOUND | 426 #ifdef HAVE_NAS_SOUND |
408 if (DEVICE_CONNECTED_TO_NAS_P (decode_device (device))) | 427 if (DEVICE_CONNECTED_TO_NAS_P (decode_device (device))) |
409 return Qt; | 428 return Qt; |
410 #endif | 429 #endif |
485 last_bell_time = now; | 504 last_bell_time = now; |
486 last_bell_device = d; | 505 last_bell_device = d; |
487 return Qnil; | 506 return Qnil; |
488 } | 507 } |
489 | 508 |
490 #ifdef HAVE_NAS_SOUND | |
491 #define USED_IF_HAVE_NAS(decl) decl | |
492 #else | |
493 #define USED_IF_HAVE_NAS(decl) UNUSED (decl) | |
494 #endif | |
495 | |
496 DEFUN ("wait-for-sounds", Fwait_for_sounds, 0, 1, 0, /* | 509 DEFUN ("wait-for-sounds", Fwait_for_sounds, 0, 1, 0, /* |
497 Wait for all sounds to finish playing on DEVICE. | 510 Wait for all sounds to finish playing on DEVICE. |
498 */ | 511 */ |
499 (USED_IF_HAVE_NAS (device))) | 512 (USED_IF_HAVE_NAS (device))) |
500 { | 513 { |
606 } | 619 } |
607 | 620 |
608 #endif /* HAVE_NATIVE_SOUND */ | 621 #endif /* HAVE_NATIVE_SOUND */ |
609 | 622 |
610 void | 623 void |
611 init_device_sound (struct device *d) | 624 init_device_sound (struct device * USED_IF_HAVE_NATIVE_OR_NAS (d)) |
612 { | 625 { |
613 #ifdef HAVE_NAS_SOUND | 626 #ifdef HAVE_NAS_SOUND |
614 init_nas_sound (d); | 627 init_nas_sound (d); |
615 #endif | 628 #endif |
616 | 629 |