Add root AGENT.md with project conventions, build verification steps, source layout, style rules, and real-time/concurrency requirements. Add per-module AGENT.md files for each existing and proposed source subdirectory. Add AUDIT_REPORT.md as a historical Phase 1 snapshot documenting memory management, error handling, concurrency model, naming conventions, and anti-pattern catalog.
1.4 KiB
1.4 KiB
params module
Related source files
This directory contains guidance; the implementation remains in ../Params.h
and ../Params.cpp.
Rules
- Use the
ids::namespace for every APVTS parameter ID string. - Require one
ids::entry per audio parameter, and one entry only. - Use
enum classfor every enum. Give each a trailingCountenumerator. - Use
inline constexprfor parameter ID strings andk-prefixed integer constants. - Keep all 0..1 to physical unit conversions in the
maps::namespace. - Keep the wavetable name table (
kWavetableNames) in sync withkNumWavetables. - Return an empty
juce::Stringfrom 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 tomaps::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
// BAD: re-declares the ID and drifts from Params.h
if (auto* p = apvts.getParameter ("f1Cutoff"))
return p->getValue();
// GOOD: one source of truth
if (auto* p = apvts.getParameter (ids::f1Cutoff))
return p->getValue();
This file overrides /AGENT.md where they conflict.