comparison src/sound.c @ 793:e38acbeb1cae

[xemacs-hg @ 2002-03-29 04:46:17 by ben] lots o' fixes etc/ChangeLog: New file. Separated out all entries for etc/ into their own ChangeLog. Includes entries for the following files: etc/BABYL, etc/BETA, etc/CHARSETS, etc/DISTRIB, etc/Emacs.ad, etc/FTP, etc/GNUS-NEWS, etc/GOATS, etc/HELLO, etc/INSTALL, etc/MACHINES, etc/MAILINGLISTS, etc/MSDOS, etc/MYTHOLOGY, etc/NEWS, etc/OXYMORONS, etc/PACKAGES, etc/README, etc/TUTORIAL, etc/TUTORIAL.de, etc/TUTORIAL.ja, etc/TUTORIAL.ko, etc/TUTORIAL.se, etc/aliases.ksh, etc/altrasoft-logo.xpm, etc/check_cygwin_setup.sh, etc/custom/example-themes/europe-theme.el, etc/custom/example-themes/ex-custom-file, etc/custom/example-themes/example-theme.el, etc/e/eterm.ti, etc/edt-user.doc, etc/enriched.doc, etc/etags.1, etc/gnuserv.1, etc/gnuserv.README, etc/package-index.LATEST.gpg, etc/package-index.LATEST.pgp, etc/photos/jan.png, etc/recycle.xpm, etc/refcard.tex, etc/sample.Xdefaults, etc/sample.emacs, etc/sgml/CATALOG, etc/sgml/HTML32.dtd, etc/skk/SKK.tut.E, etc/smilies/Face_ase.xbm, etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm, etc/smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm, etc/sounds, etc/toolbar, etc/toolbar/workshop-cap-up.xpm, etc/xemacs-ja.1, etc/xemacs.1, etc/yow.lines, etc\BETA, etc\NEWS, etc\README, etc\TUTORIAL, etc\TUTORIAL.de, etc\check_cygwin_setup.sh, etc\sample.init.el, etc\unicode\README, etc\unicode\mule-ucs\*, etc\unicode\other\* unicode/unicode-consortium/8859-16.TXT: New file. mule/english.el: Define this charset now, since a bug was fixed that formerly prevented it. mule/ethio-util.el: Fix compile errors involving Unicode `characters', which should be integers. Makefile.in.in: Always include gui.c, to fix compile error when TTY-only. EmacsFrame.c, abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, bytecode.h, callint.c, callproc.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.c, console-msw.h, console-tty.c, console-x.c, console-x.h, console.c, console.h, data.c, database.c, device-gtk.c, device-msw.c, device-x.c, device.c, device.h, dialog-msw.c, doc.c, doprnt.c, dumper.c, dynarr.c, editfns.c, eldap.c, eldap.h, elhash.c, elhash.h, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, events.h, extents.c, extents.h, faces.c, faces.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, free-hook.c, general-slots.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gtk-xemacs.c, gui-msw.c, gui-x.c, gui-x.h, gui.c, gui.h, gutter.c, gutter.h, indent.c, input-method-xlib.c, insdel.c, keymap.c, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-canna.c, mule-ccl.c, mule-charset.c, mule-wnnfns.c, native-gtk-toolbar.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, opaque.c, opaque.h, postgresql.c, postgresql.h, print.c, process-unix.c, process.c, process.h, rangetab.c, rangetab.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, search.c, select-gtk.c, select-x.c, sound.c, specifier.c, specifier.h, strftime.c, symbols.c, symeval.h, syntax.h, text.c, text.h, toolbar-common.c, toolbar-msw.c, toolbar.c, toolbar.h, tooltalk.c, tooltalk.h, ui-gtk.c, ui-gtk.h, undo.c, vm-limit.c, window.c, window.h: Eliminate XSETFOO. Replace all usages with wrap_foo(). Make symbol->name a Lisp_Object, not Lisp_String *. Eliminate nearly all uses of Lisp_String * in favor of Lisp_Object, and correct macros so most of them favor Lisp_Object. Create new error-behavior ERROR_ME_DEBUG_WARN -- output warnings, but at level `debug' (usually ignored). Use it when instantiating specifiers, so problems can be debugged. Move log-warning-minimum-level into C so that we can optimize ERROR_ME_DEBUG_WARN. Fix warning levels consistent with new definitions. Add default_ and parent fields to char table; not yet implemented. New fun Dynarr_verify(); use for further error checking on Dynarrs. Rearrange code at top of lisp.h in conjunction with dynarr changes. Fix eifree(). Use Eistrings in various places (format_event_object(), where_is_to_char(), and callers thereof) to avoid fixed-size strings buffers. New fun write_eistring(). Reindent and fix GPM code to follow standards. Set default MS Windows font to Lucida Console (same size as Courier New but less interline spacing, so more lines fit). Increase default frame size on Windows to 50 lines. (If that's too big for the workspace, the frame will be shrunk as necessary.) Fix problem with text files with no newlines (). (Change `convert-eol' coding system to use `nil' for autodetect, consistent with make-coding-system.) Correct compile warnings in vm-limit.c. Fix handling of reverse-direction charsets to avoid errors when opening (e.g.) mule-ucs/lisp/reldata/uiso8859-6.el. Recode some object printing methods to use write_fmt_string() instead of a fixed buffer and sprintf. Turn on display of png comments as warnings (level `info'), now that they're unobtrusive. Revamped the sound documentation. Fixed bug in redisplay w.r.t. hscroll/truncation/continuation glyphs causing jumping up and down of the lines, since they're bigger than the line size. (It was seen most obviously when there's a horizontal scroll bar, e.g. do C-h a glyph or something like that.) The problem was that the glyph-contrib-p setting on glyphs was ignored even if it was set properly, which it wasn't until now.
author ben
date Fri, 29 Mar 2002 04:49:13 +0000
parents 943eaba38521
children 79c6ff3eef26
comparison
equal deleted inserted replaced
792:4e83fdb13eb9 793:e38acbeb1cae
1 /* Sound functions. 1 /* Sound functions.
2 Copyright (C) 1992, 1993, 1994 Lucid Inc. 2 Copyright (C) 1992, 1993, 1994 Lucid Inc.
3 Copyright (C) 1994, 1995 Free Software Foundation, Inc. 3 Copyright (C) 1994, 1995 Free Software Foundation, Inc.
4 Copyright (C) 2002 Ben Wing.
4 5
5 This file is part of XEmacs. 6 This file is part of XEmacs.
6 7
7 XEmacs is free software; you can redistribute it and/or modify it 8 XEmacs is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
276 } 277 }
277 } 278 }
278 279
279 DEFUN ("play-sound", Fplay_sound, 1, 3, 0, /* 280 DEFUN ("play-sound", Fplay_sound, 1, 3, 0, /*
280 Play a sound of the provided type. 281 Play a sound of the provided type.
281 See the variable `sound-alist'. 282
283 SOUND can a symbol, specifying a sound to be looked up in `sound-alist'
284 \(generally, either the symbol directly maps to a sound or is an "abstract"
285 symbol that maps to another symbol and is used to specify the sound that is
286 played when a particular behavior occurs. `ding' lists the built-in
287 abstract sounds and their intended purpose.
288
289 SOUND can also be a string, which directly encodes the sound data to be played.
290
291 If SOUND is nil, the abstract sound `default' will be used.
292
293 VOLUME controls the volume (max is around 150? not sure).
294
295 DEVICE is the device to play the sound on (defaults to the selected device).
282 296
283 If the sound cannot be played in any other way, the standard "bell" will sound. 297 If the sound cannot be played in any other way, the standard "bell" will sound.
284 */ 298 */
285 (sound, volume, device)) 299 (sound, volume, device))
286 { 300 {
400 return Qnil; 414 return Qnil;
401 } 415 }
402 416
403 DEFUN ("ding", Fding, 0, 3, 0, /* 417 DEFUN ("ding", Fding, 0, 3, 0, /*
404 Beep, or flash the frame. 418 Beep, or flash the frame.
405 Also, unless an argument is given, 419
406 terminate any keyboard macro currently executing. 420 \(See `visible-bell'; setting this makes the frame flash instead of
407 When called from lisp, the second argument is what sound to make, and 421 beeping.) Also, unless NO-TERMINATE is given, terminate any keyboard macro
408 the third argument is the device to make it in (defaults to the selected 422 currently executing. SOUND specifies the sound to make and DEVICE the
409 device). 423 device to make it on (defaults to the selected device).
424
425 SOUND is either a string (raw data to be played directly), a symbol, or
426 `nil' (equivalent to the symbol `default'). Sound symbols are looked up in
427 `sound-alist', and resolve either to strings of data or to other symbols.
428 Sound symbols that map directly to data should be considered named sounds;
429 sound symbols that map to other sounds should be considered abstract
430 sounds, and are used when a particular behavior or state occurs.
431
432 Rremember that the sound symbol is the *second* argument to `ding', not the
433 first.
434
435 The following abstract sounds are used by XEmacs itself:
436
437 alarm when a package wants to remind the user
438 auto-save-error when an auto-save does not succeed
439 buffer-bound when you attempt to move off the end of a buffer
440 command-error any uncaught error (i.e. any error that the user
441 sees) except those handled by undefined-click,
442 undefined-key, buffer-bound, or read-only
443 default used when nothing else is appropriate.
444 isearch-failed unable to locate search text during incremental search
445 isearch-quit when you delete chars past the beginning of the search
446 text in isearch
447 no-completion during completing-read
448 quit when C-g is typed
449 read-only when you try to modify a read-only buffer
450 ready when a compile or other time-consuming task is done
451 undefined-click when you use an undefined mouse-click combination
452 undefined-key when you type a key that is undefined
453 warp XEmacs has changed the selected-window or frame
454 asynchronously -- e.g. a debugger breakpoint is hit
455 in an asynchronous process filter
456 y-or-n-p when you type something other than 'y' or 'n'
457 yes-or-no-p when you type something other than 'yes' or 'no'
458
459 Other lisp packages may use other beep types, but these are the ones that
460 the C kernel of Emacs uses.
461
410 */ 462 */
411 (arg, sound, device)) 463 (no_terminate, sound, device))
412 { 464 {
413 static time_t last_bell_time; 465 static time_t last_bell_time;
414 static struct device *last_bell_device; 466 static struct device *last_bell_device;
415 time_t now; 467 time_t now;
416 struct device *d = decode_device (device); 468 struct device *d = decode_device (device);
417 469
418 XSETDEVICE (device, d); 470 device = wrap_device (d);
419 now = time (0); 471 now = time (0);
420 472
421 if (NILP (arg) && !NILP (Vexecuting_macro)) 473 if (NILP (no_terminate) && !NILP (Vexecuting_macro))
422 /* Stop executing a keyboard macro. */ 474 /* Stop executing a keyboard macro. */
423 invalid_operation ("Keyboard macro terminated by a command ringing the bell", Qunbound); 475 invalid_operation ("Keyboard macro terminated by a command ringing the bell", Qunbound);
424 476
425 if (d == last_bell_device && now-last_bell_time < bell_inhibit_time) 477 if (d == last_bell_device && now-last_bell_time < bell_inhibit_time)
426 return Qnil; 478 return Qnil;
633 systems support sound. 685 systems support sound.
634 686
635 - The pitch, duration, and volume options are available everywhere, but 687 - The pitch, duration, and volume options are available everywhere, but
636 many X servers ignore the `pitch' option. 688 many X servers ignore the `pitch' option.
637 689
638 The following beep-types are used by emacs itself: 690 Sound symbols that map directly to data should be considered named sounds;
639 691 sound symbols that map to other sounds should be considered abstract
640 auto-save-error when an auto-save does not succeed 692 sounds, and are used when a particular behavior or state occurs. See
641 command-error when the emacs command loop catches an error 693 `ding' for a list of the standard abstract sounds.
642 undefined-key when you type a key that is undefined
643 undefined-click when you use an undefined mouse-click combination
644 no-completion during completing-read
645 y-or-n-p when you type something other than 'y' or 'n'
646 yes-or-no-p when you type something other than 'yes' or 'no'
647 default used when nothing else is appropriate.
648
649 Other lisp packages may use other beep types, but these are the ones that
650 the C kernel of Emacs uses.
651 */ ); 694 */ );
652 Vsound_alist = Qnil; 695 Vsound_alist = Qnil;
653 696
654 DEFVAR_LISP ("synchronous-sounds", &Vsynchronous_sounds /* 697 DEFVAR_LISP ("synchronous-sounds", &Vsynchronous_sounds /*
655 Play sounds synchronously, if non-nil. 698 Play sounds synchronously, if non-nil.