Re: QuickTime stops to play
Re: QuickTime stops to play
- Subject: Re: QuickTime stops to play
- From: Lorenzo <email@hidden>
- Date: Thu, 04 Nov 2004 14:22:47 +0100
Hi,
be sure when you launch the program you call
EnterMovies();
This initializes the QT APIs.
When you quit the application, call
ExitMovies();
I solved the refreshing problem firing a timer each 0.5 seconds which calls
MCIdle([aQTView movieController]);
aQTView is a variable of kind NSMovieView.
In some other programs I built with OpenGL I refresh the movie calling
MoviesTask(aQTMovie, 0);
but this works well because I don't play the movie within a NSMovieView
You should do:
--------------
- (void)createTimerQT
{
timerQT = [[NSTimer scheduledTimerWithTimeInterval:0.5 target:self
selector:@selector(refreshView) userInfo:nil repeats:YES] retain];
[[NSRunLoop currentRunLoop] addTimer:timerQT
forMode:NSModalPanelRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer:timerQT
forMode:NSEventTrackingRunLoopMode];
}
- (void)refreshView
{
MCIdle([aQTView movieController]);
}
Before releasing the class-object which retains the timerQT, don't forget to
release the timerQT BEFORE you call [myClass release], otherwise the object
wont be deallocated, since the timerQT retains the target object "self". In
order to release the class object I do:
[myClass removeTimerQT];
[myClass release];
- (void)removeTimerQT
{
if(timerQT){
[timerQT invalidate];
[timerQT release];
timerQT = nil;
}
}
Best Regards
--
Lorenzo
email: email@hidden
> From: Michael Hanna <email@hidden>
> Date: Wed, 03 Nov 2004 22:26:48 -0500
> To: Lorenzo <email@hidden>
> Subject: Re: QuickTime stops to play
>
>
> Hi I have the same problem you had before: I have an NSMovieView with
> an NSMovie playing inside it and when I resize the window, the
> movie(simply a sound in this case) pauses.
>
> Did using an NSTimer within an NSThread firing the MoviesTask()
> function help? Or did you solve this problem another way?
>
> I looked for 'qtundercocoa.txt' on google and I couldn't find it. Could
> you send me the code section that helped you?
>
> regards,
> Michael
>
> ~~~~~~~~~~~~~~
> Re: QuickTime stops to play
> FROM : Lorenzo
> DATE : Tue Sep 16 08:35:44 2003
>
> Thank you.
> I already created a NSTimer with the NSEventTrackingRunLoopMode as shown
> below, but this doesn't help while resizing the window.
> I have found the code you spoke about in the qt-list, called
> "qtundercocoa.txt" (I mention it here to everybody know). It explains
> how to
> use a NSTimer within a NSThread firing the MoviesTask() function, so I
> am
> going to try that, hopefully.
>
>
_______________________________________________
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