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

Small host-side implementation for standalone/Forge hosts. 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

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

Detailed Description

Small host-side implementation for standalone/Forge hosts.

It owns only control-thread catalog state; audio adapters consume the resulting bus connection and never enumerate or mutate this object from realtime code.

Member Typedef Documentation

◆ ChangeCallback

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

◆ ConnectCallback

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

◆ 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)>
inherited

Member Function Documentation

◆ connect()

bool pulp::host::MutableAudioRouteCatalog::connect ( std::string_view stable_id,
std::size_t bus_index )
inlineoverridevirtual

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 from pulp::host::AudioRouteCatalog.

◆ connect_channel()

bool pulp::host::MutableAudioRouteCatalog::connect_channel ( std::string_view stable_id,
std::size_t bus_index,
std::size_t channel_index )
inlineoverridevirtual

Connect one channel of a declared input bus.

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

Reimplemented from pulp::host::AudioRouteCatalog.

◆ connected_route()

std::string pulp::host::MutableAudioRouteCatalog::connected_route ( std::size_t bus_index) const
inlineoverridevirtual

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 from pulp::host::AudioRouteCatalog.

◆ connected_route_channel()

std::string pulp::host::MutableAudioRouteCatalog::connected_route_channel ( std::size_t bus_index,
std::size_t channel_index ) const
inlineoverridevirtual

Return the stable source currently connected to one bus channel.

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

Reimplemented from pulp::host::AudioRouteCatalog.

◆ disconnect()

bool pulp::host::MutableAudioRouteCatalog::disconnect ( std::size_t bus_index)
inlineoverridevirtual

Reimplemented from pulp::host::AudioRouteCatalog.

◆ enumerate()

std::vector< AudioRouteInfo > pulp::host::MutableAudioRouteCatalog::enumerate ( ) const
inlineoverridevirtual

◆ restore_selected_route_ids()

void pulp::host::MutableAudioRouteCatalog::restore_selected_route_ids ( std::span< const std::string > ids)
inlineoverridevirtual

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 from pulp::host::AudioRouteCatalog.

◆ selected_route_ids()

std::vector< std::string > pulp::host::MutableAudioRouteCatalog::selected_route_ids ( ) const
inlineoverridevirtual

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 from pulp::host::AudioRouteCatalog.

◆ set_change_callback()

void pulp::host::MutableAudioRouteCatalog::set_change_callback ( ChangeCallback callback)
inlineoverridevirtual

◆ set_connect_callback()

void pulp::host::MutableAudioRouteCatalog::set_connect_callback ( ConnectCallback callback)
inlineoverridevirtual

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 from pulp::host::AudioRouteCatalog.

◆ set_connect_channel_callback()

void pulp::host::MutableAudioRouteCatalog::set_connect_channel_callback ( ConnectChannelCallback callback)
inlineoverridevirtual

Install the host graph binding for an individual channel connection.

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

Reimplemented from pulp::host::AudioRouteCatalog.

◆ set_disconnect_callback()

void pulp::host::MutableAudioRouteCatalog::set_disconnect_callback ( DisconnectCallback callback)
inlineoverridevirtual

Install the host graph binding for disconnect().

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

Reimplemented from pulp::host::AudioRouteCatalog.

◆ set_routes()

void pulp::host::MutableAudioRouteCatalog::set_routes ( std::vector< AudioRouteInfo > routes)
inline

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