• 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: Host callback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Host callback


  • Subject: Re: Host callback
  • From: Marc Poirier <email@hidden>
  • Date: Wed, 2 Mar 2005 23:03:00 -0500

I would just suggest modifying that to have this somewhere earlier:

static bool gIsTransportStateProcSafe = IsTransportStateProcSafe();

and then check on the value of gIsTransportStateProcSafe rather than calling IsTransportStateProcSafe() during every render call. Not that it's necessarily so expensive, but the call does involve some bundle finding, plist parsing, etc. And the result is never going to change throughout the life of the process.

Marc



On Mar 2, 2005, at 6:37 PM, Pavol Markovic wrote:

Hi Ralph,

here's example. The only relevant place/frequency to call callback functions is in render/process thread, max once per render call (you don't have to call it for every single frame, because the number of frames to render are passed as parameter into render method/function)

... somewhere in render/process call stack...

  bool haveSamplePos = false;
  Float64 outCurrentSampleInTimeLine;

if ( IsTransportStateProcSafe() && mHostCallbackInfo.transportStateProc )
{
OSStatus result = mHostCallbackInfo.transportStateProc(mHostCallbackInfo.hostUserData, NULL, NULL, &outCurrentSampleInTimeLine, NULL, NULL, NULL);
if ( result == noErr )
{
haveSamplePos = true;
}
}


Please note, that currently very few hosts provide this info and older versions of GarageBand and Logic may crash when tryin' to call this. Find e-mail thread "TransportState Logic/GarageBand workaround" in archives (8/18/2004).

Best,
Pavol Markovic

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Host callback (From: email@hidden)
 >Re: Host callback (From: Pavol Markovic <email@hidden>)

  • Prev by Date: Re: Host callback
  • Next by Date: "hog mode" for midi?
  • Previous by thread: Re: Host callback
  • Next by thread: Re: Host callback
  • Index(es):
    • Date
    • Thread