Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Clippings/GetWhatKindOfEffect.txt
// Extract the 'what' atom to find out what kind of effect it is. |
// This information is returned to us by the effects dialog which |
// is invoked using the QTStandardParameterDialogDoAction function. |
// We'll use this information when we build the effects description |
// a bit further down in the code. |
{ |
QTAtom myEffectAtom; |
QTAtomID myEffectAtomID; |
long myEffectCodeSize; |
Ptr myEffectCodePtr; |
myEffectAtom = QTFindChildByIndex(gEffectSample, kParentAtomIsContainer, kParameterWhatName, kParameterWhatID, &myEffectAtomID); |
myErr = QTLockContainer(gEffectSample); |
BailError(myErr); |
myErr = QTGetAtomDataPtr(gEffectSample, myEffectAtom, &myEffectCodeSize, &myEffectCodePtr); |
BailError(myErr); |
if (myEffectCodeSize != sizeof(OSType)) { |
myErr = paramErr; |
goto bail; |
} |
// get the effect code |
myEffectCode = *(OSType *)myEffectCodePtr; // "tsk" |
myEffectCode = EndianU32_BtoN(myEffectCode); // because the data is read from an atom container |
myErr = QTUnlockContainer(gEffectSample); |
BailError(myErr); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14