The MagicGuiState is the docking station for the MagicGUIBuilder. More...
Public Member Functions | |
MagicGUIState () | |
virtual | ~MagicGUIState () |
juce::ValueTree | getPropertyRoot () |
Returns the root node for exposed properties for the GUI. More... | |
juce::ValueTree | getPropertyRoot () const |
void | setGuiValueTree (const juce::ValueTree &dom) |
Set the GUI DOM to create the GUI components from. More... | |
void | setGuiValueTree (const char *data, int dataSize) |
void | setGuiValueTree (const juce::File &file) |
juce::ValueTree & | getGuiTree () |
Grants access to the gui tree. More... | |
juce::ValueTree & | getValueTree () |
void | setApplicationSettingsFile (juce::File file) |
Set a file to save common settings for all instances. More... | |
juce::ValueTree & | getSettings () |
This is a settings ValueTree that is stored globally for all plugin instances. More... | |
virtual juce::StringArray | getParameterNames () const |
Returns the IDs of AudioProcessorParameters for selection. More... | |
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. More... | |
void | addTrigger (const juce::Identifier &triggerID, std::function< void()> function) |
You can store a lambda that can be called from e.g. More... | |
std::function< void()> | getTrigger (const juce::Identifier &triggerID) |
Returns a lambda to be connected to your components. More... | |
juce::Value | getPropertyAsValue (const juce::String &pathToProperty) |
Returns a property as value inside the ValueTreeState. More... | |
void | populatePropertiesMenu (juce::ComboBox &comboBox) const |
Populates a menu with properties found in the persistent ValueTree. More... | |
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. More... | |
template<typename ObjectType > | |
juce::StringArray | getObjectIDsByType () const |
Returns all identifiers of objects, that can be casted to the given type. More... | |
template<typename ObjectType > | |
ObjectType * | getObjectWithType (juce::Identifier objectID) |
Return an object by objectID. More... | |
void | prepareToPlay (double sampleRate, int samplesPerBlockExpected) |
Call this method in your prepareToPlay implementation, to allow th visualisers to be properly setup. More... | |
void | addBackgroundProcessing (MagicPlotSource *source) |
Registers background processing. More... | |
juce::MidiKeyboardState & | getKeyboardState () |
virtual juce::AudioProcessor * | getProcessor () |
Return the referenced AudioProcessor, if this state can provide one. More... | |
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::createPropertiesMenu(), and 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(), 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 ToggleButtonItem::update().
|
virtual |
Reimplemented in MagicProcessorState.
Referenced by 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().
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 |
References MagicGUIState::getPropertyRoot().
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.
juce::StringArray getObjectIDsByType | ( | ) | const |
Returns all identifiers of objects, that can be casted to the given type.
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 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 | ( | ) |
Referenced by MagicProcessorState::processMidiBuffer().
|
virtual |
Return the referenced AudioProcessor, if this state can provide one.
Reimplemented in MagicProcessorState.