Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set the looping attribute on a QTMovie?




On Dec 14, 2004, at 9:13 PM, Richard Travis Rose wrote:


I've been following this thread as well. He is just using NSMovie; it sounds like he needs the underlying calls to QuickTime's C API, to set the looping mode.

In that case, this might be useful:

//////////
//
// QTUtils_MakeMovieLoop
// Set the specified movie to loop.
//
//////////

OSErr QTUtils_MakeMovieLoop (Movie theMovie, Boolean isPalindrome)
{
  TimeBase    myTimeBase = NULL;
  long       myFlags = 0L;
  OSErr      myErr = paramErr;

  // make sure we've got a movie
  if (theMovie == NULL)
    goto bail;

  myErr = noErr;

  // set the movie's play hints to enhance looping performance
  SetMoviePlayHints(theMovie, hintsLoop, hintsLoop);

  // set the looping flag of the movie's time base
  myTimeBase = GetMovieTimeBase(theMovie);
  myFlags = GetTimeBaseFlags(myTimeBase);
  myFlags |= loopTimeBase;

// set or clear the palindrome flag, depending on the specified setting
if (isPalindrome)
myFlags |= palindromeLoopTimeBase;
else
myFlags &= ~palindromeLoopTimeBase;


  SetTimeBaseFlags(myTimeBase, myFlags);

bail:
  return(myErr);
}


Tim Monroe QuickTime Engineering email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden
References: 
 >Re: How to set the looping attribute on a QTMovie? (From: Richard Travis Rose <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.