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 ScenariosCreating, Copying, and Disposing of Atom Containers●●“Adding Atom Containers in a QuickTime VR Movie” (page 364) shows the code you would use to add VRworld and node information atom containers to a QTVR track.“Optimizing QuickTime VR Movies for Web Playback” (page 365) describes how to use the QTVR Flattener,a movie export component that converts an existing QuickTime VR single node movie into a new moviethat is optimized for viewing on the Web.Creating, Copying, and Disposing of Atom ContainersBefore you can add atoms to an atom container, you must first create the container by callingQTNewAtomContainer. The code sample shown in Listing 6-1 (page 325) calls QTNewAtomContainer tocreate an atom container.Listing 6-1Creating a new atom containerQTAtomContainer spriteData;OSErr err// create an atom container to hold a sprite’s dataerr=QTNewAtomContainer (&spriteData);When you have finished using an atom container, you should dispose of it by calling theQTDisposeAtomContainer function. The sample code shown in Listing 6-2 (page 325) callsQTDisposeAtomContainer to dispose of the spriteData atom container.Listing 6-2Disposing of an atom containerif (spriteData)QTDisposeAtomContainer (spriteData);Creating New AtomsYou can use the QTInsertChild function to create new atoms and insert them in a QT atom container. TheQTInsertChild function creates a new child atom for a parent atom. The caller specifies an atom type andatom ID for the new atom. If you specify a value of 0 for the atom ID, QTInsertChild assigns a unique ID tothe atom.QTInsertChild inserts the atom in the parent’s child list at the index specified by the index parameter; anyexisting atoms at the same index or greater are moved toward the end of the child list. If you specify a valueof 0 for the index parameter, QTInsertChild inserts the atom at the end of the child list.<strong>2012</strong>-<strong>08</strong>-<strong>14</strong> | © 2004, <strong>2012</strong> Apple Inc. All Rights Reserved.325

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

Saved successfully!

Ooh no, something went wrong!