04_15_core_config¶
Centralized configuration system for all AudioLab Core modules.
Quick Start¶
#include <alcore.hpp>
// Access configuration constants
alignas(al::cfg::CacheLine) MyData data;
static_assert(al::cfg::QParams >= 1024);
CMake Integration¶
Files¶
- alcore_config.hpp: Platform detection & compile-time constants
- config_validator.hpp: Compile-time validation (automatic)
- config_presets.hpp: Runtime switchable profiles (Debug/Release/Realtime/HighQuality/Testing)
- rt_defaults.hpp: RT-specific utilities
- queue_sizes.hpp: Lock-free queue capacities
- alcore.hpp: Master include (use this)
Configuration Override¶
Override at CMake configuration time:
Presets¶
// Get current build mode preset
auto cfg = al::cfg::presets::getCurrent();
// Or use explicit preset
auto rtCfg = al::cfg::presets::Realtime;
Available: Debug, Release, Realtime, HighQuality, Testing
Key Constants¶
Memory & Alignment
- CacheLine: 64/128/256 bytes (platform-detected)
- AlignDefault: 16 bytes (SSE/NEON)
- AlignSIMD: 16/32/64 bytes (based on CPU features)
- TLSScratchBytes: 128 KB thread-local scratch
- MaxBlockSize: 8192 samples max
Queue Sizes
- QParams: 4096 parameter changes
- QLog: 8192 log messages
- QMeters: 2048 meter updates
- QCommands: 1024 commands
- QEvents: 2048 events
- TripleDepth: 8192 triple buffer
RT Safety
- RTMaxSpinNs: 10 µs max spinlock
- RTMaxAllocBytes: 0 (no RT allocations)
- RTWatchdogMs: 50 ms timeout
Parameters
- MaxParameters: 1024
- ParamSmoothingMs: 8.0 ms
- EnvSmoothingMs: 2.0 ms
Validation¶
All constants are validated at compile-time. Invalid configs will fail to build with clear error messages.