6 : m_processor(processor), m_modulationParentTree(processor.parameterManager.getModulationTree()),
7 m_kwidgetTree(processor.parameterManager.getKwidgetsTree()), TabbedComponent(TabbedButtonBar::TabsAtTop)
12 m_dropArea = std::make_unique<ModulationAssignerDropArea>();
22 addTab(
"Assign", findColour(TabbedComponent::backgroundColourId),
m_dropArea.get(),
true);
34 setTabBackgroundColour(0, findColour(TabbedComponent::backgroundColourId));
39 int targetModulatorIdx)
44 int tabIndex = getTabNames().indexOf(modTable->getId());
46 dropComponent->onDropped = [
this, targetModSourceKwidgetID, targetModulatorIdx, modTable](var desc) {
47 assignModulation(desc, targetModSourceKwidgetID, targetModulatorIdx, modTable);
51 dropComponent->onClick = [
this, tabIndex] { setCurrentTabIndex(tabIndex); };
58#if !ENABLE_QUICKFX_ASSIGNMENT
73 if (numModulators > 0)
75 Array<Value> labelValues = Array<Value>();
78 for (
auto param : customParams)
93#if !ENABLE_VELOCITY_ASSIGNMENT
100 if (numModulators > 0)
102 Array<Value> labelValues = Array<Value>();
105 for (
auto param : customParams)
119 const String& targetModSourceKwidgetID,
120 int numModulators, Array<Value> labelValues)
125 for (
int i = 0; i < numModulators; ++i)
127 auto label = labelText +
" " + String(i + 1) +
" Modulation";
130 int tabIndex = getTabNames().indexOf(modTable->getId());
131 auto* dropComponent = dc->getDropComponent(i);
132 dropComponent->onDropped = [
this, targetModSourceKwidgetID, i, modTable](var desc) {
135 dropComponent->onClick = [
this, tabIndex] { setCurrentTabIndex(tabIndex); };
138 if (!labelValues.isEmpty())
141 jassert(i < labelValues.size());
143 auto value = labelValues[i];
145 if (i < labelValues.size())
146 dropComponent->setLabelValue(value);
159 g.setColour(findColour(LassoComponent<TabbedComponent>::lassoOutlineColourId));
166 TabbedComponent::resized();
177 if (t->getId() ==
id)
186 auto id = String(modSourceIdx.first) + String(modSourceIdx.second);
187 auto colour = findColour(ResizableWindow::backgroundColourId);
190 m_tableMap.insert(std::pair<ModSourceIndexPair, ModulationAssignerTable*>(modSourceIdx, table));
192 addTab(table->getId(), colour, table,
true);
200 auto tabID = getTabNames().indexOf(table->getId());
201 if (table !=
nullptr)
235 for (
auto& k : kwidgets)
256 const Identifier& property)
258 (void)treeWhosePropertyHasChanged;
282 m_tableMap[pair]->deleteRow(childWhichHasBeenRemoved,
false);
285 if (
auto* dropComponent =
m_dropArea->findDropComponent(source, index))
287 dropComponent->setArmed(
false);
304 if (
auto* dropComponent =
m_dropArea->findDropComponent(source, index))
306 dropComponent->setArmed(
true);
A component for dropping draggable juce objects onto.
Definition DropComponent.h:11
ValueTree m_kwidgetTree
Definition ModulationAssigner.h:119
StringArray m_whitelist
Definition ModulationAssigner.h:122
void attachKwidgetsTreeListener(const ValueTree &tree)
Definition ModulationAssigner.cpp:222
void removeTable(ModSourceIndexPair modSourceIdx)
Definition ModulationAssigner.cpp:197
void valueTreeChildRemoved(ValueTree &parentTree, ValueTree &childWhichHasBeenRemoved, int indexFromWhichChildWasRemoved) override
Definition ModulationAssigner.cpp:270
std::pair< String, int > ModSourceIndexPair
Definition ModulationAssigner.h:151
void colourChanged() override
Definition ModulationAssigner.cpp:29
~ModulationAssigner()
Definition ModulationAssigner.cpp:27
KwidgetAudioProcessor & m_processor
Definition ModulationAssigner.h:180
ValueTree m_modulationParentTree
Definition ModulationAssigner.h:119
std::unique_ptr< ModulationAssignerDropArea > m_dropArea
Definition ModulationAssigner.h:144
const int m_padding
Definition ModulationAssigner.h:174
void removeDropComponent(const String &kwidgetID)
Definition ModulationAssigner.cpp:153
void addAssignment(ValueTree assignment)
Definition ModulationAssigner.cpp:292
ModulationAssigner(KwidgetAudioProcessor &processor, const StringArray &kwidgetWhitelist=StringArray())
Definition ModulationAssigner.cpp:5
DropComponent * addDropComponent(const String &labelText, const String &targetModSourceKwidgetID, int targetModulatorIdx=-1)
Definition ModulationAssigner.cpp:38
ModulationAssignerTable * getTable(String id)
Definition ModulationAssigner.cpp:173
void setIndicatorActive(bool isActive)
Sets whether to draw a border around the component to highlight it as a target destination for a drag...
Definition ModulationAssigner.cpp:310
ModulationAssignerTable * addTable(String label, ModSourceIndexPair modSourceIdx)
Definition ModulationAssigner.cpp:184
OwnedArray< ModulationAssignerTable > m_modulationTables
Definition ModulationAssigner.h:147
bool m_indicatorActive
Definition ModulationAssigner.h:178
void kwidgetAdded(Kwidget *k) override
Definition ModulationAssigner.cpp:56
void kwidgetRemoved(Kwidget *k) override
Definition ModulationAssigner.cpp:116
void resized() override
Definition ModulationAssigner.cpp:164
void valueTreePropertyChanged(ValueTree &treeWhosePropertyHasChanged, const Identifier &property) override
Definition ModulationAssigner.cpp:255
std::map< ModSourceIndexPair, ModulationAssignerTable * > m_tableMap
Definition ModulationAssigner.h:159
const float m_cornerSize
Definition ModulationAssigner.h:175
void initialiseData()
Definition ModulationAssigner.cpp:231
void paintOverChildren(Graphics &g) override
Definition ModulationAssigner.cpp:155
const int m_rowSize
Definition ModulationAssigner.h:174
void attachModTreeListener(const ValueTree &tree)
Definition ModulationAssigner.cpp:213
MultiDropComponent * 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 mo...
Definition ModulationAssigner.cpp:118
void addToWhitelist(StringRef KType)
Add a kwidget type to the whitelist.
Definition ModulationAssigner.h:105
void valueTreeChildAdded(ValueTree &parentTree, ValueTree &childWhichHasBeenAdded) override
Definition ModulationAssigner.cpp:262
std::function< void(var desc, String targetModSourceKwidgetID, int targetModulatorIdx, ModulationAssignerTable *table)> assignModulation
Definition ModulationAssigner.h:41
Definition ModulationAssignerTable.h:9
A simple container for a holding multiple drop components used for assigning modulation to a kwidget ...
Definition MultiDropComponent.h:16
Definition AirAbsorptionFilter.cpp:2
static const Identifier modulatorIndex
Definition XmlType.h:48
static const Identifier id
Definition XmlType.h:41
static const Identifier value
Definition XmlType.h:42
static const Identifier source
Definition XmlType.h:45
static const Identifier kwidgets
Definition XmlType.h:22
static const Identifier modulation
Definition XmlType.h:27
static const Identifier customParams
Definition XmlType.h:20
static const Identifier modulations
Definition XmlType.h:26