Re: MusicDevice mono/stereo
Re: MusicDevice mono/stereo
- Subject: Re: MusicDevice mono/stereo
- From: Marc Poirier <email@hidden>
- Date: Fri, 21 Nov 2003 09:38:29 -0600 (CST)
On Fri, 21 Nov 2003, Mark's Studio wrote:
>
What do i have to do to make my musicdevice show up in both the mono
>
and stereo plugin menu in logic?
>
>
this is what i do now
>
SampleEffectUnit::SampleEffectUnit(AudioUnit
>
component):MusicDeviceBase(component,0,1,0)
U want 2 override SupportedNumChannels. I'm not at home now, so you ought
to double check that I got all the stub right for that AUBase method, but
you'll want to add I think:
virtual UInt32 SupportedNumChannels(AUChannelInfo ** outInfo);
in the public part of your class definition and then implement the
function something like this:
UInt32 YourSynthClass::SupportedNumChannels(AUChannelInfo ** outInfo)
{
static AUChannelInfo synthChannels[] = { {0, 1}, {0, 2} };
if (outInfo != NULL)
*outInfo = synthChannels;
return sizeof(synthChannels) / sizeof(AUChannelInfo);
}
That way you specify that your unit can 2 specific channel configurations:
0-in/1-out and 0-in/2-out.
The reason why synthChannels is static is because it needs to live beyond
the scope of that function for the host to access the results. You could
also make it a member of your class, but since the values in it won't ever
change, it doesn't matter, either way will work.
(I tried to include all of the implementation details since I remember you
mentioning that you don't know C++ so well yet, but hopefully this didn't
come off like I'm not giving you enough credit.)
Marc
_______________________________________________
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.