10 : Component(name), m_id(id), m_assigner(owner), m_backButton(
"Back"), m_titleLabel(name, name), m_numRows(0)
15 auto tabs =
dynamic_cast<TabbedComponent*
>(this->getParentComponent());
21 m_titleLabel.setJustificationType(juce::Justification::centredRight);
28 m_table.getViewport()->setScrollBarThickness(6);
39 m_table.getHeader().setStretchToFitActive(
true);
49 g.fillAll(getLookAndFeel().findColour(ListBox::backgroundColourId));
52 g.fillAll(Colours::white.withAlpha(0.04f));
59 g.setColour(getLookAndFeel().findColour(juce::ListBox::textColourId));
60 g.setFont(
m_font.withExtraKerningFactor(0.1f));
74 g.drawText(text, 8, 0, width - 4, height, juce::Justification::centredLeft,
true);
78 Component* existingComponentToUpdate)
83 auto* depthSlider =
static_cast<ModDepthSlider*
>(existingComponentToUpdate);
85 if (depthSlider ==
nullptr)
97 auto* deleteButton =
static_cast<DrawableButton*
>(existingComponentToUpdate);
99 if (deleteButton ==
nullptr)
101 deleteButton =
new DrawableButton(
"", DrawableButton::ButtonStyle::ImageFitted);
102 std::unique_ptr<Drawable> defaultCross(
103 Drawable::createFromImageData(KrotosBinaryData::table_close_button_faded_svg,
104 KrotosBinaryData::table_close_button_faded_svgSize));
105 std::unique_ptr<Drawable> crossHover(
106 Drawable::createFromImageData(KrotosBinaryData::table_close_button_very_faded_svg,
107 KrotosBinaryData::table_close_button_very_faded_svgSize));
108 std::unique_ptr<Drawable> crossClicked(
109 Drawable::createFromImageData(KrotosBinaryData::table_close_button_solid_svg,
110 KrotosBinaryData::table_close_button_solid_svgSize));
111 deleteButton->setImages(defaultCross.get(), crossHover.get(), crossClicked.get());
112 deleteButton->onClick = [
this, rowNumber]() {
deleteRow(rowNumber,
true); };
121 jassert(existingComponentToUpdate ==
nullptr);
127 g.setColour(getLookAndFeel().findColour(ListBox::outlineColourId));
128 g.fillRoundedRectangle(getLocalBounds().toFloat(), 4.0f);
130 const Colour horizontalLineColour(0x33FFFFFF);
131 g.setColour(horizontalLineColour);
132 g.fillRect( 0, 20, getWidth(), 1);
137 auto bounds = getLocalBounds();
138 auto topBar = bounds.removeFromTop(21);
139 topBar.removeFromLeft(8);
142 m_table.setBounds(bounds.withX(0).withWidth(getWidth()));
224 : m_owner(modList), Slider(Slider::SliderStyle::LinearHorizontal, Slider::TextEntryBoxPosition::NoTextBox)
227 setLookAndFeel(&
m_laf);
228 setRange(-1.0, 1.0, 0.01);
229 setValue(0.0, dontSendNotification);
230 setDoubleClickReturnValue(
true, 0.0);
237 const Identifier& property)
242 m_property = property;
244 m_tree.addListener(
this);
249 m_tree.setPropertyExcludingListener(
this, m_property, getValue(),
nullptr);
254 if (property == m_property)
255 setValue(tree[property]);
260 setPopupDisplayEnabled(
true,
true, findParentComponentOfClass<AudioProcessorEditor>());
void setDrawMirrored(bool shouldDrawMirrored)
Definition BipolarSliderLAF.h:11
Definition ModulationAssigner.h:12
std::function< void(ValueTree modulationChildTree)> modulationDeleted
Definition ModulationAssigner.h:97
Definition ModulationAssignerTable.h:113
void lookAndFeelChanged() override
Definition ModulationAssignerTable.cpp:258
ModDepthSlider(ModulationAssignerTable &modList)
Definition ModulationAssignerTable.cpp:223
~ModDepthSlider()
Definition ModulationAssignerTable.cpp:234
BipolarSliderLAF m_laf
Definition ModulationAssignerTable.h:130
void valueTreePropertyChanged(ValueTree &treeWhosePropertyHasChanged, const Identifier &property) override
Definition ModulationAssignerTable.cpp:252
void valueChanged() override
Definition ModulationAssignerTable.cpp:247
void setAttachment(int row, int column, const ValueTree &tree, const Identifier &property)
Definition ModulationAssignerTable.cpp:236
Definition ModulationAssignerTable.h:9
int getNumRows() override
Definition ModulationAssignerTable.cpp:44
ModulationAssigner & m_assigner
Definition ModulationAssignerTable.h:85
void paint(Graphics &g)
Definition ModulationAssignerTable.cpp:125
const int k_maxAppendLength
Definition ModulationAssignerTable.h:105
void resized() override
Definition ModulationAssignerTable.cpp:135
void deleteRow(const ValueTree &modulationInstanceTree, int row, bool notifyAssigner)
Definition ModulationAssignerTable.cpp:176
std::vector< ValueTree > m_modulationTrees
Definition ModulationAssignerTable.h:88
Label m_titleLabel
Definition ModulationAssignerTable.h:91
@ col_Source
Definition ModulationAssignerTable.h:69
@ col_Delete
Definition ModulationAssignerTable.h:72
@ col_Depth
Definition ModulationAssignerTable.h:71
@ col_Destination
Definition ModulationAssignerTable.h:70
int m_numRows
Definition ModulationAssignerTable.h:102
StringArray m_destinations
Definition ModulationAssignerTable.h:96
Component * refreshComponentForCell(int rowNumber, int columnId, bool isRowSelected, Component *existingComponentToUpdate) override
Definition ModulationAssignerTable.cpp:77
TableListBox m_table
Definition ModulationAssignerTable.h:98
Font m_font
Definition ModulationAssignerTable.h:99
void addRow(const ValueTree &modulationInstanceTree)
Definition ModulationAssignerTable.cpp:145
void paintCell(Graphics &g, int rowNumber, int columnId, int width, int height, bool rowIsSelected) override
Definition ModulationAssignerTable.cpp:56
void paintRowBackground(Graphics &g, int rowNumber, int width, int height, bool rowIsSelected) override
Definition ModulationAssignerTable.cpp:46
const Identifier m_depthIdentifier
Definition ModulationAssignerTable.h:87
StringArray m_sources
Definition ModulationAssignerTable.h:95
TextButton m_backButton
Definition ModulationAssignerTable.h:90
const int k_dropTabIndex
Definition ModulationAssignerTable.h:104
ModulationAssignerTable(ModulationAssigner &owner, String name, String id)
Definition ModulationAssignerTable.cpp:9
Definition AirAbsorptionFilter.cpp:2
static const String TextButtonBackId
Definition ModulationAssignerTable.h:79
static const String TextButtonDeleteId
Definition ModulationAssignerTable.h:80
static const String SliderDepthId
Definition ModulationAssignerTable.h:81
static const Identifier modulatorIndex
Definition XmlType.h:48
static const Identifier destination
Definition XmlType.h:46
static const Identifier source
Definition XmlType.h:45
static const Identifier depth
Definition XmlType.h:49
static const Identifier param
Definition XmlType.h:47