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

Maps StateStore gesture callbacks onto AAX automation touch/release. More...

#include <aax_editor.hpp>

Public Types

using Sink = std::function<void(const char* aax_param_id)>
 Invoked with the AAX parameter-ID string for the gesture's parameter.

Public Member Functions

 GestureRouter (const PluginDefinition &definition, Sink touch, Sink release)
bool begin (state::ParamID id)
 Route Binding::begin_gesture() to AAX_IEffectParameters::TouchParameter.
bool end (state::ParamID id)
 Route Binding::end_gesture() to AAX_IEffectParameters::ReleaseParameter.
void release_all ()
 Release every parameter still held.
bool is_touched (state::ParamID id) const
 Whether a gesture is currently open on id.
std::size_t touched_count () const
 Number of parameters with an open gesture.
std::uint64_t unknown_count () const
 Gestures dropped because the parameter has no AAX registration.
const std::string * aax_id_for (state::ParamID id) const
 The AAX parameter-ID string for id, or nullptr when unregistered.

Detailed Description

Maps StateStore gesture callbacks onto AAX automation touch/release.

The sinks receive the AAX parameter-ID string owned by this router; it stays valid for the router's lifetime, so a sink may pass it straight to an AAX_CParamID parameter without copying.

Main-thread only, matching StateStore::begin_gesture / end_gesture. An editor that edits parameters from a worker marshals the whole gesture with StateStore::run_gesture_on_main.

The router is the single place that guarantees AAX's balance invariant:

  • a second begin for an already-touched parameter emits nothing, so a widget that re-enters a drag cannot open two automation records;
  • an end without a matching begin emits nothing, so a stray release cannot close a record the host never opened;
  • a parameter Pulp knows but AAX never registered is ignored rather than touched under a bogus ID.

Member Typedef Documentation

◆ Sink

using pulp::format::aax::GestureRouter::Sink = std::function<void(const char* aax_param_id)>

Invoked with the AAX parameter-ID string for the gesture's parameter.

Constructor & Destructor Documentation

◆ GestureRouter()

pulp::format::aax::GestureRouter::GestureRouter ( const PluginDefinition & definition,
Sink touch,
Sink release )
inline

Member Function Documentation

◆ aax_id_for()

const std::string * pulp::format::aax::GestureRouter::aax_id_for ( state::ParamID id) const
inline

The AAX parameter-ID string for id, or nullptr when unregistered.

◆ begin()

bool pulp::format::aax::GestureRouter::begin ( state::ParamID id)
inline

Route Binding::begin_gesture() to AAX_IEffectParameters::TouchParameter.

Returns true when a touch was emitted.

◆ end()

bool pulp::format::aax::GestureRouter::end ( state::ParamID id)
inline

Route Binding::end_gesture() to AAX_IEffectParameters::ReleaseParameter.

Returns true when a release was emitted.

◆ is_touched()

bool pulp::format::aax::GestureRouter::is_touched ( state::ParamID id) const
inline

Whether a gesture is currently open on id.

◆ release_all()

void pulp::format::aax::GestureRouter::release_all ( )
inline

Release every parameter still held.

An editor torn down mid-drag (the user closes the plugin window without lifting the mouse) would otherwise leave the host's automation record open forever.

◆ touched_count()

std::size_t pulp::format::aax::GestureRouter::touched_count ( ) const
inline

Number of parameters with an open gesture.

◆ unknown_count()

std::uint64_t pulp::format::aax::GestureRouter::unknown_count ( ) const
inline

Gestures dropped because the parameter has no AAX registration.

Non-zero means the editor and the parameter definition disagree — a wiring bug.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/format/include/pulp/format/aax_editor.hpp