Is there an iOS equivalent for detecting PluginHost type? For example, I’m looking at doing this to remove the input bus for when running GarageBand AUv3; when the input bus is present there’s no audio output.
As far as I can tell, AUv3 doesn’t provide an API to detect the host’s name or identifier. Maybe I’m looking in the wrong place - if there is such an API, then we can investigate adding support for it.
Yeah, I can’t find a way of doing that either via the AUv3 API. Probably because it’s running in a separate process to the host. Makes it very tricky…
However, I think I have done a massive hack to make it work. Essentially, in the juce_AUv3_Wrapper.mm the method loadView calls the AudioProcessor constructor. fr810 mentioned elsewhere you can debug this by adding a sleep() and attaching the Xcode debugger. Brilliant trick to figure out the call graph.
So, I separated out the AudioProcessor construction and set UIView so that loadView just creates a blank view (on the main thread, as expected).
But what we really need is createAudioUnitWithComponentDescription where we know the componentType. Then we can pass that type into the AudioProcessor constructor and make the appropriate buses.
In this case if it’s aumu only provide an output bus, while aumf create input and output. It seems GarageBand iOS can’t deal with an aumu with input and output and obviously our plugin can’t remove buses.
Unfortunately, createAU happens on it’s own thread. Therefore, my final hack looks like this:
With the corresponding hacks to pass the componentType into the createFilter into my AudioProcessor. It might be possible to further separate the UIView stuff from the bottom of the original loadView. Somehow they’re related to having an AudioProcessor which has an Editor which has an AU bus layout but my brain’s fried.
This works. I’m still testing this, but so far so good. Fingers crossed…