Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
design_knobs.hpp File Reference
#include <pulp/design/design_tweaks.hpp>
#include <optional>
#include <string>
#include <string_view>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::design::KnobWrite
 One parameter write a knob position produces. More...
struct  pulp::design::KnobPosition
 One selectable position of a knob. More...
struct  pulp::design::KnobSpec
 A declared knob: a stable id, a human label, its kind, and its positions in authored order (Slider positions are additionally sorted by at on parse). More...
struct  pulp::design::KnobSchema
 A design's declared set of knobs. More...
struct  pulp::design::KnobEffect
 The concrete effect of setting a knob to a value: its writes split by target. More...
struct  pulp::design::KnobApply
 The result of applying a knob to a design artifact. More...

Namespaces

namespace  pulp
namespace  pulp::design

Enumerations

enum class  pulp::design::KnobKind { pulp::design::Slider , pulp::design::Toggle , pulp::design::Enum }
 The kind of control a knob presents. More...
enum class  pulp::design::WriteTarget { pulp::design::ThemeToken , pulp::design::LocalBlock }
 Where a resolved write lands. More...

Functions

std::optional< KnobSchema > pulp::design::parse_knob_schema (std::string_view json)
 Parse a declared knob schema from JSON.
std::string pulp::design::knob_schema_to_json (const KnobSchema &schema)
 Serialize a schema to stable JSON.
const KnobSpec * pulp::design::find_knob (const KnobSchema &schema, std::string_view id)
 Look up a knob by id (nullptr when absent).
const KnobPosition * pulp::design::select_position (const KnobSpec &knob, std::string_view value)
 Select the position of knob for value:
WriteTarget pulp::design::classify_write (const KnobWrite &write, const std::vector< std::string > &theme_tokens)
 Classify a write against the design's bound theme tokens: ThemeToken iff write.key is one of theme_tokens, else LocalBlock.
std::optional< KnobEffect > pulp::design::resolve_knob (const KnobSpec &knob, std::string_view value, const std::vector< std::string > &theme_tokens)
 Resolve knob set to value into its split writes against theme_tokens.
std::optional< KnobApply > pulp::design::apply_knob (std::string_view artifact, const KnobSpec &knob, std::string_view value, const std::vector< std::string > &theme_tokens)
 Apply knob set to value to a design artifact: persist the local writes into the artifact's EDITMODE block (updating keys in place, appending new ones, preserving every byte outside the block) and hand back the token writes for the caller to apply at the theme layer.
KnobSpec pulp::design::builtin_theme_flip ()
 Built-in theme-flip knob: an Enum over appearance with "light"/"dark" positions, each writing a local appearance param.