Mercurial > hg > xemacs-beta
comparison src/sound.c @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 8d2a9b52c682 |
children | 9f59509498e1 |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
71 (0-100, default specified by the `bell-volume' variable). | 71 (0-100, default specified by the `bell-volume' variable). |
72 The sound file must be in the Sun/NeXT U-LAW format except under Linux | 72 The sound file must be in the Sun/NeXT U-LAW format except under Linux |
73 where WAV files are also supported. | 73 where WAV files are also supported. |
74 DEVICE defaults to the selected device. | 74 DEVICE defaults to the selected device. |
75 */ | 75 */ |
76 (file, volume, device)) | 76 (file, volume, device)) |
77 { | 77 { |
78 /* This function can call lisp */ | 78 /* This function can GC */ |
79 int vol; | 79 int vol; |
80 #if defined (HAVE_NATIVE_SOUND) || defined (HAVE_NAS_SOUND) | 80 #if defined (HAVE_NATIVE_SOUND) || defined (HAVE_NAS_SOUND) |
81 struct device *d = decode_device (device); | 81 struct device *d = decode_device (device); |
82 #endif | 82 #endif |
83 struct gcpro gcpro1; | |
84 | |
85 CHECK_STRING (file); | 83 CHECK_STRING (file); |
86 if (NILP (volume)) | 84 if (NILP (volume)) |
87 vol = bell_volume; | 85 vol = bell_volume; |
88 else | 86 else |
89 { | 87 { |
90 CHECK_INT (volume); | 88 CHECK_INT (volume); |
91 vol = XINT (volume); | 89 vol = XINT (volume); |
92 } | 90 } |
93 | 91 |
94 GCPRO1 (file); | |
95 file = Fexpand_file_name (file, Qnil); | 92 file = Fexpand_file_name (file, Qnil); |
96 if (NILP (Ffile_readable_p (file))) | 93 if (NILP (Ffile_readable_p (file))) |
97 if (NILP (Ffile_exists_p (file))) | 94 if (NILP (Ffile_exists_p (file))) |
98 error ("file does not exist."); | 95 error ("file does not exist."); |
99 else | 96 else |
100 error ("file is unreadable."); | 97 error ("file is unreadable."); |
101 UNGCPRO; | |
102 | 98 |
103 #ifdef HAVE_NAS_SOUND | 99 #ifdef HAVE_NAS_SOUND |
104 if (DEVICE_CONNECTED_TO_NAS_P (d)) | 100 if (DEVICE_CONNECTED_TO_NAS_P (d)) |
105 { | 101 { |
106 char *fileext; | 102 char *fileext; |
353 | 349 |
354 DEFUN ("wait-for-sounds", Fwait_for_sounds, 0, 1, 0, /* | 350 DEFUN ("wait-for-sounds", Fwait_for_sounds, 0, 1, 0, /* |
355 Wait for all sounds to finish playing on DEVICE. | 351 Wait for all sounds to finish playing on DEVICE. |
356 */ | 352 */ |
357 (device)) | 353 (device)) |
354 | |
358 { | 355 { |
359 #ifdef HAVE_NAS_SOUND | 356 #ifdef HAVE_NAS_SOUND |
360 struct device *d = decode_device (device); | 357 struct device *d = decode_device (device); |
361 if (DEVICE_CONNECTED_TO_NAS_P (d)) | 358 if (DEVICE_CONNECTED_TO_NAS_P (d)) |
362 { | 359 { |