Two-way binding between a standard widget and a store parameter, with host automation gestures. More...
#include <optional>#include <pulp/state/parameter.hpp>#include <pulp/state/store.hpp>#include <pulp/view/design_frame_view.hpp>#include <pulp/view/ui_components.hpp>#include <pulp/view/widgets.hpp>#include <utility>Go to the source code of this file.
Classes | |
| class | pulp::view::ParameterBinding |
| RAII owner of a widget↔parameter binding's store listener. More... | |
Namespaces | |
| namespace | pulp |
| namespace | pulp::view |
| Hover-cursor tracking for platform window hosts. | |
| namespace | pulp::view::detail |
Functions | |
| template<typename Control> | |
| state::StateStore::ModulationWatch | pulp::view::detail::watch_modulated_display (Control &control, state::StateStore &store, state::ParamID id) |
| The modulated-value half of a binding: whatever modulates the parameter – a host's CLAP modulation, or the plugin's own published modulation (StateStore::set_display_modulation) – is drawn on the control as its played value; nothing is drawn when nothing modulates it. | |
| ParameterBinding | pulp::view::bind_parameter (Knob &knob, state::StateStore &store, state::ParamID id) |
| Knob ↔ parameter (normalized). | |
| ParameterBinding | pulp::view::bind_parameter (Fader &fader, state::StateStore &store, state::ParamID id) |
| Fader ↔ parameter (normalized). | |
| ParameterBinding | pulp::view::bind_parameter (XYPad &pad, state::StateStore &store, state::ParamID x_id, state::ParamID y_id) |
| XY pad ↔ two parameters (normalized). A single drag drives both. | |
| ParameterBinding | pulp::view::bind_parameter (RangeSlider &slider, state::StateStore &store, state::ParamID id) |
| Range slider ↔ parameter (normalized). | |
| ParameterBinding | pulp::view::bind_parameter (ComboBox &combo, state::StateStore &store, state::ParamID id) |
| ComboBox ↔ stepped/index parameter. | |
| ParameterBinding | pulp::view::bind_parameter (DesignStepper &stepper, state::StateStore &store, state::ParamID id) |
| DesignStepper ↔ stepped/index parameter (same contract as ComboBox): user steps are one-shot gestures; automation playback drives the selection via set_selected_silent (which does not re-fire on_select). | |
| ParameterBinding | pulp::view::bind_parameter (Toggle &toggle, state::StateStore &store, state::ParamID id) |
| Toggle (switch) ↔ parameter, as a one-shot gesture per flip. | |
| ParameterBinding | pulp::view::bind_parameter (Checkbox &box, state::StateStore &store, state::ParamID id) |
| Checkbox ↔ parameter, as a one-shot gesture per flip. | |
| ParameterBinding | pulp::view::bind_parameter (ToggleButton &button, state::StateStore &store, state::ParamID id) |
| Toggle button ↔ parameter. | |
Two-way binding between a standard widget and a store parameter, with host automation gestures.
One call replaces the hand-written widget-callback ↔ parameter-listener pair an editor would otherwise maintain per control.
bind_parameter(widget, store, id) wires, with no further code:
Bind once, get automation and playback animation for free. Showing a plugin's INTERNAL modulation is opt-in (the plugin publishes it); any modulation menus or routing UI are the plugin's own.
It returns a ParameterBinding that owns the store listener. The binding is lifetime-scoped: keep it alive for as long as the widget is bound (typically as a member of the editor, so it dies with the widget), and dropping it unbinds — there is no separate detach call.
Without this, a widget changes the parameter audibly but the host does not record the move, because the raw value write is not bracketed in a gesture. See pulp::state::ParameterEdit for the lower-level primitive used by bespoke (non-widget) controls.
UI-thread only.