Copyright ©1995 by NeXT Computer, Inc. All Rights Reserved.
NXSoundParameters |
Inherits From: | Object | |
Conforms To: | NXSoundParameters (the protocol) | |
Declared In: | soundkit/NXSoundParameters.h |
Class Description |
The NXSoundParameters class provides an implementation of the methods defined by the NXSoundParameters protocol. This implementation lets you create objects that can be passed as NXSoundParameters-conforming arguments to methods, primarily those defined in NXSoundDevice and NXSoundStream, that require such conformance.
Most of the functionality provided by the NXSoundParameters class is expressed by the NXSoundParameters protocol; see the protocol specification for an explanation of its methods. |
Instance Variables |
None declared in this class. |
Adopted Protocols |
NXSoundParameters | boolValueForParameter: |
floatValueForParameter: getParameters:count: getValues:count:forParameter: intValueForParameter: isParameterPresent: removeParameter: setParameter:toBool: setParameter:toFloat: setParameter:toInt: |
Method Types |
Initializing and freeing | init |
initFromSound: initFromSoundStruct: free |
Broadcasting information | configureSoundStruct: | |
Querying parameters | + localizedNameForParameter: |
Class Methods |
localizedNameForParameter: |
+ (const char *)localizedNameForParameter:(NXSoundParameterTag)ptag |
Returns the string name of the parameter key or value that's represented by the parameter tag argument. The name can be used, for example, as the title of an element in the user interface; its importance doesn't rise much above this utility.
A list of parameter tags provided by the Sound Kit is given in the section "Types and Constants." If an unrecognized tag is passed to this method, the (localized) string equivalent to "Unknown parameter" is returned. |
Instance Methods |
configureSoundStruct: |
(void)configureSoundStruct:(SNDSoundStruct *)soundStruct |
Sets the sound format of the SNDSoundStruct argument by copying the values of the appropriate parameters from the NXSoundParameters object. If a candidate parameter hasn't been set in the object, the sound structure maintains its current value for the analogous attribute--in other words, a non-existent parameter won't overwrite a value in the structure.
The table below shows the correspondences between sound structure fields and parameters: |
Structure Field | Parameter | |
samplingRate | NX_SoundStreamSamplingRate | |
channelCount | NX_SoundStreamChannelCount | |
dataFormat | NX_SoundStreamDataEncoding |
The SNDSoundStruct structure is described in the section "Types and Constants." |
free |
free |
Frees the object and its table of parameters. |
init |
init |
Initializes and returns an NXSoundParameters object. The object's parameter table is empty immediately after initialization.
See also: initFromSound:, initFromSoundStruct: |
initFromSound: |
initFromSound:aSound |
Initializes and returns an NXSoundParameters object that contains parameters that take their values from the given Sound object. The values that are applied to the parameters are taken from the Sound object's SNDSoundStruct structure; the correspondences between structure fields and parameters is given in the initFromSoundStruct: method.
See also: init, initFromSoundStruct: |
initFromSoundStruct: |
initFromSoundStruct:(SNDSoundStruct *)soundStruct |
Initializes and returns an NXSoundParameters object that contains parameters that take their values from the given SNDSoundStruct, as noted below: |
Parameter | Structure Field | |
NX_SoundStreamSamplingRate | samplingRate | |
NX_SoundStreamChannelCount | channelCount | |
NX_SoundStreamDataEncoding | dataFormat |