Contents
Navigation
Home User Reference Other Resources


A QuickTime is organized into tracks. A movie can contain many tracks; there are practical limits, which change as computers become more powerful, but there is no predefined limit.

Each track specifies a type—such as video, sound, or text—and a that specifies where the sample data for that track can be found. A track may also specify a compression format (such as JPEG video or GSM audio). The data reference may be to a local file, a file on a network or Internet server, a data stream from a network or Internet server, or a handle or pointer to a block of memory; other data reference types are also possible and the type itself is extensible. Simply put, the movie data can be anywhere. A data reference identifies the data source.

Different tracks can specify the same data source or different data sources. All the movie’s media samples can be in a single file, for example, or the samples for a movie’s sound track can be in one file while the samples for the video track are stored in a different file.

A given track can specify only one media type, and most tracks get all of their samples from a single source. Some media types support multiple sources, however. For example, a video track can consist a series of JPEG images, each stored in a separate file. In this case, there is a data reference for every image.

Different tracks can be of the same media type or of different media types—you can have multiple video tracks and multiple sound tracks in the same movie, for example, or multiple text tracks in different languages.

A given track can use only one type of compression, but multiple tracks of the same media type may be compressed differently in the same movie. For example, a single movie can contain both MP3 and MPEG–4 compressed audio tracks.

The QTPlgTrack class provides you with properties, methods and constants that let you manipulate QuickTime tracks.







The QTPlgTrack class constructors are called when you create a new instance of the class, while the ˜QTPlgTrack class destructor, is called automatically when the class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil. You can not create a QTPlgTrack object by yourself; instead, you will use class instances obtained from or objects
Once a new class instance is returned, it is good practice to check the class property to be sure that the new object can be used. See the validity requirements for more details.

The class provides you with the following initializer methods:
(other as QTPlgTrack)
This is the copy constructor. The properties of the object to be copied will be used to initialize the new class instance properties

establishes the track’s source rectangle; changing the dimensions of an existing track, causes the data to be scaled scaled to fit into the new rectangle
determines the track’s current volume setting (a track’s volume is scaled by the movie’s to produce the track’s final volume); the values of sound volume range from –255 to 255; higher values translate to louder volume. Negative values indicate muted volume. That is, the Movie Toolbox does not play any sound for movies or tracks with negative volume settings, but the original volume level is retained as the absolute value of the volume setting. Therefore, the current state of the volume can be toggled by inverting the sign of the current volume setting
specifies the four char string code identifying the kind of the media associated to the track
specifies the kind of the media associated to the track
specifies the track dimensions to use in classic, clean, production and encoded pixels aperture mode. If you do not want to set a given aperture mode let the corresponding property set to an empty rectangle. Setting the is equivalent to modifying the class property, except that also changes the to , and setting does not
requires QuickTime 7.0 or later
specifies the name of the track. When you change this property, the string will be stored in MacRoman encoding
identifies the track’s unique track ID value (this is not the track index). This ID value remains unique throughout the life of the movie
determines the offset of the track
returns either the offset in the source data file of first sample of data within the track or a negative error code if the information is not available
establishes the track’s layer number. Layers are numbered from –32768 through 32767. When you create a new track, its track layer is set to 0. A smaller number moves the track closer to the front
specifies if the track is to be used in the movie
specifies if the track is to be used in preview mode
specifies if the track is to be used in poster mode
allows to access to the track’s media structure

(tmRange as ) as integer
use this function to count the number of samples within the time range specified by the tmRange parameter; if you do not specify any track segment, returns the total number of samples in the track
returns the number of samples found within the specified time interval. Check the class property for errors
(t as QTPlgTrack, tmRange as , dst as integer, [copy as boolean=false])
this method places a copy of the segment, which is obtained from the track specified by the t parameter, into this track. By setting the optional copy parameter to true the data will be copied into the destination track, otherwise the segment will be copied by reference. If you choose to insert the track segment by reference, the data can be copied later by the movie containing the track. If you set the t parameter to nil, the method will copy the data internally to the track. Also, you can instruct the method to copy just a segment of the source track by setting the of the object as appropriate; if you do not specify any track segment, the method will copy the entire source track. By the dst parameter you can specify where the segment is to be inserted. This time value must be expressed in the time scale of the movie that contains the destination track. If you are copying data between tracks, make sure that the two tracks are of the same type. For example, you cannot copy a segment from a sound track into a video track
returns nothing. Check the class property for errors
(refTrack as QTPlgTrack, refType as string)
adds a new track reference to this track. You specify the track to be identified in the track reference by the refTrack parameter and the type of reference using the four char string refType parameter
returns nothing. Check the class property for errors
(refTrack as QTPlgTrack, refType as )
adds a new track reference to this track. You specify the track to be identified in the track reference by the refTrack parameter and the type of reference using the refType parameter
returns nothing. Check the class property for errors
(refType as )
use this method to find about how many track references of a given type exist for the track. To obtain the total number of track references, pass nil into the refType parameter
returns the number of track references of the specified type in the track. If there are no references of the type you have specified or some error occurred, the function returns a value of 0. This being the case, you can check the class property for errors
() as
use this method to obtain a list of the references types that exist for a track
returns a list of objects or nil if some error occurred. Check the class property for errors
(refType as ) as
use this method to obtain a list of the references tracks of the specified type linked to the track
returns a list of QTPlgTrack objects or nil if some error occurred. Check the class property for errors
(refType as , index as integer) as boolean
you can remove a track reference from a track by using this method. You specify the type of reference by the refType parameter and the index of it by the index; this value should range between 0 and 1
returns true if successful otherwise returns false. Check the class property for errors
(refType as ) as boolean
use this method to clean up the track references of the specified type from the track
returns true if successful otherwise returns false. Check the class property for errors
(alternateTrack as )
you can determine how the tracks are associated into alternate groups by using this method; the association follows these rules:
  1. if neither the current track nor alternateTrack is in a group, then a new group is created to hold them both
  2. if the current track is not already in a group and alternateTrack is in a group, then the current track is added to the group that contains alternateTrack
  3. if the current track is already in a group but alternateTrack is not, then alternateTrack is added to the group that contains the current track
  4. if both the current track and alternateTrack are already in groups, then the two groups are combined into one group
returns none. Check the class property for errors
()
you cas use this method to remove the track from its alternate group if any
returns none. Check the class property for errors
() as
use this method to retrieve all of the tracks that belong to the same alternate group
returns a list of QTPlgTrack objects belonging to the same alternate group or nil if some error occurred or the track is not associated to any alternate group. Check the class property for errors