MoviesTask
TheMoviesTaskfunction services active movies.
pascal void MoviesTask (Movie theMovie, long maxMilliSecToUse);
theMovie- Specifies the movie for this operation. If you set this parameter to
nil, the Movie Toolbox services all of your active movies. Your application obtains this movie identifier from such functions asNewMovie,NewMovieFromFile, andNewMovieFromHandle(described on page 2-80, page 2-76, and page 2-78, respectively).maxMilliSecToUse- Determines the maximum number of milliseconds that
MoviesTaskcan work before returning. If this parameter is 0,MoviesTaskservices every active movie exactly once and then returns. If the parameter is nonzero,MoviesTaskservices as many movies as it can in the allotted time before returning.- Once the
MoviesTaskfunction starts servicing a movie, it cannot stop until it has completely met the requirements of the movie. Consequently, theMoviesTaskfunction may execute for a longer time than that specified inmaxMilliSecToUse. However, the function does not start servicing a new movie if the time specified bymaxMilliSecToUsehas elapsed.- The preferred way to use
MoviesTaskis to set themaxMilliSecToUseparameter to 0; however, if you just want to play one movie, you can callMoviesTaskon that one.- If your rate is 0,
MoviesTaskdraws that frame and no other.DESCRIPTION
When servicing a movie, the Movie Toolbox performs the processing that is appropriate for the movie--displaying frames, playing sound, reading data from disk, or other tasks. The only time the Movie Toolbox actually draws a movie is during the operation of theMoviesTaskfunction.You should call
MoviesTaskas often as possible from your application's main event loop. Note that you should call this function after you have performed your own event processing.The
MoviesTaskfunction services only active movies, and only enabled tracks within those active movies. Use theSetMovieActivefunction (described on page 2-131) and theSetTrackEnabledfunction (described on page 2-132) to enable and disable movies and tracks.SPECIAL CONSIDERATIONS
Note that theMoviesTaskfunction services only your movies. Your application must call the Event Manager'sWaitNextEventroutine (or the Event Manager'sGetNextEventroutine and theSystemTaskroutine) to give other applications the opportunity to callMoviesTaskfor their movies. For details onWaitNextEvent,GetNextEvent, andSystemTask, see Inside Macintosh: Macintosh Toolbox Essentials.ERROR CODES
invalidMovie -2010 This movie is corrupted or invalid
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help