Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 6 - Dialog Manager / Dialog Manager Reference
Application-Defined Routines /


MyAlertSound

If you want the Dialog Manager to play sounds other than the system alert sound, write your own sound procedure and call the ErrorSound procedure to make it the current sound procedure. For example, you can declare a sound procedure named MyAlertSound, as shown here:

PROCEDURE MyAlertSound (soundNo: Integer);
soundNo
An integer from 0 to 3, representing the four possible alert stages.
DESCRIPTION
For each of the four alert stages that can be reported in the soundNo parameter, your procedure can emit any sound that you define. When the Dialog Manager calls your procedure, it passes 0 as the sound number for alert sounds specified by the silent constant in the alert resource. The Dialog Manager passes 1 for sounds specified by the sound1 constant, 2 for sounds specified by the sound2 constant, and 3 for sounds specified by the sound3 constant.

SPECIAL CONSIDERATIONS
When the Dialog Manager detects a click outside an alert box or a modal dialog box, it uses the Sound Manager procedure SysBeep to play the system alert sound. By changing settings in the Sound control panel, the user can select which sound to play as the system alert sound. For consistency with system software and other Macintosh applications, your sound procedure should call SysBeep whenever your sound procedure receives sound number 1 (which you can represent with the sound1 constant).

SEE ALSO
Listing 6-3 on page 6-22 illustrates how to use MyAlertSound. The SysBeep procedure is described in Inside Macintosh: Sound.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996