Newb - I created a Label in PluginEditor, how do I change that label in PluginProcessor?

I declared a label juce::Label myLabel; in the PluginEditor.h , and addAndMakeVisible() in PluginEditor.cpp.

I want to change the text of that label in PluginProcessor.cpp. myLabel.setText()

How do I reference it?

You can’t modify the editor from the processor directly (or shouldn’t). Basically the reason is that the processor is a unit that does not have to depend on anything, it could have more than one editor, or even not have any. I also think that it is not possible to call repaint from the process thread. In any case, all communication must always be done from the editor to the processor

I guess the easiest way is a timer in the editor that constantly checks a string declared in the processor, and updates the label when it changes. Just start the timer in the editor’s constructor with the resolution in milliseconds Timer::startTimer(100); and override el method timerCallback()

1 Like

OK, I found another way of doing it in the PluginEditor.cpp, the listener sliderValueChanged()