Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Application-Defined Routines / Completion Routines


Legacy Documentclose button

Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.

MyCompletionRoutine

A Sound Manager completion routine has the following syntax:

PROCEDURE MyFilePlayCompletionRoutine (chan: SndChannelPtr);
chan
A pointer to the sound channel on which a play from disk has completed.
DESCRIPTION
The Sound Manager executes your completion routine when a play from disk on the channel specified by the chan parameter finishes. You might use the completion routine to set a global flag that alerts the application that it must dispose of the sound channel.

SPECIAL CONSIDERATIONS
A completion routine is called at interrupt time. It must not make any calls to the Memory Manager, either directly or indirectly. If your completion routine needs to access your application's global variables, you must ensure that register A5 contains your application's A5. (You can use the userInfo field of the sound channel pointed to by the chan parameter to pass that value to your completion routine.)

ASSEMBLY-LANGUAGE INFORMATION
Because this routine is called at interrupt time, it must preserve all registers other than A0-A1 and D0-D2.

SEE ALSO
For information on how you can use completion routines to help manage an asynchronous play from disk, see "Managing an Asynchronous Play From Disk" on page 2-52.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996