Gotcha. It doesn't seem to be workable without modifying some JUCE files, which seems to be what was done in the threads you linked.
As for the AudioChannelInfo structure, this has worked for me is this (this example is for mono-mono that I pulled from a working project, it is an Effect, not a generator, but just to show working code):
#include "CAAudioChannelLayout.h"
//In the'public:' section of the effectbase class:
virtual UInt32 SupportedNumChannels(const AUChannelInfo** outInfo);
// In the source
MyProjectAU::MyProjectAU(AudioUnit component) : AUEffectBase(component)
{
CreateElements ();
CAStreamBasicDescription streamDesc;
streamDesc.SetCanonical(1, false); // sets to one channel only
streamDesc.mSampleRate = GetSampleRate();
Inputs().GetIOElement(0)->SetStreamFormat(streamDesc);
Outputs().GetIOElement(0)->SetStreamFormat(streamDesc);
}
UInt32 MyProjectAU::SupportedNumChannels (const AUChannelInfo** outInfo)
{
static const AUChannelInfo sChannels[1] = {{1,1}}; // array for explicit mono-mono
if (outInfo) *outInfo = sChannels;
return sizeof (sChannels) / sizeof (AUChannelInfo);
}
But that is an effect, not a generator and that doesn't really help, so to check I also hacked one of the Apple example generator AUs into working using similar code to see if it would work. For you in the case of a multi-channel NxM 16-ch audiounit, change that to something like this:
YourProjectAU::YourProjectAU(AudioUnit component) : AUEffectBase(component)
{
CreateElements ();
CAStreamBasicDescription streamOut;
streamOut.SetCanonical(16, false); // number of output channels
streamOut.mSampleRate = 44100; // I explicitly set the samplerate, but you could fetch it
Outputs().GetIOElement(0)->SetStreamFormat(streamOut);
}
UInt32 YourProjectAU::SupportedNumChannels (const AUChannelInfo** outInfo)
{
static const AUChannelInfo numChannels[1] = {{0, 16}}; // zero-in, exactly 16-out
if (outInfo) *outInfo = numChannels;
return sizeof (numChannels) / sizeof (AUChannelInfo);
}
It DID work just fine, but I also had to override the initialize(); function to define the number of outputs by fetching the output and return no error on 16 channels get it to behave in (something like 'SInt16 auNumOfOutputs = (SInt16) GetOutput(0)->GetStreamFormat().mChannelsPerFrame;'), and then cycled through the outputBufList with a loop in the render function, so I am hopeful it would work in JUCE if the library files were modified a bit, like in the second thread you linked.
As for the error "WARNING: Source AU supports multi-channel output but does not provide a channel layout", I got that too, but it did not seem to have any effect on the plugin loading and functioning. Apple only had layouts defined up to 8 channels under kAudioChannelLayout, so (i THINK) you can ignore it since the plugin I rolled loaded up in JUCE's host app just fine and presented all 16 outputs, but I suppost if the host does a check for the kAudioChannelLayout specifically, it can choosse to not load the plugin, but I have absolutely no idea if that is a common thing to do OR if you can define a custom layout tag as a workaround if it is an issue. (I did find one layout that is 16-channel "kAudioChannelLayoutTag_TMH_10_2_std" but I have no idea what that is for.)
Hope that helps.