- 36 files move into the module whose AGENTS.md already claimed them: Engine/, Synth/, Modulation/, Params/, Plugin/, GUI/, EffectUnits/, Resources/ - Source/engine, modulation, params, plugin and synth become Engine, Modulation, Params, Plugin and Synth, matching the directories that already hold code - ExactCompare.h stays at the Source/ root as the one shared header - SERUMALT_INCLUDE_DIRS adds one include directory per module, so the 31 parent-relative includes become plain names with no path prefix - the module AGENTS.md files list owned files instead of describing a move that had not happened, and README.md and AGENTS.md describe the real tree Verified: the harness passes CTest, the Linux VST3 and Standalone link, the Windows cross-build passes its module checks, each configure exposes only its own targets, no first-party warning line appears, and the generated Windows manifest is unchanged.
46 lines
1.6 KiB
Markdown
46 lines
1.6 KiB
Markdown
# gui module
|
|
|
|
## Owned files
|
|
|
|
- PluginEditor.h, PluginEditor.cpp
|
|
- Knob.h, Knob.cpp
|
|
- KnobLookAndFeel.h, KnobLookAndFeel.cpp
|
|
- ToggleButton.h, ToggleButton.cpp
|
|
- Display.h, Display.cpp
|
|
- Panel.h, Panel.cpp
|
|
- WaveformDisplay.h, WaveformDisplay.cpp
|
|
- FilterDisplay.h, FilterDisplay.cpp
|
|
- EnvelopeDisplay.h, EnvelopeDisplay.cpp
|
|
- LFODisplay.h, LFODisplay.cpp
|
|
|
|
## Rules
|
|
|
|
- Use `theme::` colours from Resources.h instead of hardcoded colour values.
|
|
- Own GUI attachments with `std::unique_ptr`.
|
|
- Own component children by value or with `std::unique_ptr`; `addAndMakeVisible` only attaches and shows them, and does not manage their lifetime.
|
|
- Refresh visuals from a `juce::Timer` callback on the message thread, not from the audio thread.
|
|
- Keep layout constants in the `layout` namespace and derive every position from them.
|
|
- Use `std::function` formatters for value readouts.
|
|
- Reference `ids::` for APVTS parameter IDs.
|
|
|
|
## IF-THEN
|
|
|
|
- IF a control reads a DSP value THEN refresh it on the message thread from a thread-safe snapshot or atomic value. A `timerCallback` alone does not make a shared DSP read safe.
|
|
- IF a raw parameter pointer is dereferenced THEN null-guard it first.
|
|
|
|
## Examples
|
|
|
|
```cpp
|
|
// BAD: unchecked raw parameter dereference
|
|
const float v = processor.parameters.getRawParameterValue (ids::f1Cutoff)->load();
|
|
```
|
|
|
|
```cpp
|
|
// GOOD: null guard with fallback
|
|
const float v = processor.parameters.getRawParameterValue (ids::f1Cutoff)
|
|
? processor.parameters.getRawParameterValue (ids::f1Cutoff)->load()
|
|
: 0.0f;
|
|
```
|
|
|
|
This file overrides /AGENTS.md where they conflict.
|