foleys_gui_magic
WYSWYG editor for JUCE GUIs including Visualisers
Public Member Functions | Protected Attributes | List of all members
MagicProcessor Class Reference

This is a convenience class to create a plugin using PluginGuiMagic. More...

Inherits AudioProcessor.

Public Member Functions

 MagicProcessor ()
 Creates a MagicProcessor, that inherits juce::AudioProcessor and adds connections to the editable GUI. More...
 
 MagicProcessor (const BusesProperties &ioLayouts)
 
 MagicProcessor (const std::initializer_list< const short[2]> &channelLayoutList)
 
virtual void initialiseBuilder (MagicGUIBuilder &builder)
 Override that method to initialise the builder, register your own bespoke components or LookAndFeel classes. More...
 
virtual juce::ValueTree createGuiValueTree ()
 This method is called to create the GUI. More...
 
virtual void postSetStateInformation ()
 If there is anything you need to do after a new state was loaded you can override this method. More...
 
juce::AudioProcessorEditor * createEditor () override
 
bool hasEditor () const override
 
void getStateInformation (juce::MemoryBlock &destData) override
 
void setStateInformation (const void *data, int sizeInBytes) override
 
int getNumPrograms () override
 
int getCurrentProgram () override
 
void setCurrentProgram (int index) override
 
const juce::String getProgramName (int index) override
 
void changeProgramName (int index, const juce::String &newName) override
 

Protected Attributes

MagicProcessorState magicState { *this }
 

Detailed Description

This is a convenience class to create a plugin using PluginGuiMagic.

It has all wired up for you, The MagicPluginEditor for you to design or use the generic default, the loading and saving of the state and many more.

In the createGuiValueTree() you can create the GUI ValueTree either by using

juce::ValueTree EqualizerExampleAudioProcessor::createGuiValueTree()
{
// generate a default GUI deduced from Parameters, ParameterGroups and MagicPlotSources
return magicState.createDefaultGUITree();
// or you load an existing one from BinaryData
return juce::ValueTree::fromXml (text);
}
MagicProcessorState magicState
Definition: foleys_MagicProcessor.h:158
const int magic_xmlSize
Definition: EqualizerExample/juce_binarydata_EqualizerExample_data/JuceLibraryCode/BinaryData.h:15
const char * magic_xml
Definition: EqualizerExample/juce_binarydata_EqualizerExample_data/JuceLibraryCode/BinaryData2.cpp:257

Constructor & Destructor Documentation

◆ MagicProcessor() [1/3]

Creates a MagicProcessor, that inherits juce::AudioProcessor and adds connections to the editable GUI.

The floating editor toolbox allows auto save. To use that add this macro in the constructor to let the editor know the location of the source files:

#define FOLEYS_SET_SOURCE_PATH(source)
Definition: foleys_MagicProcessor.h:169

◆ MagicProcessor() [2/3]

MagicProcessor ( const BusesProperties &  ioLayouts)

◆ MagicProcessor() [3/3]

MagicProcessor ( const std::initializer_list< const short[2]> &  channelLayoutList)

Member Function Documentation

◆ initialiseBuilder()

void initialiseBuilder ( MagicGUIBuilder builder)
virtual

Override that method to initialise the builder, register your own bespoke components or LookAndFeel classes.

If you override this and you want to use the bundled components don't forget to call those two lines, otherwise you won't have any Components or LookAndFeels to choose from

builder.registerJUCEFactories();
builder.registerJUCELookAndFeels();

References MagicGUIBuilder::registerJUCEFactories(), and MagicGUIBuilder::registerJUCELookAndFeels().

Referenced by MagicProcessor::createEditor().

◆ createGuiValueTree()

juce::ValueTree createGuiValueTree ( )
virtual

This method is called to create the GUI.

The default implementation will come up with a ValueTree containing a default Stylesheet and populate the GUI components from the AudioProcessorParameters it finds using getParameterTree() as well as getting the MagicPlotSources.

You can override this method with your bespoke algorithm to create a ValueTree or to load your ValueTree from BinaryData.

Referenced by MagicProcessor::createEditor().

◆ postSetStateInformation()

virtual void postSetStateInformation ( )
virtual

If there is anything you need to do after a new state was loaded you can override this method.

Referenced by MagicProcessor::setStateInformation().

◆ createEditor()

juce::AudioProcessorEditor * createEditor ( )
override

◆ hasEditor()

bool hasEditor ( ) const
override

◆ getStateInformation()

void getStateInformation ( juce::MemoryBlock &  destData)
override

◆ setStateInformation()

void setStateInformation ( const void *  data,
int  sizeInBytes 
)
override

◆ getNumPrograms()

int getNumPrograms ( )
override

◆ getCurrentProgram()

int getCurrentProgram ( )
override

◆ setCurrentProgram()

void setCurrentProgram ( int  index)
override

◆ getProgramName()

const juce::String getProgramName ( int  index)
override

◆ changeProgramName()

void changeProgramName ( int  index,
const juce::String &  newName 
)
override

Member Data Documentation

◆ magicState

MagicProcessorState magicState { *this }
protected

The documentation for this class was generated from the following files: