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

A live onParamChanged registration. More...

#include <param_subscription.hpp>

Public Attributes

std::uint32_t id = 0
 Handle returned to JS.
state::ParamID param_id = 0
 resolved once at subscribe time
std::string param_name
 echoed in the payload
float last_value = 0.0f
 Seeded from the store at subscribe time so subscribing is not itself reported as a change.
float last_modulated = 0.0f
bool has_playing = false
 The value a modulator is playing (StateStore::displayed_modulation), normalized; has_playing false when nothing modulates the parameter.
float last_playing = 0.0f

Detailed Description

A live onParamChanged registration.

The handler itself stays in JS — CHOC's NativeFunction cannot carry a JSValue — so this holds only what the native side needs to decide whether to dispatch, and the id that keys the handler in the engine's __callbacks__ table.

Member Data Documentation

◆ has_playing

bool pulp::view::ParamSubscription::has_playing = false

The value a modulator is playing (StateStore::displayed_modulation), normalized; has_playing false when nothing modulates the parameter.

◆ id

std::uint32_t pulp::view::ParamSubscription::id = 0

Handle returned to JS.

Monotonic and never reused, so a stale offParamChanged() from a torn-down view cannot cancel a live subscription that happened to land in the same slot. Zero is never issued, and marks an entry tombstoned by a handler that unsubscribed mid-dispatch; those compact at the end of the pass.

◆ last_modulated

float pulp::view::ParamSubscription::last_modulated = 0.0f

◆ last_playing

float pulp::view::ParamSubscription::last_playing = 0.0f

◆ last_value

float pulp::view::ParamSubscription::last_value = 0.0f

Seeded from the store at subscribe time so subscribing is not itself reported as a change.

NaN would defeat that — NaN != NaN would dispatch on the first frame.

◆ param_id

state::ParamID pulp::view::ParamSubscription::param_id = 0

resolved once at subscribe time

◆ param_name

std::string pulp::view::ParamSubscription::param_name

echoed in the payload


The documentation for this struct was generated from the following file: