#include <ModulationAssigner.h>
◆ ModSourceIndexPair
Alias for a kwidget modulation source and modulator index
◆ ModulationAssigner()
| krotos::ModulationAssigner::ModulationAssigner |
( |
KwidgetAudioProcessor & | processor, |
|
|
const StringArray & | kwidgetWhitelist = StringArray() ) |
Create a modulation assigner. This is a GUI component capable of creating assignable "DropComponents" to which draggable labels can be dragged onto. This creates modulation assignments via the KwidgetAudioProcessor.
A whitelist can be used to limit the types of kwidgets will create an assigner.
- Parameters
-
| modParentTree | The Modulations parent ValueTree |
| kwidgetWhitelist | A whitelist of kwidget types which the mod assigner will create drop zones for. If the list is empty, the assigner will create drop zones automatically for any modulator kwidgets added to the processor. |
- See also
- addToWhitelist, clearWhitelist
◆ ~ModulationAssigner()
| krotos::ModulationAssigner::~ModulationAssigner |
( |
| ) |
|
◆ addAssignment()
| void krotos::ModulationAssigner::addAssignment |
( |
ValueTree | assignment | ) |
|
|
private |
◆ addDropComponent()
| DropComponent * krotos::ModulationAssigner::addDropComponent |
( |
const String & | labelText, |
|
|
const String & | targetModSourceKwidgetID, |
|
|
int | targetModulatorIdx = -1 ) |
Add a new DropComponent. You may want to assign assignModulation() using the pointer returned here.
- Parameters
-
| labelText | The label text you want the DropComponent to display. |
| targetModSourceKwidgetID | The modulator kwidget ID that this drop component will target. |
| targetModulatorIdx | The modulation source ID within the targeted kwidgetID. |
◆ addMultiDropComponent()
| MultiDropComponent * krotos::ModulationAssigner::addMultiDropComponent |
( |
const String & | labelText, |
|
|
const String & | targetModSourceKwidgetID, |
|
|
int | numModulators, |
|
|
Array< Value > | labelValues = Array<Value>() ) |
Add a multi drop component. This will create a parent with drop components for the given number of modulators.
- Parameters
-
| labelText | The title label text for the multi drop component |
| targetModSourceKwidgetID | The modulator kwidget ID that this multi drop component will target |
| numModulators | The number of modulators to target |
| labelValues | An optional array of Value objects to attach to the drop component labels. This can be used to synchronise the labels with another source such as a property in a ValueTree. |
- Returns
- Returns a pointer to the newly created component.
◆ addTable()
Internal function to create a ModulationAssignerTable. Creates a new ModulationAssignerTable object, adds it to an OwnedArray and the table map, then creates a hidden tab which the table exists on
- Parameters
-
| name | Table label |
| modSourceIdx | Modulation source and index pair that this table should attach to. |
◆ addToWhitelist() [1/2]
| void krotos::ModulationAssigner::addToWhitelist |
( |
const StringArray & | KTypes | ) |
|
|
inline |
◆ addToWhitelist() [2/2]
| void krotos::ModulationAssigner::addToWhitelist |
( |
StringRef | KType | ) |
|
|
inline |
Add a kwidget type to the whitelist.
- Parameters
-
◆ attachKwidgetsTreeListener()
| void krotos::ModulationAssigner::attachKwidgetsTreeListener |
( |
const ValueTree & | tree | ) |
|
Attach a listener to the kwidget tree to automatically update the modulation assigner with drop components, when a modulation source is added.
- Parameters
-
◆ attachModTreeListener()
| void krotos::ModulationAssigner::attachModTreeListener |
( |
const ValueTree & | tree | ) |
|
Attaches the modulation assigner to listen to the modulation ValueTree, so it may update the tables to display the modulation assignments.
- Parameters
-
◆ clearWhitelist()
| void krotos::ModulationAssigner::clearWhitelist |
( |
| ) |
|
|
inline |
◆ colourChanged()
| void krotos::ModulationAssigner::colourChanged |
( |
| ) |
|
|
override |
◆ getDropComponents()
| Array< Component * > krotos::ModulationAssigner::getDropComponents |
( |
| ) |
|
|
inline |
◆ getTable()
Returns a pointer to a modulation table of a given id.
◆ initialiseData()
| void krotos::ModulationAssigner::initialiseData |
( |
| ) |
|
|
private |
Initialise from data in the ValueTree
◆ kwidgetAdded()
| void krotos::ModulationAssigner::kwidgetAdded |
( |
Kwidget * | k | ) |
|
|
overrideprivatevirtual |
◆ kwidgetRemoved()
| void krotos::ModulationAssigner::kwidgetRemoved |
( |
Kwidget * | k | ) |
|
|
overrideprivatevirtual |
◆ paintOverChildren()
| void krotos::ModulationAssigner::paintOverChildren |
( |
Graphics & | g | ) |
|
|
override |
◆ removeDropComponent()
| void krotos::ModulationAssigner::removeDropComponent |
( |
const String & | kwidgetID | ) |
|
Remove a DropComponent. Note, this does not remove it's corresponding table. You'll need to do this with removeTable(). Todo: as part of dual drop component refactor, we should marry these up.
- Parameters
-
◆ removeTable()
◆ resized()
| void krotos::ModulationAssigner::resized |
( |
| ) |
|
|
override |
◆ setIndicatorActive()
| void krotos::ModulationAssigner::setIndicatorActive |
( |
bool | isActive | ) |
|
Sets whether to draw a border around the component to highlight it as a target destination for a drag and drop.
- Parameters
-
| isActive | Draw the border or not. |
◆ valueTreeChildAdded()
| void krotos::ModulationAssigner::valueTreeChildAdded |
( |
ValueTree & | parentTree, |
|
|
ValueTree & | childWhichHasBeenAdded ) |
|
overrideprivate |
◆ valueTreeChildRemoved()
| void krotos::ModulationAssigner::valueTreeChildRemoved |
( |
ValueTree & | parentTree, |
|
|
ValueTree & | childWhichHasBeenRemoved, |
|
|
int | indexFromWhichChildWasRemoved ) |
|
overrideprivate |
◆ valueTreePropertyChanged()
| void krotos::ModulationAssigner::valueTreePropertyChanged |
( |
ValueTree & | treeWhosePropertyHasChanged, |
|
|
const Identifier & | property ) |
|
overrideprivate |
ValueTree Listener Callback Overrides
◆ assignModulation
| std::function<void(var desc, String targetModSourceKwidgetID, int targetModulatorIdx, ModulationAssignerTable* table)> krotos::ModulationAssigner::assignModulation |
Assign this function to be called when something is dropped onto one of the drop components.
- Parameters
-
| desc | The drag and drop description contaning the source kwidget and parameter ID |
| targetModSourceKwidgetID | The target modulation souce kwidget e.g. an XY Pad |
| targetModulatorIdx | The target modulator index of the mod source. e.g. 0 for X, 1 for Y |
| table | A pointer to the table component created for the modulation assignment. |
◆ m_borderColour
| Colour krotos::ModulationAssigner::m_borderColour {Colours::grey} |
|
private |
◆ m_cornerSize
| const float krotos::ModulationAssigner::m_cornerSize {4.0f} |
|
private |
◆ m_dropArea
This holds the drop components
◆ m_indicatorActive
| bool krotos::ModulationAssigner::m_indicatorActive {false} |
|
private |
◆ m_kwidgetTree
| ValueTree krotos::ModulationAssigner::m_kwidgetTree |
|
private |
◆ m_modulationParentTree
| ValueTree krotos::ModulationAssigner::m_modulationParentTree |
|
private |
◆ m_modulationTables
◆ m_padding
| const int krotos::ModulationAssigner::m_padding {4} |
|
private |
◆ m_processor
◆ m_property
| Identifier krotos::ModulationAssigner::m_property |
|
private |
◆ m_rowSize
| const int krotos::ModulationAssigner::m_rowSize {3} |
|
private |
◆ m_tableMap
A map to lookup tables via the modulation source they are attached to The pointers here are managed via the OwnedArray m_modulationTables so do not delete or manage their lifetimes using the pointers returned here
Todo: Create a remove function to safely remove Table pointers
◆ m_whitelist
| StringArray krotos::ModulationAssigner::m_whitelist |
|
private |
◆ modulationDeleted
| std::function<void(ValueTree modulationChildTree)> krotos::ModulationAssigner::modulationDeleted |
Called when a user deletes a row from the tablelist box. Assign this callback to delete modulation via the ParameterManager.
The documentation for this class was generated from the following files: