---
title: Adding atom containers in a QuickTime VR Movie
framework: QuickTime File Format
role: article
role_heading: Article
path: quicktime-file-format/adding_atom_containers_in_a_quicktime_vr_movie
---

# Adding atom containers in a QuickTime VR Movie

Add node information to your QuickTime VR world.

## Overview

Overview Assuming you have already created the QuickTime VR world and node information atom containers, you would use the code (minus error checking) in the following listing to add them to the QTVR track. long descSize; QTVRSampleDescriptionHandle qtvrSampleDesc;     // Create a  QTVR sample description handle   descSize = sizeof(QTVRSampleDescription) + GetHandleSize((Handle)  vrWorld) -                                         sizeof(UInt32); qtvrSampleDesc = (QTVRSampleDescriptionHandle) NewHandleClear (descSize); (*qtvrSampleDesc)->size = descSize; (*qtvrSampleDesc)->type = kQTVRQTVRType;   // Copy the VR world atom container data into the QTVR sample description BlockMove (*((Handle) vrWorld), &((*qtvrSampleDesc)->data),                             GetHandleSize((Handle) vrWorld)); // Now add it to the QTVR track's media err = BeginMediaEdits (qtvrMedia); err = AddMediaSample (qtvrMedia, (Handle) nodeInfo, 0,     GetHandleSize((Handle) nodeInfo), duration,     (SampleDescriptionHandle) qtvrSampleDesc, 1, 0, &sampleTime); err = EndMediaEdits (qtvrMedia); InsertMediaIntoTrack (qtvrTrack, trackTime, sampleTime, duration,  1L<<16); The duration value is computed based on the duration of the corresponding image track samples for the node. The value of trackTime is the time for the beginning of the current node (zero for a single node movie). The values of duration and sampleTime are in the time base of the media; the value of trackTime is in the movie’s time base.

## See Also

### Storing QuickTime VR files

- [Single-node panoramic movies](quicktime-file-format/single-node_panoramic_movies.md)
- [Single-node object movies](quicktime-file-format/single-node_object_movies.md)
- [Multinode movies](quicktime-file-format/multinode_movies.md)
- [Getting the name of a QuickTime VR node](quicktime-file-format/getting_the_name_of_a_quicktime_vr_node.md)
- [Adding custom atoms in a QuickTime VR movie](quicktime-file-format/adding_custom_atoms_in_a_quicktime_vr_movie.md)
- [Optimizing QuickTime VR movies for web playback](quicktime-file-format/optimizing_quicktime_vr_movies_for_web_playback.md)
