Amortise a bounded piece of transition work over several audio callbacks. More...
#include <algorithm>#include <cstdint>Go to the source code of this file.
Classes | |
| class | pulp::signal::StagedTransition |
Namespaces | |
| namespace | pulp |
| namespace | pulp::signal |
Amortise a bounded piece of transition work over several audio callbacks.
A state transition (a freeze latch, an engage pre-roll, a mode switch) must not cost more in its callback than a steady-state callback does: the host has one fixed deadline per buffer and drops the buffer that misses it. When the transition needs work that cannot be precomputed in prepare(), split it into total equal steps and run only the steps that are due in each callback.
The tracker owns no work and no storage; each run call takes the step callable, void(int step_index), which must be bounded and allocation-free. Steps run in index order, each exactly once per begin().
RT contract: every member is allocation-free and lock-free; the cost of a run call is the cost of the steps it runs.