WYSWYG editor for JUCE GUIs including Visualisers
Loading...
Searching...
No Matches
MagicProcessor Class Reference

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

#include <foleys_MagicProcessor.h>

Inherits AudioProcessor.

Public Member Functions

 MagicProcessor ()
 Creates a MagicProcessor, that inherits juce::AudioProcessor and adds connections to the editable GUI.
 
 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.
 
virtual juce::ValueTree createGuiValueTree ()
 This method is called to create the GUI.
 
virtual void postSetStateInformation ()
 If there is anything you need to do after a new state was loaded you can override this method.
 
juce::AudioProcessorEditor * createEditor () override
 
bool hasEditor () const override
 
void getStateInformation (juce::MemoryBlock &destData) override
 
void setStateInformation (const void *data, int sizeInBytes) override
 
double getTailLengthSeconds () const 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
juce::String text (BinaryData::magic_xml, BinaryData::magic_xmlSize);
return juce::ValueTree::fromXml (text);
}
MagicProcessorState magicState
Definition foleys_MagicProcessor.h:157

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:168

◆ 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.

References MagicProcessor::magicState.

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()

◆ hasEditor()

bool hasEditor ( ) const
override

◆ getStateInformation()

void getStateInformation ( juce::MemoryBlock & destData)
override

◆ setStateInformation()

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

◆ getTailLengthSeconds()

double getTailLengthSeconds ( ) const
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


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