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

#include <parameter_edit.hpp>

Public Member Functions

 ParameterEdit (StateStore &store)
 ParameterEdit (const ParameterEdit &)=delete
ParameterEdit & operator= (const ParameterEdit &)=delete
 ~ParameterEdit ()
 End any in-flight gesture so a gesture is never left open if the view is destroyed mid-drag.
void begin (std::initializer_list< ParamID > ids)
 Begin a gesture over ids.
void begin (ParamID id)
 Convenience single-parameter begin.
void set (ParamID id, float value)
 Write a raw value to a parameter inside the gesture and update the in-flight cache.
float display_value (ParamID id, float fallback) const
 The value the UI should display for id: the in-flight cache while a gesture is active, otherwise fallback (typically the live store value).
bool active () const
void finish ()
 End the gesture (closing each parameter's host gesture).

Static Public Attributes

static constexpr std::size_t kMaxParams = 8
 Maximum number of parameters a single gesture can drive.

Constructor & Destructor Documentation

◆ ParameterEdit() [1/2]

pulp::state::ParameterEdit::ParameterEdit ( StateStore & store)
inlineexplicit

◆ ParameterEdit() [2/2]

pulp::state::ParameterEdit::ParameterEdit ( const ParameterEdit & )
delete

◆ ~ParameterEdit()

pulp::state::ParameterEdit::~ParameterEdit ( )
inline

End any in-flight gesture so a gesture is never left open if the view is destroyed mid-drag.

Member Function Documentation

◆ active()

bool pulp::state::ParameterEdit::active ( ) const
inline

◆ begin() [1/2]

void pulp::state::ParameterEdit::begin ( ParamID id)
inline

Convenience single-parameter begin.

◆ begin() [2/2]

void pulp::state::ParameterEdit::begin ( std::initializer_list< ParamID > ids)
inline

Begin a gesture over ids.

Opens a host gesture for each parameter and seeds the in-flight cache from the store's current values. A no-op (after finishing any prior gesture) if already active with the same set is not assumed — call finish() first if reusing.

◆ display_value()

float pulp::state::ParameterEdit::display_value ( ParamID id,
float fallback ) const
inline

The value the UI should display for id: the in-flight cache while a gesture is active, otherwise fallback (typically the live store value).

Lets the control follow the cursor during a drag even when the host echo lags or briefly overwrites the store.

◆ finish()

void pulp::state::ParameterEdit::finish ( )
inline

End the gesture (closing each parameter's host gesture).

Safe to call when inactive.

◆ operator=()

ParameterEdit & pulp::state::ParameterEdit::operator= ( const ParameterEdit & )
delete

◆ set()

void pulp::state::ParameterEdit::set ( ParamID id,
float value )
inline

Write a raw value to a parameter inside the gesture and update the in-flight cache.

Silently ignores ids not in the active gesture.

Member Data Documentation

◆ kMaxParams

std::size_t pulp::state::ParameterEdit::kMaxParams = 8
staticconstexpr

Maximum number of parameters a single gesture can drive.


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