Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::state::ParamInfo Struct Reference

Immutable parameter metadata, registered once at plugin initialization. More...

#include <parameter.hpp>

Public Member Functions

bool auto_resets () const
 True when this parameter should auto-reset to its default after each process block — i.e.

Public Attributes

ParamID id = 0
std::string name
std::string unit
 Display unit: "dB", "Hz", "%", etc.
ParamRange range
int group_id = 0
 Group for hierarchical organization. 0 = ungrouped.
std::function< std::string(float)> to_string
 Convert a raw value to a display string (e.g., "440.0 Hz").
std::function< float(const std::string &)> from_string
 Parse a display string back to a raw value.
ParamRate rate = ParamRate::ControlRate
float smoothing_ramp_seconds = 0.0f
 0 = off / immediate control-rate updates.
ParamDesignation designation = ParamDesignation::None
 Declared semantic role.
bool is_trigger = false
 Momentary "trigger" parameter.
ParamKind kind = ParamKind::Continuous
 Semantic value kind.
std::vector< std::string > value_labels
 Ordered display/parse labels for Toggle and Enum parameters.
bool modulatable = true
 Whether a host may apply a modulation offset to this parameter.
bool hidden = false
 Hide this parameter from the host's generic parameter list.
bool read_only = false
 Advertise this parameter as readable but not host-writable.
bool automatable = true
 Whether the host may record and play back automation for this parameter.

Detailed Description

Immutable parameter metadata, registered once at plugin initialization.

Each parameter has a unique id, a human-readable name, an optional unit string for display, a range for normalization, and optional string conversion functions for host display.

Member Function Documentation

◆ auto_resets()

bool pulp::state::ParamInfo::auto_resets ( ) const
inline

True when this parameter should auto-reset to its default after each process block — i.e.

it is an explicit trigger or carries the Reset designation (which is defined to behave as a trigger).

Member Data Documentation

◆ automatable

bool pulp::state::ParamInfo::automatable = true

Whether the host may record and play back automation for this parameter.

Unlike hidden and read_only, the attribute here is the negative one — authors opt in to NON-automatable by declaring false — so the default of true keeps every existing parameter automatable exactly as it is today. is_automatable_param() additionally refuses automation for a read-only parameter.

◆ designation

ParamDesignation pulp::state::ParamInfo::designation = ParamDesignation::None

Declared semantic role.

None (the default) preserves legacy behavior: adapters fall back to their name/range bypass heuristic. Declaring Bypass or Reset makes the role explicit and name-independent.

◆ from_string

std::function<float(const std::string&)> pulp::state::ParamInfo::from_string

Parse a display string back to a raw value.

◆ group_id

int pulp::state::ParamInfo::group_id = 0

Group for hierarchical organization. 0 = ungrouped.

◆ hidden

bool pulp::state::ParamInfo::hidden = false

Hide this parameter from the host's generic parameter list.

A hidden parameter still exists, still serializes, and is still reachable from the plugin's own editor — it simply does not clutter the host's automation lanes and generic UI. Use it for internal or developer-facing controls.

Opt-in: defaults false, so every existing parameter stays visible. is_hidden_param() additionally refuses to hide a bypass control, which hosts require to remain reachable.

◆ id

ParamID pulp::state::ParamInfo::id = 0

◆ is_trigger

bool pulp::state::ParamInfo::is_trigger = false

Momentary "trigger" parameter.

A trigger is a one-shot "do this now" control (panic, reset, tap): the host or UI raises it, the Processor observes it for exactly one process block, and the state plumbing auto-resets it to its range default after the block (see StateStore::reset_triggers_rt). A Reset designation implies a trigger; an author may also set this directly for a custom one-shot.

One-shot latch contract: a trigger value is block-local. Whatever value is present during a process block — raised by the host/UI, or even written by the Processor itself mid-block — is reset to the range default at the END of that block. A trigger therefore never persists across blocks; observe it within the block it fires. Format adapters reset triggers on EVERY audio-callback exit, including bypass / pass-through early-returns, so a panic/reset raised while bypassed still clears that block rather than firing late on the next non-bypassed block.

◆ kind

ParamKind pulp::state::ParamInfo::kind = ParamKind::Continuous

Semantic value kind.

Existing declarations remain continuous until they opt in; adapters must not infer this from the parameter name.

◆ modulatable

bool pulp::state::ParamInfo::modulatable = true

Whether a host may apply a modulation offset to this parameter.

Modulation is an additive, host-owned offset on top of the automated value (StateStore::get_modulated()), distinct from automation. It defaults to true so an ordinary control is reachable by a host's modulators without every author opting in; declare false for a control where a continuously applied offset would be meaningless or unsafe.

is_modulatable_param() additionally refuses modulation for a bypass control, a discrete parameter, and one that auto-resets each block — rules this field cannot override.

◆ name

std::string pulp::state::ParamInfo::name

◆ range

ParamRange pulp::state::ParamInfo::range

◆ rate

ParamRate pulp::state::ParamInfo::rate = ParamRate::ControlRate

◆ read_only

bool pulp::state::ParamInfo::read_only = false

Advertise this parameter as readable but not host-writable.

The canonical case is a meter-style value the Processor publishes for display (output level, gain reduction, detected pitch): the host should render it, never drive it. A read-only parameter is also not automatable, because automation is a host write.

Opt-in: defaults false, so every existing parameter stays writable. is_read_only_param() additionally refuses a bypass control and a trigger, both of which are defined by the host writing to them.

◆ smoothing_ramp_seconds

float pulp::state::ParamInfo::smoothing_ramp_seconds = 0.0f

0 = off / immediate control-rate updates.

◆ to_string

std::function<std::string(float)> pulp::state::ParamInfo::to_string

Convert a raw value to a display string (e.g., "440.0 Hz").

◆ unit

std::string pulp::state::ParamInfo::unit

Display unit: "dB", "Hz", "%", etc.

◆ value_labels

std::vector<std::string> pulp::state::ParamInfo::value_labels

Ordered display/parse labels for Toggle and Enum parameters.

Index zero corresponds to range.min, index one to range.min + range.step (or +1 when the legacy range omitted a step), and so on.


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