• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems getting a m4a file to loop using NSMovieView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Cant remove ColorSyncProfile
  • Next by Date: Re: NSArray to string and back problems
  • Previous by thread: Problems getting a m4a file to loop using NSMovieView
  • Next by thread: Cant remove ColorSyncProfile
  • Index(es):
    • Date
    • Thread