What's New in QuickTime 4.1
| Previous | Chapter Contents | Chapter Top | Next |
QuickTime stores data separately in tracks. Tracks indicate what kind of data a movie contains. Examples of track types include video, audio, MP3, and text. The track class provides access to useful information about a track, such as name, kind, start time and duration. Some properties can be set, such as name, and enabled (which determines whether a specific track plays when the entire movie plays).
Class track: A track in a QuickTime movie.
-- the time delay before this track starts playing
-- the kind of media in the track
-- the current dimensions of the track
natural dimensions point [r/o]
-- the dimensions the track has when it is not scaled
-- should this track be used when the movie is playing?
-- the unique identifier for this track
visual characteristic boolean [r/o]
audio characteristic boolean [r/o]
-- the volume of the track [0..255], where 256 is 100 percent
-- the balance of the track [-127..128], where negative is left, 0 is center, and positive is right
Some examples of how you would use various properties of the track class:
set name of track 1 of movie 1 to "hip cats"
set enabled of track 1 of first movie to false
-- get enabled state of all tracks --
get enabled of tracks of movie 1
set dimensions of track 1 of movie 1 to {320, 240}
get the track data size of track 1 of movie 1
get the track data size of tracks of movie 1
-- get natural dimensions of track--
get the natural dimensions of track 1 of movie 1
get the id of track 2 of movie 1
get the layer of track 2 of movie 1
-- get visual characteristic of track (is it visible)--
get the visual characteristic of track 2 of first movie
-- get audio characteristic of track (is it audible)--
get the audio characteristic of track 2 of first movie
-- if audio track, get balance
if audio characteristic of track 2 of movie 1 is true then get
the volume of track 2 of movie 1
set start time of track 1 of movie 1 to 600
get track kind of track 2 of movie 1
-- get track duration (as seconds if time scale is 600)
set x to duration of track 2 of movie 1
set result to x / (time scale of movie 1)
Note that if you use (time scale of movie 1), then this becomes the generalized expression for time in seconds.
| Previous | Chapter Contents | Chapter Top | Next |