NewMovieTrack
You can create movie tracks by calling theNewMovieTrackfunction. Immediately after creating a new track, you should call theNewTrackMediafunction to create a media for the track--a track without a media is of no use.Note that when you add a track to a movie, the Movie Toolbox automatically adjusts the display rectangle of the movie. You may want to detect these changes by calling the
GetMovieBoxfunction (described on page 2-147) so that you can adjust the size of the movie's display window.
pascal Track NewMovieTrack (Movie theMovie, Fixed width, Fixed height, short trackVolume);
theMovie- Specifies the movie for this operation. Your application obtains this movie identifier from such functions as
NewMovie,NewMovieFromFile, andNewMovieFromHandle(described on page 2-80, page 2-76, and page 2-78, respectively).width- Specifies a fixed number denoting the display width of the track, in pixels. Along with the
heightparameter, this parameter defines the track's display rectangle.height- Specifies a fixed number denoting the display height of the track, in pixels.
- Together, the
heightandwidthparameters define the track's display rectangle. The upper-left corner of this rectangle lies at (0,0) in the movie's rectangle. Theheightandwidthparameters therefore establish the lower-right corner of the track's display rectangle. If you are creating a track that is not displayed, such as a sound track, set theheightandwidthparameters to 0.trackVolume- Specifies the volume setting of the track as a 16-bit, fixed-point number. The high-order 8 bits specify the integer portion; the low-order 8 bits specify the fractional part. Volume values range from -1.0 to 1.0. Negative values play no sound but preserve the absolute value of the volume setting. Set this parameter to
kFullVolumeto play the track at its full, natural volume. Set this parameter tokNoVolumeto set the volume to 0.kFullVolume- Sets the track to full volume (constant value is 1.0).
kNoVolume- Sets the track to no volume (constant value is 0.0).
DESCRIPTION
TheNewMovieTrackfunction returns a track identifier. If the function cannot create the track, it sets the returned identifier tonil.ERROR CODES
Memory Manager errors
invalidMovie -2010 This movie is corrupted or invalid