Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 5 - Sound Components / Sound Components Reference
Sound Manager Utilities / Saving and Restoring Sound Component Preferences


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.

GetSoundPreference

A sound component can use the GetSoundPreference function to have the Sound Manager read a block of preferences data from a resource file. You'll use it to retrieve a block of preferences data you previously saved by calling SetSoundPreference.

pascal OSErr GetSoundPreference (OSType type, Str255 name, 
                                    Handle settings);
type
The resource type of the preferences resource.
name
The resource name of the preferences resource.
settings
A handle to the data in the preferences resource.
DESCRIPTION
The GetSoundPreference function retrieves the block of preferences data you previously stored in a resource by calling the SetSoundPreference function. It is the responsibility of your component to allocate the block of data referenced by the settings handle. The Sound Manager resizes the handle (if necessary) and fills it with data from the resource with the specified type and name. Your sound component should dispose of the handle once it's finished reading the data from it. You can determine the size of the handle returned by the Sound Manager by calling the Memory Manager's GetHandleSize function.

SPECIAL CONSIDERATIONS
The GetSoundPreference function is available only in versions 3.0 and later of the Sound Manager.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996