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

Registry of live constants — thread-safe singleton. More...

#include <live_constant_editor.hpp>

Public Member Functions

float & register_constant (std::string_view name, std::string_view file, int line, float default_value, float min_val, float max_val)
 Register a constant. Returns a reference to the stored value.
std::vector< LiveConstant > all () const
 Get all registered constants.
void reset_all ()
 Reset all constants to defaults.
void reset (std::string_view name)
 Reset a specific constant.
void set (std::string_view name, float value)
 Set a constant value by name.
float get (std::string_view name) const
 Get a constant value by name.
int count () const
 Number of registered constants.

Static Public Member Functions

static LiveConstantRegistry & instance ()

Public Attributes

std::function< void(const LiveConstant &)> on_change
 Called when any constant changes.

Detailed Description

Registry of live constants — thread-safe singleton.

Member Function Documentation

◆ all()

std::vector< LiveConstant > pulp::view::LiveConstantRegistry::all ( ) const

Get all registered constants.

◆ count()

int pulp::view::LiveConstantRegistry::count ( ) const

Number of registered constants.

◆ get()

float pulp::view::LiveConstantRegistry::get ( std::string_view name) const

Get a constant value by name.

◆ instance()

LiveConstantRegistry & pulp::view::LiveConstantRegistry::instance ( )
static

◆ register_constant()

float & pulp::view::LiveConstantRegistry::register_constant ( std::string_view name,
std::string_view file,
int line,
float default_value,
float min_val,
float max_val )

Register a constant. Returns a reference to the stored value.

◆ reset()

void pulp::view::LiveConstantRegistry::reset ( std::string_view name)

Reset a specific constant.

◆ reset_all()

void pulp::view::LiveConstantRegistry::reset_all ( )

Reset all constants to defaults.

◆ set()

void pulp::view::LiveConstantRegistry::set ( std::string_view name,
float value )

Set a constant value by name.

Member Data Documentation

◆ on_change

std::function<void(const LiveConstant&)> pulp::view::LiveConstantRegistry::on_change

Called when any constant changes.


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