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 ScenariosAdding Atom Containers in a QuickTime VR MovieQTVRGetHotSpotType (qtvr, hotSpotID, &hotSpotType);if (hotSpotType != kMyAtomType) return;// It's our type of hot spot - don't let anyone else handle it*cancel = true;// Find our custom atommyAtom = QTFindChildByID (nodeInfo, hotSpotAtom, kMyAtomType,1, nil);if (myAtom != 0) {OSErr err;// Copy the custom data into our structureerr = QTCopyAtomDataToPtr (nodeInfo, myAtom, false,sizeof(CustomData), &myCustomData, nil);if (err == noErr)// Do something with itDoMyHotSpotStuff (hotSpotID, &myCustomData);}}Your intercept procedure is called for clicks on any hot spot. You should check to see if it is your type of hotspot and, if so, extract the custom hot spot atom and do whatever is appropriate for your hot spot type(DoMyHotSpotStuff).When you no longer need the intercept procedure you should call QTVRInstallInterceptProc again withthe same selector and a nil procedure pointer and then call DisposeRoutineDescriptor on myProc.Apple reserves all hot spot and atom types with lowercase letters. Your custom hot spot type should containall uppercase letters.Adding Atom Containers in a QuickTime VR MovieAssuming you have already created the QuickTime VR world and node information atom containers, you woulduse the code (minus error checking) Listing 6-16 (page 365) to add them to the QTVR track.<strong>2012</strong>-<strong>08</strong>-<strong>14</strong> | © 2004, <strong>2012</strong> Apple Inc. All Rights Reserved.364

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

Saved successfully!

Ooh no, something went wrong!