Re: Problems getting a m4a file to loop using NSMovieView
Re: Problems getting a m4a file to loop using NSMovieView
- Subject: Re: Problems getting a m4a file to loop using NSMovieView
- From: Lorenzo <email@hidden>
- Date: Thu, 24 Nov 2005 14:57:05 +0100
Hi Andrew,
firstly define
Movie qtMovie;
in your header file. Then take the Movie version of your NSMovie
qtMovie = [song QTMovie];
Then define a timer which at e.g. any 0.5 seconds calls the method
refreshQTView.
It could look like time consuming but it is not at all.
Also with this refreshing method you will avoid some lack of updates in the
NSMovieView.
- (void)createTimerForQT
{
timerQT = [[NSTimer scheduledTimerWithTimeInterval:0.5
target:self selector:@selector(refreshQTView)
userInfo:nil repeats:YES] retain];
[[NSRunLoop currentRunLoop] addTimer:timerQT
forMode:NSModalPanelRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer:timerQT
forMode:NSEventTrackingRunLoopMode];
}
- (void)refreshView
{
if(IsMovieDone(qtMovie)){
if(gMyLoopFlag){ // this is your own flag
GoToBeginningOfMovie(qtMovie);
MoviesTask(qtMovie, 0);
}
}
MCIdle([musicPlayer movieController]); // your NSMovieView controller
//or MoviesTask(qtMovie, 0);
}
Remember to invalidate and deallocate the timerQT
in the dealloc method of your class.
- (void)releaseTimerForQT
{
if(timerQT ){
[timerQT invalidate];
[timerQT release];
timerQT = nil;
}
}
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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