|
Q: I'd like to add a reference for a movie to another movie, for example to "merge" two movies together so one will playback right after the other. Is this done with data references? Or do I use an alias approach? I'm confused. Please explain.A: The easiest way to do this is with the Movie Toolbox Editing routine For example, to add a reference to some source movie to a destination movie use Listing 1: Adding a movie reference using InsertMovieSegment. void addMovieReference(Movie destMovie, Movie sourceMovie) { TimeValue srcMovieDuration, destMovieDuration; OSErr err = noErr; srcMovieDuration = GetMovieDuration(sourceMovie); destMovieDuration = GetMovieDuration(destMovie); // add to destMovie a reference to sourceMovie err = InsertMovieSegment( sourceMovie, // source movie destMovie, // destination movie for the insert 0, // insert from beginning of source movie srcMovieDuration, // duration of source movie segment to insert destMovieDuration // where to insert the source segment into the dest. ); . . . } Also, call CopyMovieSettings if you wish to copy movie settings such as preferred rate and volume, and so on, from the source movie to the destination movie: Listing 2: Using CopyMovieSettings to copy movie attributes. err = CopyMovieSettings (srcMovie, destMovie ); Note that some or all of the media of the source movie may be copied to the destination if one or more calls to Finally, don't forget to call Adding a reference to a movie can also be accomplished using data references. However, this is a more complicated approach, and in this case we can get the same result using For an example of how to create a reference to a movie using data references, see the Sample Code Project 'qtdataref'. Document Revision History
Posted: 2004-09-16 |
|