The MagicGuiState is the docking station for the MagicGUIBuilder. More...
#include <foleys_MagicGUIState.h>
Public Member Functions | |
MagicGUIState () | |
virtual | ~MagicGUIState () |
juce::ValueTree | getPropertyRoot () |
Returns the root node for exposed properties for the GUI. | |
juce::ValueTree | getPropertyRoot () const |
void | setGuiValueTree (const juce::ValueTree &dom) |
Set the GUI DOM to create the GUI components from. | |
void | setGuiValueTree (const char *data, int dataSize) |
void | setGuiValueTree (const juce::File &file) |
juce::ValueTree & | getGuiTree () |
Grants access to the gui tree. | |
juce::ValueTree & | getValueTree () |
void | setApplicationSettingsFile (juce::File file) |
Set a file to save common settings for all instances. | |
juce::ValueTree & | getSettings () |
This is a settings ValueTree that is stored globally for all plugin instances. | |
virtual juce::StringArray | getParameterNames () const |
Returns the IDs of AudioProcessorParameters for selection. | |
virtual juce::RangedAudioParameter * | getParameter (const juce::String ¶mID) |
virtual std::unique_ptr< juce::SliderParameterAttachment > | createAttachment (const juce::String ¶mID, juce::Slider &) |
virtual std::unique_ptr< juce::ComboBoxParameterAttachment > | createAttachment (const juce::String ¶mID, juce::ComboBox &) |
virtual std::unique_ptr< juce::ButtonParameterAttachment > | createAttachment (const juce::String ¶mID, juce::Button &) |
virtual juce::PopupMenu | createParameterMenu () const |
Return a hierarchical menu of the AudioParameters. | |
void | addTrigger (const juce::Identifier &triggerID, std::function< void()> function) |
You can store a lambda that can be called from e.g. | |
std::function< void()> | getTrigger (const juce::Identifier &triggerID) |
Returns a lambda to be connected to your components. | |
juce::Value | getPropertyAsValue (const juce::String &pathToProperty) |
Returns a property as value inside the ValueTreeState. | |
void | populatePropertiesMenu (juce::ComboBox &comboBox) const |
Populates a menu with properties found in the persistent ValueTree. | |
juce::PopupMenu | createPropertiesMenu (juce::ComboBox &combo) const |
juce::PopupMenu | createTriggerMenu () const |
juce::PopupMenu | createAssetFilesMenu () const |
template<typename T , typename... Ts> | |
T * | createAndAddObject (const juce::Identifier &objectID, Ts &&... t) |
Create and add an object. | |
template<typename ObjectType > | |
juce::StringArray | getObjectIDsByType () const |
Returns all identifiers of objects, that can be casted to the given type. | |
template<typename ObjectType > | |
ObjectType * | getObjectWithType (juce::Identifier objectID) |
Return an object by objectID. | |
void | clearAllObjects () |
This removes all objects managed by the MagicGuiState. | |
void | prepareToPlay (double sampleRate, int samplesPerBlockExpected) |
Call this method in your prepareToPlay implementation, to allow th visualisers to be properly setup. | |
void | addBackgroundProcessing (MagicPlotSource *source) |
Registers background processing. | |
juce::MidiKeyboardState & | getKeyboardState () |
virtual juce::AudioProcessor * | getProcessor () |
Return the referenced AudioProcessor, if this state can provide one. | |
void | setResourcesFolder (const juce::String &name) |
juce::File | getResourcesFolder () const |
The MagicGuiState is the docking station for the MagicGUIBuilder.
You can register properties or objects there, that your GuiItems will connect to. It is also the place, where the data for the visualisers is sent to, which are MagicPlotSources and MagicLevelSources.
MagicGUIState | ( | ) |
|
virtual |
juce::ValueTree getPropertyRoot | ( | ) |
Returns the root node for exposed properties for the GUI.
Referenced by MagicGUIState::getPropertyAsValue().
juce::ValueTree getPropertyRoot | ( | ) | const |
void setGuiValueTree | ( | const juce::ValueTree & | dom | ) |
Set the GUI DOM to create the GUI components from.
Referenced by MagicProcessor::createEditor(), ToolBox::loadGUI(), MagicGUIState::setGuiValueTree(), and MagicGUIState::setGuiValueTree().
void setGuiValueTree | ( | const char * | data, |
int | dataSize ) |
References MagicGUIState::setGuiValueTree().
void setGuiValueTree | ( | const juce::File & | file | ) |
References MagicGUIState::setGuiValueTree().
juce::ValueTree & getGuiTree | ( | ) |
Grants access to the gui tree.
This is returned as reference so you are able to connect listeners to it.
Referenced by MagicProcessor::createEditor(), MagicGUIBuilder::getConfigTree(), and MagicPluginEditor::MagicPluginEditor().
juce::ValueTree & getValueTree | ( | ) |
void setApplicationSettingsFile | ( | juce::File | file | ) |
Set a file to save common settings for all instances.
juce::ValueTree & getSettings | ( | ) |
This is a settings ValueTree that is stored globally for all plugin instances.
|
virtual |
Returns the IDs of AudioProcessorParameters for selection.
Reimplemented in MagicProcessorState.
|
virtual |
Reimplemented in MagicProcessorState.
Referenced by GuiItem::itemDragEnter(), LabelItem::update(), and ToggleButtonItem::update().
|
virtual |
Reimplemented in MagicProcessorState.
Referenced by ComboBoxItem::update(), SliderItem::update(), TextButtonItem::update(), and ToggleButtonItem::update().
|
virtual |
Reimplemented in MagicProcessorState.
|
virtual |
Reimplemented in MagicProcessorState.
|
virtual |
Return a hierarchical menu of the AudioParameters.
Implemented in MagicPluginState
Reimplemented in MagicProcessorState.
Referenced by MagicGUIBuilder::createParameterMenuLambda().
void addTrigger | ( | const juce::Identifier & | triggerID, |
std::function< void()> | function ) |
You can store a lambda that can be called from e.g.
a TextButton.
std::function< void()> getTrigger | ( | const juce::Identifier & | triggerID | ) |
Returns a lambda to be connected to your components.
Referenced by TextButtonItem::update().
juce::Value getPropertyAsValue | ( | const juce::String & | pathToProperty | ) |
Returns a property as value inside the ValueTreeState.
The nodes are a colon separated list, the last component is the property name
References MagicGUIState::getPropertyRoot().
Referenced by Stylesheet::updateStyleClasses().
void populatePropertiesMenu | ( | juce::ComboBox & | comboBox | ) | const |
Populates a menu with properties found in the persistent ValueTree.
Referenced by MagicGUIBuilder::createPropertiesMenuLambda().
juce::PopupMenu createPropertiesMenu | ( | juce::ComboBox & | combo | ) | const |
juce::PopupMenu createTriggerMenu | ( | ) | const |
Referenced by MagicGUIBuilder::createTriggerMenuLambda().
juce::PopupMenu createAssetFilesMenu | ( | ) | const |
T * createAndAddObject | ( | const juce::Identifier & | objectID, |
Ts &&... | t ) |
Create and add an object.
The type to create needs to be added as template parameter, the arguments will be forwarded to the constructor.
References MagicGUIState::addBackgroundProcessing().
juce::StringArray getObjectIDsByType | ( | ) | const |
Returns all identifiers of objects, that can be casted to the given type.
Referenced by MagicGUIBuilder::createObjectsMenuLambda().
ObjectType * getObjectWithType | ( | juce::Identifier | objectID | ) |
Return an object by objectID.
The returned type needs to be specified as template parameter. If there is no object with that objectID, or the object is not of the selected type, this will return a nullptr.
objectID | is the ID to identify the object. |
void clearAllObjects | ( | ) |
This removes all objects managed by the MagicGuiState.
Make sure all objects that depend on those objects are deleted first (especially GUI)
void prepareToPlay | ( | double | sampleRate, |
int | samplesPerBlockExpected ) |
Call this method in your prepareToPlay implementation, to allow th visualisers to be properly setup.
void addBackgroundProcessing | ( | MagicPlotSource * | source | ) |
Registers background processing.
References MagicPlotSource::getBackgroundJob().
Referenced by MagicGUIState::createAndAddObject().
juce::MidiKeyboardState & getKeyboardState | ( | ) |
Referenced by MagicProcessorState::processMidiBuffer().
|
virtual |
Return the referenced AudioProcessor, if this state can provide one.
Reimplemented in MagicProcessorState.
void setResourcesFolder | ( | const juce::String & | name | ) |
juce::File getResourcesFolder | ( | ) | const |
Referenced by MagicGUIBuilder::attachToolboxToWindow().