Mercurial > hg > xemacs-beta
comparison lisp/sound.el @ 384:bbff43aa5eb7 r21-2-7
Import from CVS: tag r21-2-7
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:08:24 +0200 |
parents | 6240c7796c7a |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
383:6a50c6a581a5 | 384:bbff43aa5eb7 |
---|---|
80 (integer :tag "Pitch")) | 80 (integer :tag "Pitch")) |
81 (group :inline t | 81 (group :inline t |
82 (const :format "" :value :duration) | 82 (const :format "" :value :duration) |
83 (integer :tag "Duration")))))) | 83 (integer :tag "Duration")))))) |
84 | 84 |
85 (defcustom sound-load-alist | 85 (defcustom sound-load-list |
86 '((load-sound-file "drum-beep" 'drum) | 86 '((load-sound-file "drum-beep" 'drum) |
87 (load-sound-file "quiet-beep" 'quiet) | 87 (load-sound-file "quiet-beep" 'quiet) |
88 (load-sound-file "bass-snap" 'bass 80) | 88 (load-sound-file "bass-snap" 'bass 80) |
89 (load-sound-file "whip" 'whip 70) | 89 (load-sound-file "whip" 'whip 70) |
90 (load-sound-file "cuckoo" 'cuckoo) | 90 (load-sound-file "cuckoo" 'cuckoo) |
103 "Default directory to load a sound file from." | 103 "Default directory to load a sound file from." |
104 :group 'sound | 104 :group 'sound |
105 :type 'directory | 105 :type 'directory |
106 ) | 106 ) |
107 | 107 |
108 (defcustom sound-ext (if (or (eq system-type 'cygwin32) | 108 (defcustom sound-extension-list (if (or (eq system-type 'cygwin32) |
109 (eq system-type 'windows-nt)) | 109 (eq system-type 'windows-nt)) |
110 ".wav:" ".au:") | 110 ".wav:" ".au:") |
111 "Filename extensions to complete sound file name with. If more than one | 111 "Filename extensions to complete sound file name with. If more than one |
112 extension is used, they should be separated by \":\". " | 112 extension is used, they should be separated by \":\". " |
113 :group 'sound | 113 :group 'sound |
114 :type 'string) | 114 :type 'string) |
115 | 115 |
142 (error "sound-name not a symbol")) | 142 (error "sound-name not a symbol")) |
143 (unless (or (null volume) (integerp volume)) | 143 (unless (or (null volume) (integerp volume)) |
144 (error "volume not an integer or nil")) | 144 (error "volume not an integer or nil")) |
145 (let (buf | 145 (let (buf |
146 data | 146 data |
147 (file (locate-file filename default-sound-directory-list sound-ext))) | 147 (file (locate-file filename default-sound-directory-list sound-extension-list))) |
148 (unless file | 148 (unless file |
149 (error "Couldn't load sound file %s" filename)) | 149 (error "Couldn't load sound file %s" filename)) |
150 (unwind-protect | 150 (unwind-protect |
151 (save-excursion | 151 (save-excursion |
152 (set-buffer (setq buf (get-buffer-create " *sound-tmp*"))) | 152 (set-buffer (setq buf (get-buffer-create " *sound-tmp*"))) |
178 (interactive) | 178 (interactive) |
179 ;; #### - this should do NOTHING if the sounds can't be played. | 179 ;; #### - this should do NOTHING if the sounds can't be played. |
180 (message "Loading sounds...") | 180 (message "Loading sounds...") |
181 (setq sound-alist nil) | 181 (setq sound-alist nil) |
182 ;; this is where the calls to load-sound-file get done | 182 ;; this is where the calls to load-sound-file get done |
183 (mapc 'eval sound-load-alist) | 183 (mapc 'eval sound-load-list) |
184 (setq sound-alist | 184 (setq sound-alist |
185 (append sound-default-alist | 185 (append sound-default-alist |
186 sound-alist)) | 186 sound-alist)) |
187 (message "Loading sounds...done") | 187 (message "Loading sounds...done") |
188 ;; (beep nil 'quiet) | 188 ;; (beep nil 'quiet) |