Pre-resolved audio-thread read handle for one parameter's base value.
StateStore::get_value() looks the ID up in a hash map on every call. A processor that reads the same parameters every block can resolve them once — typically in prepare() — and read through the handle instead: get() is an inline relaxed atomic load with no lookup and no call.
The handle stays valid while the store it came from exists, even if more parameters are registered afterwards (it holds the store and an index, not a pointer to the value). Registration must still not run concurrently with get() — the same rule as for get_value() — and the handle dangles once its StateStore is destroyed. A default-constructed handle, or one resolved from an unknown ID, reads 0.0f — the same result as get_value() for an unknown ID.
void prepare(const PrepareContext&) override {
gain_ =
state().param_reader(kGain);
}
void process(...) override {
const float gain = gain_.get();
...
}
SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the ...
Definition audio_device_manager.hpp:48