Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Track copying problems under Windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Track copying problems under Windows



on 11/21/00 1:54 PM, Peter Doege at email@hidden wrote:

> Hello -
>
> I'm having some problems copying tracks from one movie to another using
> QT under MS Windows 2k. The basic problem may be related to my
> inexperience with the QT API.
>
> I'm attempting to programmatically copy from a source movie into a
> destination movie. My general approach is as follows.
>
> 1) Open both movies
> 2) Use GetMovieIndTrack() and GetMovieTrack() to get the source movies
> track of interest
> 3) Use GetTrackMedia() to get the source tracks media
> 4) Use NewMovieTrack() and NewTrackMedia() to set up the destination
> movie's media
> 5) Call BeginMediaEdits()
> 6) Get a handle from the source media
> 7) Create a new AtomContainer, and fill the AtomContainer with the
> source handle using QTInsertChild()
> 8) Create a new sample description from the source media
> 9) Put the AtomContainer into the destination media using
> AddMediaSample()
> 10) Call InsertMediaIntoTrack() to add to newly filled media into its
> track
> 11) Call EndMediaEdits()
>
> The problem is that this approach fails miserably. Does anyone know if
> there is a standard way of copying data/tracks/media between movies? Is
> is documented anywhere?
>
> AddMovieSelection() seems to do the job, but it doesn't offer the
> flexibility that I need.
>

Use InsertTrackSegment. For example, here's pseudocode someone posted to the
list awhile back showing how to copy the sound track from one movie to
another:

OpenMovieFile(fileA, fsRdPerm)
OpenMovieFile(fileB, fsRdWrPerm)
NewMovieFromFile(movieA, fileA)
NewMovieFromFile(movieB, fileB)
GetSoundTrack(movieA, soundTrackA)
NewTrack(movieB, soundTrackB)
NewMedia(soundTrackB, mediaB)

BeginMediaEdits(mediaB)

InsertTrackSegment(soundTrackA, soundTrackB, ...)

EndMediaEdits(mediaB)

_____________________________________
Scott Kuechle
Worldwide Developer Technical Support
Apple Computer, Inc.
http://www.apple.com/developer




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.