Re: AudioChannelLayout support in AUs
Re: AudioChannelLayout support in AUs
- Subject: Re: AudioChannelLayout support in AUs
- From: William Stewart <email@hidden>
- Date: Mon, 12 Nov 2007 11:47:01 -0800
On Nov 10, 2007, at 9:24 AM, Sophia Poirier [dfx] wrote:
I can't figure out how one is supposed to be able to support the
kAudioUnitProperty_AudioChannelLayout in an AUBase-derived AU. From
what I've been able to divine from scouring the AU SDK sources,
there seem to me to be several roadblocks:
1) The implementations in GetAudioChannelLayout(),
SetAudioChannelLayout(), and RemoveAudioChannelLayout() in AUBase
all rely on delegating to the implementations in AUIOElement
instances.
Yes - by default these properties aren't implemented
However, all of the implementations in that class leave the
operations unsupported. And since the element instances are created
by AUBase, I don't see a way to implement the behavior in your own
subclass of AUIOElement. So it seems that AUBase just has a
complicated way of leaving the whole thing unsupported. I don't
understand why.
You create your own element class, and then define the CreateElements
method to create that class. For example this is what we do for
AUMatrixReverb
AUElement * AUMatrixReverb::CreateElement( AudioUnitScope scope,
AudioUnitElement element)
{
if (scope == kAudioUnitScope_Output && element == 0)
return new MRevOutputElement (this);
else
return AUBase::CreateElement (scope, element);
}
That then leaves you with the task of implementing the required
methods in your element class (and should answer your remaining
questions).
However, we also realised that this was a bit cumbersome, so in the
Leopard SDK we've re-worked this so that you can overide the methods
in AUBase and just implement the semantics directly without having to
factor your implementation into a custom element. You can still do the
custom element (and we do) as that is a useful approach for many
implementations.
Bill
_______________________________________________
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