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 ContainersThe code sample in Listing 6-3 (page 326) creates a new QT atom container and calls QTInsertChild to addan atom. The resulting QT atom container is shown in Figure 6-1 (page 326). The offset value 10 is returned inthe firstAtom parameter.Listing 6-3Creating a new QT atom container and calling QTInsertChild to add an atom.QTAtom firstAtom;QTAtomContainer container;OSErr errerr = QTNewAtomContainer (&container);if (!err)err = QTInsertChild (container, kParentAtomIsContainer, 'abcd',1000, 1, 0, nil, &firstAtom);Figure 6-1QT atom container after inserting an atomQT atomcontainer'abcd'1000Index = 1Offset = 10The following code sample calls QTInsertChild to create a second child atom. Because a value of 1 is specifiedfor the index parameter, the second atom is inserted in front of the first atom in the child list; the index ofthe first atom is changed to 2. The resulting QT atom container is shown in Figure 6-2 (page 327).QTAtom secondAtom;FailOSErr (QTInsertChild (container, kParentAtomIsContainer, 'abcd',<strong>2012</strong>-<strong>08</strong>-<strong>14</strong> | © 2004, <strong>2012</strong> Apple Inc. All Rights Reserved.326

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

Saved successfully!

Ooh no, something went wrong!