perf(gui): skip unchanged repaints and gate updates by tab

Add change detection to Display, WaveformDisplay, FilterDisplay,
EnvelopeDisplay, and LFODisplay so repaint() is only called when
values actually change. Gate updateVisuals() by currentTab so only
the visible tab's displays are updated each timer tick. Similarly
gate updateModList/updateMacroList to their respective tabs.

Manage dynamically created controls via ownedControls
unique_ptr vector instead of raw new leaks. Null-check parameter
lookups before creating attachments. Hold engine control lock
when reading matrix/macros/LFO shape data.

Fix envelope display curve directions (attack rising from bottom,
decay falling toward sustain, release falling toward bottom).
Add tooltip to FilterDisplay noting the approximation. Replace
ToggleButton raw param pointer with ParameterAttachment for proper
gesture handling. Sync preset and scale combos to processor state.
This commit is contained in:
biggy committed 2026-09-09 14:33:41 +02:00
1 parent 3be1e42242
commit 8364737d1c
11 files changed
+215 -115

No files matched your search

+10 -4
View File
@@ -5,10 +5,16 @@ namespace serum
void LFODisplay::setShapeData (const std::vector<float>& data, int s)
{
steps = juce::jlimit (2, 64, s);
shapeData = data;
if ((int) shapeData.size() < 64)
shapeData.resize (64, 0.0f);
const int newSteps = juce::jlimit (2, 64, s);
const size_t dataSize = std::min (data.size(), size_t (64));
if (steps == newSteps && shapeData.size() == 64
&& std::equal (data.begin(), data.begin() + dataSize, shapeData.begin())
&& std::all_of (shapeData.begin() + dataSize, shapeData.end(), [] (float v) { return v == 0.0f; }))
return;
steps = newSteps;
shapeData.assign (data.begin(), data.begin() + dataSize);
shapeData.resize (64, 0.0f);
repaint();
}