Re: ClassInfo & PresentPreset confusion
Re: ClassInfo & PresentPreset confusion
- Subject: Re: ClassInfo & PresentPreset confusion
- From: William Stewart <email@hidden>
- Date: Tue, 11 Oct 2005 15:07:08 -0700
On 11/10/2005, at 10:59 AM, Pavol Markovic wrote:
On Oct 11, 2005, at 6:55 PM, Muon Software Ltd - Dave wrote:
UInt32 AUSynth::SupportedNumChannels(const AUChannelInfo** outInfo)
{
static const AUChannelInfo asChannelInfo[] = { { 0, 2 } };
if ( outInfo )
*outInfo = asChannelInfo;
return 1;
}
Is that definately right for an AU with 4 stereo outputs (but
supporting
mono and a single stereo output by fudging the buffer pointers)?
With this code my AU doesn't show in the Mono or Multichannel
menus in Logic
6.3.3. It also hangs AU Lab when trying to add the AU.
If you want to support mono also, change it to:
UInt32 AUSynth::SupportedNumChannels(const AUChannelInfo** outInfo)
{
static const AUChannelInfo asChannelInfo[] = { { 0, 1 }, { 0,
2 } };
if ( outInfo )
*outInfo = asChannelInfo;
return 2;
}
But this will allow host to set mono channel configuration on all
buses, after reading your previous mail I see you need 4 pure
stereo outputs.
So I guess overriding ValidFormat() method and do additional
checking, something like:
bool AUSynth::ValidFormat(AudioUnitScope inScope, AudioUnitElement
inElement, const CAStreamBasicDescription & inNewFormat)
{
if ( FormatIsCanonical(inNewFormat) )
{
if (Outputs().GetNumberOfElements() == 1)
{
return ( (inElement == 0) && ((inNewFormat.mChannelsPerFrame
== 1) || (inNewFormat.mChannelsPerFrame == 2)) )
}
else
{
return (inNewFormat.mChannelsPerFrame == 2)
}
}
return false;
}
Hmmm... I was wondering if someone would suggest this.
Theoretically this is illegal.
By publishing { 0, 1} and { 0, 2 } you are in affect saying that
*any* of your output buses can be set to mono or stereo. There isn't
any statement here that qualifies that requirement.
We've explored various ways of expressing more flexible configuration
options, none of which are we entirely happy with. If you look at
this AU in AU Lab for instance, you will see the mono option provided
for any of these outputs however. Of course, now you are in the gray
area where your AU is rejecting a configuration it said is valid -
how the host responds to this is undefined.
Thus, my comment that you would need to support mono or stereo on any
of your output buses. This is discussed in greater detail in the
documentation within the SDK.
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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