Krotos Modules 3
Loading...
Searching...
No Matches
LabelCustomParameterAttachment.cpp
Go to the documentation of this file.
1namespace krotos
2{
4 UndoManager* /*um*/)
5 : label(l), customParameter(param)
6 {
7 label.addListener(this);
8 auto paramValue = param.getValue().toString();
9 setValue(paramValue);
10 }
11
13
15 {
16 const ScopedValueSetter<bool> svs(ignoreCallbacks, true);
17 label.setText(newValue, sendNotificationAsync);
18 }
19
20 void LabelCustomParameterAttachment::labelTextChanged(Label* labelThatHasChanged)
21 {
22 if (&label == labelThatHasChanged)
23 {
24 auto value = labelThatHasChanged->getTextValue();
25 customParameter.setValue(value, true);
26 }
27 }
28} // namespace krotos
A wrapper around juce::ValueTree designed to store custom plugin state (strings, arrays,...
Definition CustomParameter.h:9
const var & getValue() const
Definition CustomParameter.cpp:39
void setValue(const var &newValue, bool selfUpdate=false)
Definition CustomParameter.cpp:46
Label & label
Definition LabelCustomParameterAttachment.h:15
void labelTextChanged(Label *labelThatHasChanged) override
Definition LabelCustomParameterAttachment.cpp:20
CustomParameter & customParameter
Definition LabelCustomParameterAttachment.h:16
bool ignoreCallbacks
Definition LabelCustomParameterAttachment.h:17
LabelCustomParameterAttachment(CustomParameter &parameter, Label &label, UndoManager *undoManager=nullptr)
Definition LabelCustomParameterAttachment.cpp:3
~LabelCustomParameterAttachment() override
Definition LabelCustomParameterAttachment.cpp:12
void setValue(String &newValue)
Definition LabelCustomParameterAttachment.cpp:14
Definition AirAbsorptionFilter.cpp:2