Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::Processor::BusesLayout Struct Reference

── Opt-in DSP-state carry across a hot-reload (reload lane, item 1.6) ── On a hot-reload the new processor binds to the live StateStore (params + values preserved), but its DSP-internal state — delay lines, filter history, reverb tails, oscillator phase — starts COLD. More...

#include <processor.hpp>

Public Attributes

std::vector< int > inputs
std::vector< int > outputs

Detailed Description

── Opt-in DSP-state carry across a hot-reload (reload lane, item 1.6) ── On a hot-reload the new processor binds to the live StateStore (params + values preserved), but its DSP-internal state — delay lines, filter history, reverb tails, oscillator phase — starts COLD.

Override this pair to carry that state so a delay's repeats or an LFO's phase survive the swap seamlessly instead of resetting (the crossfade masks a cold start, but the tail itself is otherwise lost).

Contract:

  • serialize_dsp_state() returns an opaque blob of the OLD processor's DSP state (empty = "nothing to carry"; the default).
  • restore_dsp_state(blob) loads it into the NEW processor and returns true on success, false if the blob is unrecognized/incompatible.
  • The format is the PLUGIN's own private concern. It is only ever read back by the same plugin source across a hot-reload — the reload lane's build-fingerprint + parameter-contract gates guarantee the two sides are the same build, so a naive layout is safe (no versioning needed for the hot-reload case; version it if you also persist it elsewhere).
  • COLD-START FALLBACK IS ALWAYS SAFE: an empty blob or a false return just leaves the new processor freshly prepared — it must NEVER fail the swap. Called by ProcessorHotSwapSlot::swap() under its writer lock (no audio reader is inside the old processor), so both calls run off the audio thread; keep the blob bounded (it is copied while the lock is held, which briefly stalls the audio thread into passthrough).

NOTE: the two virtuals are DECLARED at the end of this class (after process(ProcessBuffers&)) — not here — to keep the Processor vtable additive-only (node_abi_gate): new virtuals must be appended after every pre-existing one. See the appended block below. Proposed bus layout passed to is_bus_layout_supported().

Each entry's index matches the descriptor's input_buses / output_buses index, and each value is the number of channels the host is proposing for that bus. Sidechain buses appear at index 1 (input side) when the descriptor declared one. Empty per-side vectors mean "the host did not propose buses on that side" (rare; treat as 'no opinion').

Format adapters call this on the host thread before applying the layout. Returning false rejects the proposal and the adapter is expected to refuse the host's setBusArrangements / equivalent call.

Member Data Documentation

◆ inputs

std::vector<int> pulp::format::Processor::BusesLayout::inputs

◆ outputs

std::vector<int> pulp::format::Processor::BusesLayout::outputs

The documentation for this struct was generated from the following file:
  • /home/runner/work/pulp/pulp/core/format/include/pulp/format/processor.hpp