I am new to juce and I have a question.
I am building an audio plugin with Juce and I computed a float value in the process block.
What I want now is to print it on the GUI, instead of the ‘Hello World’ message.
I tried to use the variable in the process editor:
g.drawFittedText (String(valueLevelLeft), getLocalBounds(), Justification::centred, 1);
But it doesn’t see my variable ‘valueLevelLeft’, which I defined in the PluginProcessor header and used in the PluginProcessor.cpp. (error message: Use of undeclared identifier ‘valueLevelLeft’)
How can I pass this variable from the processor to the editor?
The valueLevelLeft should be an atomic variable to avoid wrong behaviors which might happen due to compiler optimizations and the multiple threads involved. (Use std::atomic<float> instead of just float.)
The GUI will not repaint itself automatically, you will need to inherit your plugin editor from Timer too and implement the timerCallback method, which should call repaint().
That is, because in the implementation you need to add it to the namespace, and furthermore the override keyword is only allowed in a declaration, not in the cpp file.
Last but not least, please add three backticks before and after your code, otherwise the forum might remove symbols, like e.g. angle brackets
```
int main()
{
return 0;
}
```
Thanks
P.S., using the pen symbol you can edit your posts, no need to post it again