What's New in QuickTime 4.1

| Previous | Chapter Contents | Chapter Top | Next |

ExtendedSoundParamBlock

The ExtendedSoundParamBlock is an extended form of SoundParamBlock . Like ExtendedSoundComponentData , it consists of the unextended classic structure followed by new fields.

struct ExtendedSoundParamBlock {
SoundParamBlock pb; /*classic SoundParamBlock
except recordSize == sizeof(ExtendedSoundParamBlock)*/
short reserved;
long extendedFlags; /*flags*/
long bufferSize; /*size of buffer in bytes*/
};
typedef struct ExtendedSoundParamBlock ExtendedSoundParamBlock;
typedef ExtendedSoundParamBlock * ExtendedSoundParamBlockPtr;

Unlike SoundComponentData , however, the recordSize field of the SoundParamBlock is used to detect if this is an ExtendedSoundParamBlock .

If the record size is greater than or equal to the size of SoundParamBlock , then you know it has been extended. Also, in the future, it is expected that this structure will grow, so you want to check for a record of sufficient size to hold the fields you are seeking.

The fields of ExtendedSoundParamBlock are:

pb
Classic SoundParamBlock record. Its recordSize field allows you to detect extended records.

reserved
Reserved.

extendedFlags
 

Same interpretation as extendedFlags in ExtendedSoundComponentData .

bufferSize
Size of buffer in bytes. Only valid if extendedFlags field has the kExtendedSoundBufferSizeValid flag set.

Since the embedded SoundParamBlock contains a SoundComponentData , the kExtendedSoundSampleCountNotValid flag set refers to the sampleCount field of that record. Be aware that the embedded SoundComponentData's flags field should never have its kExtendedSoundData flag set. This would mislead a client passed only a pointer to the SoundComponentData to misinterpet it as an extended record.

An ExtendedSoundParamBlock can be passed to the sound component's SoundComponentPlaySourceBuffer routine. Also, the moreRtn of the SoundParamBlock may return a reference to an ExtendedSoundParamBlock .

In both cases, check that the record is extended before interpreting the extended fields.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |