Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 5 - Sound Components / Sound Components Reference
Sound Component-Defined Routines / Managing Sound Components


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.

SoundComponentSetSource

A sound component can implement the SoundComponentSetSource function. The Sound Manager calls this function to identify your component's source component.

pascal ComponentResult SoundComponentSetSource 
                           (ComponentInstance ti, 
                              SoundSource sourceID, 
                              ComponentInstance source);
ti
A component instance that identifies your sound component.
sourceID
A source ID for the source component chain created by the Apple Mixer.
source
A component instance that identifies your source component.
DESCRIPTION
Your SoundComponentSetSource function is called by the Sound Manager to identify to your sound component the sound component that is its source. The source component is identified by the source parameter. Your component uses that information when it needs to obtain more data from its source (usually, by calling its SoundComponentGetSourceData function).

Because a sound output device component is always connected directly to one or more instances of the Apple Mixer, the SoundComponentSetSource function needs to be implemented only by utility components (that is, components that perform modifications on sound data). Utility components are linked together into a chain of sound components, each link of which has only one input source. As a result, a utility component can usually ignore the sourceID parameter passed to it.

RESULT CODES
Your SoundComponentSetSource function should return noErr if successful or an appropriate result code otherwise.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996