- 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.
43 lines
1.6 KiB
Markdown
43 lines
1.6 KiB
Markdown
# params module
|
|
|
|
## Owned files
|
|
|
|
- Params.h, Params.cpp
|
|
|
|
## Rules
|
|
|
|
- Use the `ids::` namespace for every APVTS parameter ID string.
|
|
- Require one `ids::` entry per audio parameter, and one entry only.
|
|
- Reach indexed parameters through the `paramIds::` arrays in `Params.h`, which pair each
|
|
ID with its slot: `paramIds::oscillators`, `paramIds::envAttack`, `paramIds::lfoRate`,
|
|
`paramIds::fxType`, `paramIds::macros` and their siblings. Use a single `ids::` entry only
|
|
when the parameter has no index.
|
|
- Use `enum class` for every enum. Give each a trailing `Count` enumerator.
|
|
- Use `inline constexpr` for parameter ID strings and `k`-prefixed integer constants.
|
|
- Keep all 0..1 to physical unit conversions in the `maps::` namespace.
|
|
- Keep the wavetable name table (`kWavetableNames`) in sync with `kNumWavetables`.
|
|
- Return an empty `juce::String` from enum-to-string switches for unknown values.
|
|
- Never re-declare a parameter ID string literal outside Params.h.
|
|
- Never add a physical unit mapping anywhere but `maps::`.
|
|
|
|
## IF-THEN
|
|
|
|
- IF you add an audio parameter THEN add its ID to `ids::` and, when it has physical units, add its mapping to `maps::` before any engine or GUI code reads it.
|
|
- IF a switch converts an enum to a string THEN include a default case that returns an empty string.
|
|
|
|
## Examples
|
|
|
|
```cpp
|
|
// BAD: re-declares the ID and drifts from Params.h
|
|
if (auto* p = apvts.getParameter ("f1Cutoff"))
|
|
return p->getValue();
|
|
```
|
|
|
|
```cpp
|
|
// GOOD: one source of truth
|
|
if (auto* p = apvts.getParameter (ids::f1Cutoff))
|
|
return p->getValue();
|
|
```
|
|
|
|
This file overrides /AGENTS.md where they conflict.
|