13.07.2015 Views

Quicktime File Format (2012-08-14).pdf

Quicktime File Format (2012-08-14).pdf

Quicktime File Format (2012-08-14).pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Some Useful Examples and ScenariosGetting the Name of a QuickTime VR Node//Get a pointer to the node header atom data.theErr = QTGetAtomDataPtr(theNodeInfo, theNodeHeaderAtom,nil,(Ptr*)&theNodeHeader);//See if there is a name atom.if (!theErr && theNodeHeader->nameAtomID != 0) {QTAtom theNameAtom;theNameAtom = QTFindChildByID(theNodeInfo, kParentAtomIsContainer,nil);kQTVRStringAtomType, theNodeHeader->nameAtomID,if (theNameAtom != 0) {VRStringAtomPtr theStringAtomPtr;//Get a pointer to the name atom data; copy it intotheErr = QTGetAtomDataPtr(theNodeInfo, theNameAtom,the string.nil,*)&theStringAtomPtr);(Ptrif (!theErr) {short theLen = theStringAtomPtr->stringLength;if (theLen > 255)theLen = 255;BlockMove(theStringAtomPtr->string, &theStringPtr[1],theLen);theStringPtr[0] = theLen;}}}QTUnlockContainer(theNodeInfo);}QTDisposeAtomContainer(theNodeInfo);return(theErr);}The MyGetNodeName function defined in Listing 6-<strong>14</strong> (page 361) retrieves the node information atom container(by calling QTVRGetNodeInfo) and then looks inside that container for the node header atom with atom ID1. If it finds one, it locks the container and then gets a pointer to the node header atom data. The desiredinformation, the node name, is contained in the string atom whose atom ID is specified by the nameAtomID<strong>2012</strong>-<strong>08</strong>-<strong>14</strong> | © 2004, <strong>2012</strong> Apple Inc. All Rights Reserved.362

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!