Hello, sorry about another newbie question but I want to address probably a simple issue happening.
I’m trying to make parameter displays to write the value properly every time it gets value updated but I’m encountering several issues. Tried to describe the situation as accurate as possible.
The project file is about building a stereo level meter. before I’m implementing something more complex I chose to just use .getMagnitude() to make the first goal easier to achieve.
I don’t understand how juce::Timer class is handled generally.
is it done by calling overrided single timerCallback() function from the PluginEditor class or called by every class that needs redrawing?
Dummy value I put to see if it’s getting updated shows updates for about a second following the value input for startTimerHz() from PluginEditor class, but then stops forever.
Dummy value increases by 1.0f from - 0.0f whenever processBlock is called.
All classes for GUI elements are all under single class called GuiComponent which is called inside the PluginEditor class as a private member “guiComponent”.
If hierarchic structure of classes is like this ::
PluginEditor <=== PluginProcessor
-guiHelpers
-guiComponent
–LevelDisplayNumeric (for numeric displays)
–LevelDIsplayHorizontalBar (for typical “bar-shaped” display)
both “LevelDisplay” classes are called twice in guiComponent class to show values from each channel.
I think I ‘m confusing how to update each components’ values for level display and “repainting” them accordingly.
Any documents or codes to refer or videos to watch, or simple URL would be helpful. I believe anything should be helpful at this point.
Yes this was my first information I got, the project is branching from this specific tutorial.
Still referring to this video every time but seems I’m still having problem when trying to implement the ideas into the project. Already starred and studying the github with codes from the video as well.
Yes, by inheriting juce::Timer the timer thread will call (via MessageManager) this one classes timerCallback() method. So you put into this class whatever you want to happen periodically.
In 90% of the cases lik your meter it is simply adding repaint() which schedules a redraw of your meter.
And of course don’t forget to start the timer with a period and to stop it in the destructor.
That’s specific to your code, hard to say without seeing the code.
But to figure out what happens, I would simply add a DBG statement in the paint() and/or in the processBlock() to display the values and check if they are what you are expecting.
N.B. don’t forget to remove the DBG from processBlock as soon as you found your answer. DBG is not realtime safe and can introduce artefacts.
I don’t understand the question. But Processor and Editor are separated. The only relation they have is, that the Editor has a reference of the Processor it was created from.
The host is responsible to make sure, that never an Editor exists whose Processor was deleted.
You don’t need to bother with that. Only a broken host would create problems, and you are unlikely to fix that without adding a ton of unnecessary checks everywhere.