-
- /* store each configuration */
-
- for (uint32_t n = 0; n < cnt; ++n) {
- cinfo.io_configs.push_back (pair<int,int> (channel_info[n].inChannels,
- channel_info[n].outChannels));
+ /* CAAudioUnit::GetChannelInfo silently merges bus formats
+ * check if this was the case and if so, add
+ * bus configs as incremental options.
+ */
+ Boolean* isWritable = 0;
+ UInt32 dataSize = 0;
+ OSStatus result = AudioUnitGetPropertyInfo (unit.AU(),
+ kAudioUnitProperty_SupportedNumChannels,
+ kAudioUnitScope_Global, 0,
+ &dataSize, isWritable);
+ if (result != noErr && (comp.Desc().IsGenerator() || comp.Desc().IsMusicDevice())) {
+ /* incrementally add busses */
+ int in = 0;
+ int out = 0;
+ for (uint32_t n = 0; n < cnt; ++n) {
+ in += channel_info[n].inChannels;
+ out += channel_info[n].outChannels;
+ cinfo.io_configs.push_back (pair<int,int> (in, out));
+ }
+ } else {
+ /* store each configuration */
+ for (uint32_t n = 0; n < cnt; ++n) {
+ cinfo.io_configs.push_back (pair<int,int> (channel_info[n].inChannels,
+ channel_info[n].outChannels));
+ }