Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::ChanMapping Class Reference

#include <chan_mapping.h>

Public Types

typedef std::map< uint32_t, uint32_t, std::less< uint32_t >, PBD::StackAllocator< std::pair< const uint32_t, uint32_t >, 16 > > TypeMapping
 
typedef std::map< DataType, TypeMapping, std::less< DataType >, PBD::StackAllocator< std::pair< const DataType, TypeMapping >, 2 > > Mappings
 

Public Member Functions

 ChanMapping ()
 
 ChanMapping (ARDOUR::ChanCount identity)
 
 ChanMapping (const ChanMapping &)
 
 ChanMapping (const XMLNode &node)
 
ChanMapping operator= (const ChanMapping &)
 
uint32_t get (DataType t, uint32_t from, bool *valid) const
 
uint32_t get_src (DataType type, uint32_t to, bool *valid) const
 
uint32_t get (DataType type, uint32_t from) const
 
void set (DataType type, uint32_t from, uint32_t to)
 
void offset_from (DataType t, int32_t delta)
 
void offset_to (DataType t, int32_t delta)
 
void unset (DataType type, uint32_t from)
 
bool is_identity (ARDOUR::ChanCount offset=ARDOUR::ChanCount()) const
 
bool is_monotonic () const
 
uint32_t n_total () const
 
ChanCount count () const
 
XMLNodestate (const std::string &name) const
 
bool is_subset (const ChanMapping &superset) const
 
Mappings mappings ()
 
const Mappingsmappings () const
 
bool operator== (const ChanMapping &other) const
 
bool operator!= (const ChanMapping &other) const
 

Private Attributes

Mappings _mappings
 

Detailed Description

A mapping from one set of channels to another. The general form is 1 source (from), many sinks (to). numeric IDs are used to identify sources and sinks.

for plugins this is used to map "plugin-pin" to "audio-buffer"

Definition at line 41 of file chan_mapping.h.

Member Typedef Documentation

◆ Mappings

typedef std::map<DataType, TypeMapping, std::less<DataType>, PBD::StackAllocator<std::pair<const DataType, TypeMapping>, 2> > ARDOUR::ChanMapping::Mappings

Definition at line 132 of file chan_mapping.h.

◆ TypeMapping

typedef std::map<uint32_t, uint32_t, std::less<uint32_t>, PBD::StackAllocator<std::pair<const uint32_t, uint32_t>, 16> > ARDOUR::ChanMapping::TypeMapping

Definition at line 131 of file chan_mapping.h.

Constructor & Destructor Documentation

◆ ChanMapping() [1/4]

ARDOUR::ChanMapping::ChanMapping ( )
inline

Definition at line 43 of file chan_mapping.h.

◆ ChanMapping() [2/4]

ARDOUR::ChanMapping::ChanMapping ( ARDOUR::ChanCount  identity)

◆ ChanMapping() [3/4]

ARDOUR::ChanMapping::ChanMapping ( const ChanMapping )

◆ ChanMapping() [4/4]

ARDOUR::ChanMapping::ChanMapping ( const XMLNode node)

Member Function Documentation

◆ count()

ChanCount ARDOUR::ChanMapping::count ( ) const

◆ get() [1/2]

uint32_t ARDOUR::ChanMapping::get ( DataType  t,
uint32_t  from,
bool *  valid 
) const

◆ get() [2/2]

uint32_t ARDOUR::ChanMapping::get ( DataType  type,
uint32_t  from 
) const
inline

get buffer mapping for given data type and pin

Parameters
typedata type
fromnumeric source id
Returns
mapped buffer number (or ChanMapping::Invalid)

Definition at line 65 of file chan_mapping.h.

◆ get_src()

uint32_t ARDOUR::ChanMapping::get_src ( DataType  type,
uint32_t  to,
bool *  valid 
) const

reverse lookup

Parameters
typedata type
topin
validpointer to a boolean. If not NULL it is set to true if the mapping is found, and false otherwise.
Returns
first "from" that matches given "to"

◆ is_identity()

bool ARDOUR::ChanMapping::is_identity ( ARDOUR::ChanCount  offset = ARDOUR::ChanCount()) const

Test mapping matrix for identity

Parameters
offsetper data-type offset to take into account
Returns
true if the mapping is a channel identity map

◆ is_monotonic()

bool ARDOUR::ChanMapping::is_monotonic ( ) const

Test if this mapping is monotonic (useful to see if inplace processing is feasible)

Returns
true if the map is a strict monotonic set

◆ is_subset()

bool ARDOUR::ChanMapping::is_subset ( const ChanMapping superset) const

Test if this mapping is a subset

Parameters
supersetto test against
Returns
true if all mapping are also present in the superset

◆ mappings() [1/2]

Mappings ARDOUR::ChanMapping::mappings ( )
inline

Definition at line 135 of file chan_mapping.h.

◆ mappings() [2/2]

const Mappings& ARDOUR::ChanMapping::mappings ( ) const
inline

Definition at line 136 of file chan_mapping.h.

◆ n_total()

uint32_t ARDOUR::ChanMapping::n_total ( ) const

◆ offset_from()

void ARDOUR::ChanMapping::offset_from ( DataType  t,
int32_t  delta 
)

◆ offset_to()

void ARDOUR::ChanMapping::offset_to ( DataType  t,
int32_t  delta 
)

◆ operator!=()

bool ARDOUR::ChanMapping::operator!= ( const ChanMapping other) const
inline

Definition at line 142 of file chan_mapping.h.

◆ operator=()

ChanMapping ARDOUR::ChanMapping::operator= ( const ChanMapping )

◆ operator==()

bool ARDOUR::ChanMapping::operator== ( const ChanMapping other) const
inline

Definition at line 138 of file chan_mapping.h.

◆ set()

void ARDOUR::ChanMapping::set ( DataType  type,
uint32_t  from,
uint32_t  to 
)

set buffer mapping for given data type

Parameters
typedata type
fromnumeric source id
tobuffer

◆ state()

XMLNode* ARDOUR::ChanMapping::state ( const std::string &  name) const

◆ unset()

void ARDOUR::ChanMapping::unset ( DataType  type,
uint32_t  from 
)

remove mapping

Parameters
typedata type
fromnumeric source to remove from mapping

Member Data Documentation

◆ _mappings

Mappings ARDOUR::ChanMapping::_mappings
private

Definition at line 147 of file chan_mapping.h.


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