Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::host::AudioRouteCatalog Class Referenceabstract

Control-thread source catalog supplied by a Pulp host (standalone, Forge, or another graph host). More...

#include <audio_route_catalog.hpp>

Public Types

using ChangeCallback = std::function<void()>
using ConnectCallback = std::function<bool(const AudioRouteInfo&, std::size_t bus_index)>
using ConnectChannelCallback
using DisconnectCallback = std::function<bool(std::size_t bus_index)>

Public Member Functions

virtual ~AudioRouteCatalog ()=default
virtual std::vector< AudioRouteInfo > enumerate () const =0
virtual void set_change_callback (ChangeCallback callback)=0
virtual void set_connect_callback (ConnectCallback callback)
 Install the host graph/bus binding invoked by connect().
virtual void set_connect_channel_callback (ConnectChannelCallback callback)
 Install the host graph binding for an individual channel connection.
virtual void set_disconnect_callback (DisconnectCallback callback)
 Install the host graph binding for disconnect().
virtual bool connect (std::string_view stable_id, std::size_t bus_index)
 Connect a host-owned source to a declared processor input bus.
virtual bool connect_channel (std::string_view stable_id, std::size_t bus_index, std::size_t channel_index)
 Connect one channel of a declared input bus.
virtual bool disconnect (std::size_t bus_index)
virtual std::string connected_route (std::size_t bus_index) const
 Return the stable source currently connected to a bus, or empty when the host has not selected one.
virtual std::string connected_route_channel (std::size_t bus_index, std::size_t channel_index) const
 Return the stable source currently connected to one bus channel.
virtual std::vector< std::string > selected_route_ids () const
 Return the stable IDs selected for each declared input bus.
virtual void restore_selected_route_ids (std::span< const std::string > ids)
 Restore previously saved stable IDs on the control thread.

Detailed Description

Control-thread source catalog supplied by a Pulp host (standalone, Forge, or another graph host).

External DAWs do not expose their project catalog through AU/VST3/CLAP; those adapters still expose the declared buses and let the DAW own its routing menu.

Member Typedef Documentation

◆ ChangeCallback

using pulp::host::AudioRouteCatalog::ChangeCallback = std::function<void()>

◆ ConnectCallback

using pulp::host::AudioRouteCatalog::ConnectCallback = std::function<bool(const AudioRouteInfo&, std::size_t bus_index)>

◆ ConnectChannelCallback

Initial value:
std::function<bool(const AudioRouteInfo&, std::size_t bus_index,
std::size_t channel_index)>
Definition audio_route_catalog.hpp:30

◆ DisconnectCallback

using pulp::host::AudioRouteCatalog::DisconnectCallback = std::function<bool(std::size_t bus_index)>

Constructor & Destructor Documentation

◆ ~AudioRouteCatalog()

virtual pulp::host::AudioRouteCatalog::~AudioRouteCatalog ( )
virtualdefault

Member Function Documentation

◆ connect()

virtual bool pulp::host::AudioRouteCatalog::connect ( std::string_view stable_id,
std::size_t bus_index )
inlinevirtual

Connect a host-owned source to a declared processor input bus.

Hosts that cannot retarget routes from the plug-in UI keep the default false and expose their own routing menu instead.

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ connect_channel()

virtual bool pulp::host::AudioRouteCatalog::connect_channel ( std::string_view stable_id,
std::size_t bus_index,
std::size_t channel_index )
inlinevirtual

Connect one channel of a declared input bus.

Hosts that do not expose independent channel routing inherit the bus-level connection behavior.

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ connected_route()

virtual std::string pulp::host::AudioRouteCatalog::connected_route ( std::size_t bus_index) const
inlinevirtual

Return the stable source currently connected to a bus, or empty when the host has not selected one.

This is control-thread/UI state.

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ connected_route_channel()

virtual std::string pulp::host::AudioRouteCatalog::connected_route_channel ( std::size_t bus_index,
std::size_t channel_index ) const
inlinevirtual

Return the stable source currently connected to one bus channel.

The default preserves compatibility with hosts that only route whole buses.

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ disconnect()

virtual bool pulp::host::AudioRouteCatalog::disconnect ( std::size_t bus_index)
inlinevirtual

◆ enumerate()

virtual std::vector< AudioRouteInfo > pulp::host::AudioRouteCatalog::enumerate ( ) const
pure virtual

◆ restore_selected_route_ids()

virtual void pulp::host::AudioRouteCatalog::restore_selected_route_ids ( std::span< const std::string > ids)
inlinevirtual

Restore previously saved stable IDs on the control thread.

Invalid, unavailable, or rejected routes are ignored and do not disturb the existing selection. Hosts should call this after set_routes().

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ selected_route_ids()

virtual std::vector< std::string > pulp::host::AudioRouteCatalog::selected_route_ids ( ) const
inlinevirtual

Return the stable IDs selected for each declared input bus.

Hosts may store these IDs in their project/plugin state and restore them after a catalog is rebuilt. The vector index is the bus index; an empty string means that bus has no selected route.

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ set_change_callback()

virtual void pulp::host::AudioRouteCatalog::set_change_callback ( ChangeCallback callback)
pure virtual

◆ set_connect_callback()

virtual void pulp::host::AudioRouteCatalog::set_connect_callback ( ConnectCallback callback)
inlinevirtual

Install the host graph/bus binding invoked by connect().

This runs on the control thread; the callback owns the actual graph mutation and publishes the resulting audio buffers to the realtime processor. Format adapters that cannot retarget project routes leave it unset.

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ set_connect_channel_callback()

virtual void pulp::host::AudioRouteCatalog::set_connect_channel_callback ( ConnectChannelCallback callback)
inlinevirtual

Install the host graph binding for an individual channel connection.

Hosts that only support whole-bus routing may leave this unset.

Reimplemented in pulp::host::MutableAudioRouteCatalog.

◆ set_disconnect_callback()

virtual void pulp::host::AudioRouteCatalog::set_disconnect_callback ( DisconnectCallback callback)
inlinevirtual

Install the host graph binding for disconnect().

Returning false keeps the catalog selection because the graph did not accept the mutation.

Reimplemented in pulp::host::MutableAudioRouteCatalog.


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