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

#include <modulation_matrix.hpp>

Public Member Functions

std::size_t add (const ModRoute &route)
 Add a route.
void remove (std::size_t index)
 Remove a route by index. No-op if out of range.
void remove_by_destination (ModDestinationId destination)
 Remove all routes touching destination.
std::optional< std::size_t > find (ModSourceId source, ModDestinationId destination) const
 Look up a route by (source, destination).
std::size_t size () const
bool empty () const
void clear ()
const std::vector< ModRoute > & routes () const
std::vector< uint8_t > serialize () const
 Serialize to a compact binary blob (route count + routes in order).
bool deserialize (const uint8_t *data, std::size_t size)
 Restore from a blob produced by serialize().

Member Function Documentation

◆ add()

std::size_t pulp::view::ModulationMatrix::add ( const ModRoute & route)

Add a route.

Returns the index. If a route with the same (source, destination) already exists, it is overwritten and the original index is returned — prevents duplicate routing to the same target which the audio engine would double-add.

◆ clear()

void pulp::view::ModulationMatrix::clear ( )
inline

◆ deserialize()

bool pulp::view::ModulationMatrix::deserialize ( const uint8_t * data,
std::size_t size )

Restore from a blob produced by serialize().

Returns false on malformed input (short buffer or impossible route count).

◆ empty()

bool pulp::view::ModulationMatrix::empty ( ) const
inline

◆ find()

std::optional< std::size_t > pulp::view::ModulationMatrix::find ( ModSourceId source,
ModDestinationId destination ) const

Look up a route by (source, destination).

Returns nullopt if not present.

◆ remove()

void pulp::view::ModulationMatrix::remove ( std::size_t index)

Remove a route by index. No-op if out of range.

◆ remove_by_destination()

void pulp::view::ModulationMatrix::remove_by_destination ( ModDestinationId destination)

Remove all routes touching destination.

Useful when the destination parameter is deleted from the plugin.

◆ routes()

const std::vector< ModRoute > & pulp::view::ModulationMatrix::routes ( ) const
inline

◆ serialize()

std::vector< uint8_t > pulp::view::ModulationMatrix::serialize ( ) const

Serialize to a compact binary blob (route count + routes in order).

Designed to slot into StateStore::serialize via PropertiesFile or the plugin's own state concatenation scheme.

◆ size()

std::size_t pulp::view::ModulationMatrix::size ( ) const
inline

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