Home to Foleys Finest Audio

How to #1 add PluginGuiMagic to a new plugin

PluginGuiMagic consists of the module foleys_gui_magic. You get it from github.
To use it, you need to either clone the repository or download preferably the latest release.
CAVEAT: The Projucer will only accept the module if it has the name foleys_gui_magic. The download function adds a suffix, either the tag name or sometimes the branch name. You need to reverse that and rename the folder back to foleys_gui_magic.

Now you add the module via Projucer to the project, or if you use cmake use the correspondent method to add the module.
Then you remove the PluginEditor.h/.cpp files, they are no longer needed. Also remove the remaining include directive in PluginProcessor.h/.cpp.

The foleys plugin editor consists of two entities, a persistent part called foleys::MagicProcessorState and the actual foleys::MagicPluginEditor, that you will return in your createEditor() method:

// as members in your AudioProcessor class:
juce::AudioProcessorValueTreeState treeState { *this, nullptr };
foleys::MagicProcessorState magicState { *this, treeState };

// your createEditor():
juce::AudioProcessorEditor* MyAudioProcessor::createEditor()
{
    // You add the XML into BinaryData later. At the beginning just leave those 
    // arguments out and you get a default generated editor.
    return new foleys::MagicPluginEditor (magicState, BinaryData::magic_xml, BinaryData::magic_xmlSize);
}

When you build and run your plugin, you will get the generated plugin editor and an editor panel attached next to the editor window.

Once you created the GUI with this editor, you save the xml file, add it using the Projucer to the project and add it from BinaryData to the foleys::MagicPluginEditor constructor call.

As final step disable the editor panel in the Projucer, re-save the project and rebuild:

I hope that will get you going, let me know if there are problems.

Copyright © 2020 Foleys Finest Audio UG. All rights reserved.