Re: NSMovieView stops playing
Re: NSMovieView stops playing
- Subject: Re: NSMovieView stops playing
- From: Esteban Uribe <email@hidden>
- Date: Sat, 10 May 2003 02:04:59 -0700
Hey Ben,
On Saturday, May 10, 2003, at 01:10 AM, Ben Haller wrote:
Does anybody have a workaround? Vince DeMarco mentioned not using
NSMovieView at all, but rather just using NSMovie and direct QT API;
I'm not sure how to do this, but I will look into the book he
recommended if nobody offers a better solution. Is there a simple
example somewhere of doing this? I really just need the most basic
case of loading and playing the sound; I'm not trying to do anything
fancy, I just can't have the sound cutting out partway through...
I've been using NSMovie and QT APIs in the following way.
soundPlayer = [[NSMovie alloc] initWithURL:[NSURL
fileURLWithPath:soundAtPath] byReference:YES];
SetMovieVolume([soundPlayer QTMovie], kFullVolume ); //kFullVolume is
of value 256.0 and max sound output.
StartMovie([soundPlayer QTMovie]);
The only obvious problem here is that you basically leak until the
movie is done playing.
If you autorelease soundPlayer it will kill the sound upon release.
You may want to have an NSTimer check occasionally to see if the movie
is still playing and clean up when it is done.
You can check if the movie is still playing with the following:
IsMovieDone([soundPlayer QTMovie]);
And you can stop the movie with:
StopMovie([soundPlayer QTMovie]);
And go back to the start of the movie with:
GoToBeginningOfMovie([soundPlayer QTMovie]);
-Esteban
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.