Re: QTKit: Adding a QTTrack to a QTMovie
Re: QTKit: Adding a QTTrack to a QTMovie
- Subject: Re: QTKit: Adding a QTTrack to a QTMovie
- From: Marco Scheurer <email@hidden>
- Date: Wed, 11 May 2005 21:19:12 +0200
On May 11, 2005, at 19:23, Christian Schneider wrote:
Hi all,
I posted this mail a few days ago on the quicktime list but was since
then told that QTKit questions should be asked here. So maybe there
are any takers here.
Right, it's hard to know if QTKit questions are for here or the
Quicktime list. Looks like nobody knows.
We are about to switch from standard quicktime to QTKit in our
application, so I'm still getting familiar with the new API and I
might have missed something in the documentation. What I'd like to
know is, whether there's a way to add a QTTrack to a QTMovie, I
couldn't find anything in the QTKit reference docs.
As I currently understand it, the procedure seems to be a) create a
QTMovie, b) get the QTMovie quicktime movie, c) create a new track
with NewMovieTrack and d) use that track to initialise a QTTrack.
I think so. Not very Cocoa-oriented, but this is what our code looks
like, in a category of QTMovie.
- (QTTrack *) addVideoTrackWithSize:(NSSize) aSize
{
QTTrack *newTrack;
NSError *anError;
senassert ([self isEditable]);
Track videoTrack = NewMovieTrack ([self quickTimeMovie], FixRatio
(aSize.width, 1), FixRatio(aSize.height, 1), kFullVolume);
OSErr error = GetMoviesError ();
if (error == noErr) {
Handle dataRef = NULL;
Handle hMovieData = NewHandle (0);
error = PtrToHand (&hMovieData, &dataRef, sizeof(Handle));
Media videoMedia = NewTrackMedia (videoTrack, 'vide', [self
timeScale], dataRef, HandleDataHandlerSubType);
error = GetMoviesError ();
if (error == noErr) {
InsertMediaIntoTrack (videoTrack, 0, 0, GetMediaDuration
(videoMedia), fixed1);
error = GetMoviesError ();
}
}
if (error != noErr) {
NSLog (@"addVideoTrack error %d", error);
}
newTrack = [QTTrack trackWithQuickTimeTrack: videoTrack error:
&anError];
return newTrack;
}
Is that right? And if so, what's the rationale in leaving out an
-addTrack: method in QTMovie?
Hopefully it will come. We were expecting a lot from QTKit, and so
far I must say it's bit of a disappointment.
marco
Marco Scheurer
Sen:te, Lausanne, Switzerland http://www.sente.ch
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden