Important: The information in this document is obsolete and should not be used for new development.
MyAlertSound
If you want the Dialog Manager to play sounds other than the system alert sound, write your own sound procedure and call theErrorSound
procedure to make it the current sound procedure. For example, you can declare a sound procedure namedMyAlertSound
, 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 thesoundNo
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 thesilent
constant in the alert resource. The Dialog Manager passes 1 for sounds specified by thesound1
constant, 2 for sounds specified by thesound2
constant, and 3 for sounds specified by thesound3
constant.SPECIAL CONSIDERATIONS
When the Dialog Manager detects a click outside an alert box or a modal dialog box, it uses the Sound Manager procedureSysBeep
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 callSysBeep
whenever your sound procedure receives sound number 1 (which you can represent with thesound1
constant).SEE ALSO
Listing 6-3 on page 6-22 illustrates how to useMyAlertSound
. TheSysBeep
procedure is described in Inside Macintosh: Sound.