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

Reports EDITOR parameter edits to the host, in protocol order, exactly once. More...

#include <host_parameter_edit.hpp>

Classes

struct  Callbacks
 Protocol callbacks, in the order they are invoked for a gesture: begin → value(one or more) → value → end. More...

Public Member Functions

 HostParameterEditBridge (state::StateStore &store, Callbacks callbacks)
 ~HostParameterEditBridge ()
 HostParameterEditBridge (const HostParameterEditBridge &)=delete
HostParameterEditBridge & operator= (const HostParameterEditBridge &)=delete
std::thread::id editor_thread () const noexcept
 The thread this bridge treats as the editor.
bool would_report () const noexcept
 Whether a call on THIS thread right now would be reported.

Detailed Description

Reports EDITOR parameter edits to the host, in protocol order, exactly once.

Owns three guarantees the ad-hoc VST3 wiring did not have:

  1. Provenance is explicit. A change is reported only when it happened on the editor thread and outside any host/processor write scope. An open gesture is no longer taken as evidence of who wrote the value.
  2. One snapshot per reported edit. An edit is reported with the value the editor wrote, taken from the write itself, never re-read from the store: a host automation write landing between the edit and the report would otherwise be reported to the host as the user's edit. The same snapshot is handed to every callback for that edit, so a concurrent write cannot split one logical change across two different values.
  3. One place that closes a gesture. The final value report and the end-of-gesture notification are emitted together, in that order, so a host that latches on end records where the control actually landed.

Threading: construct on the editor/UI thread — the constructor captures that thread's id as the editor thread. The store listener runs INLINE on the writing thread (like CLAP's), which is what makes the thread check meaningful; a marshalled listener would deliver every write on the UI thread and lose the origin.

Constructor & Destructor Documentation

◆ HostParameterEditBridge() [1/2]

pulp::format::HostParameterEditBridge::HostParameterEditBridge ( state::StateStore & store,
Callbacks callbacks )

◆ ~HostParameterEditBridge()

pulp::format::HostParameterEditBridge::~HostParameterEditBridge ( )

◆ HostParameterEditBridge() [2/2]

pulp::format::HostParameterEditBridge::HostParameterEditBridge ( const HostParameterEditBridge & )
delete

Member Function Documentation

◆ editor_thread()

std::thread::id pulp::format::HostParameterEditBridge::editor_thread ( ) const
inlinenoexcept

The thread this bridge treats as the editor.

Exposed for tests and for an adapter that needs to assert its own threading assumptions.

◆ operator=()

HostParameterEditBridge & pulp::format::HostParameterEditBridge::operator= ( const HostParameterEditBridge & )
delete

◆ would_report()

bool pulp::format::HostParameterEditBridge::would_report ( ) const
noexcept

Whether a call on THIS thread right now would be reported.

Exposed so a format that keeps its own delivery queue (CLAP) can share the decision without sharing the transport.


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