Setting the HostCallback Property
Setting the HostCallback Property
- Subject: Setting the HostCallback Property
- From: William Stewart <email@hidden>
- Date: Tue, 11 May 2004 17:18:40 -0700
I thought it might be useful to describe how to set this property in a
compatible manner so that older AU's do not break as we extend this
property. Thanks to Seb, we've tested this with a couple of older AU's
and it seems to be resilient and will also provide support for the new
HostTransport callback if the AU implements it.
OSStatus InstallValidHC ()
{
HostCallbackInfo cbInfo;
memset (&cbInfo, 0, sizeof(cbInfo));
UInt32 size = sizeof(cbInfo);
mAU.GetPropertyInfo (kAudioUnitProperty_HostCallbacks,
kAudioUnitScope_Global, 0, &size, NULL);
if (size > sizeof(cbInfo)) size = sizeof(cbInfo);
cbInfo.beatAndTempoProc = MY_HostCallback_GetBeatAndTempo;
cbInfo.musicalTimeLocationProc =
MY_HostCallback_GetMusicalTimeLocation;
cbInfo.transportStateProc = MY_HostCallback_GetTransportState;
return mAU.SetProperty (kAudioUnitProperty_HostCallbacks,
kAudioUnitScope_Global, 0,
&cbInfo, size);
}
(in this example mAU is an instance of CAAudioUnit)
HTH
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
________________________________________________________________________
__
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.