AudioPluginFormatManager format list is NULL

I am trying to load an Audio Unit plug in and wrap it. At first I thought I had a problem with the fileOrIdentifier in the PluginDescription class, but if you take a look at the following code, the problem is with the AudioPluginFormatManager. After instantiating and calling addDefaultFormats on a Mac, the OwnedArray formats member variable is still empty. I cannot load an Audio Unit plug in if the format manager is always empty and can’t search for the AU format.

juce::AudioPluginFormatManager fm;
fm.addDefaultFormats();

juce::PluginDescription descr;
descr.pluginFormatName = "AudioUnit";
descr.category = "Effect";
descr.manufacturerName = "coov";
descr.version = "67076";
descr.name = "3dem";
descr.descriptiveName = "Room Sim";

std::string code = "3dem";
std::string mfgCode = "coov";
descr.fileOrIdentifier = "AudioUnit:Effects/aufx," + code
                       + "," + mfgCode;

juce::String ignore;
mAUPlugIn = nullptr;
mAUPlugIn = fm.createPluginInstance (descr, 44100.0, 512, ignore);

Additional information: Although I am on a Mac, the JUCE_PLUGINHOST_AU macro is not defined. Once I hard coded it as 1, the code above started working. However, changing the JUCE code to get this to work is not a solution. Why is this Macro not defined for anybody on a Mac with a large number of AU plugins in the code path?

JUCE_PLUGINHOST_AU has to be enabled on the build system side. If you’re using Projucer, it’s part of the juce_audio_processors module settings. If you’re using the CMake support of JUCE 6, you have to pass PLUGINHOST_AU TRUE to the juce_add_* function.

I hope this helps!

1 Like

Thanks McMartin. I went back in and enabled this in the Projucer and then recreated the project.
Second question - There is Juce documentation, but it is essentially just an output, (Doxygen or something else), of the header file, which I can find in the code. The header files list functions and member variables, but they don’t list the valid choices for the member variables or the expected behavior. Besides the tutorials, which only hit on a subset of all issues, is there additional documentation any where? For instance, is the only way to find out what all the pluginFormatNames are that are possible in the PluginDescription class to use trial and error? Are those choices, as an example, documented somewhere?