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

#include <chan_count.h>

Public Member Functions

 ChanCount (const XMLNode &node)
 
 ChanCount ()
 
 ChanCount (DataType type, uint32_t count)
 
void reset ()
 
void set (DataType t, uint32_t count)
 
uint32_t get (DataType t) const
 
uint32_t n (DataType t) const
 
uint32_t n_audio () const
 
void set_audio (uint32_t a)
 
uint32_t n_midi () const
 
void set_midi (uint32_t m)
 
uint32_t n_total () const
 
bool operator== (const ChanCount &other) const
 
bool operator!= (const ChanCount &other) const
 
bool operator< (const ChanCount &other) const
 
bool operator<= (const ChanCount &other) const
 
bool operator> (const ChanCount &other) const
 
bool operator>= (const ChanCount &other) const
 
ChanCount operator+ (const ChanCount &other) const
 
ChanCount operator- (const ChanCount &other) const
 
ChanCount operator* (const unsigned int factor) const
 
ChanCountoperator-= (const ChanCount &other)
 
ChanCountoperator+= (const ChanCount &other)
 
XMLNodestate (const std::string &name) const
 

Static Public Member Functions

static ChanCount min (const ChanCount &a, const ChanCount &b)
 
static ChanCount max (const ChanCount &a, const ChanCount &b)
 

Static Public Attributes

static const ChanCount ZERO
 

Private Attributes

uint32_t _counts [DataType::num_types]
 

Detailed Description

A count of channels, possibly with many types.

Operators are defined so this may safely be used as if it were a simple (single-typed) integer count of channels.

Definition at line 38 of file chan_count.h.

Constructor & Destructor Documentation

◆ ChanCount() [1/3]

ARDOUR::ChanCount::ChanCount ( const XMLNode node)

◆ ChanCount() [2/3]

ARDOUR::ChanCount::ChanCount ( )
inline

Definition at line 41 of file chan_count.h.

◆ ChanCount() [3/3]

ARDOUR::ChanCount::ChanCount ( DataType  type,
uint32_t  count 
)
inline

Convenience constructor for making single-typed streams (mono, stereo, midi, etc)

Parameters
typedata type
countnumber of channels

Definition at line 47 of file chan_count.h.

Member Function Documentation

◆ get()

uint32_t ARDOUR::ChanCount::get ( DataType  t) const
inline

query channel count for given type

Parameters
tdata type
Returns
channel count for given type

Definition at line 69 of file chan_count.h.

◆ max()

static ChanCount ARDOUR::ChanCount::max ( const ChanCount a,
const ChanCount b 
)
inlinestatic

Definition at line 198 of file chan_count.h.

◆ min()

static ChanCount ARDOUR::ChanCount::min ( const ChanCount a,
const ChanCount b 
)
inlinestatic

Definition at line 190 of file chan_count.h.

◆ n()

uint32_t ARDOUR::ChanCount::n ( DataType  t) const
inline

Definition at line 71 of file chan_count.h.

◆ n_audio()

uint32_t ARDOUR::ChanCount::n_audio ( ) const
inline

query number of audio channels

Returns
number of audio channels

Definition at line 76 of file chan_count.h.

◆ n_midi()

uint32_t ARDOUR::ChanCount::n_midi ( ) const
inline

query number of midi channels

Returns
number of midi channels

Definition at line 86 of file chan_count.h.

◆ n_total()

uint32_t ARDOUR::ChanCount::n_total ( ) const
inline

query total channel count of all data types

Returns
total channel count (audio + midi)

Definition at line 96 of file chan_count.h.

◆ operator!=()

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

Definition at line 112 of file chan_count.h.

◆ operator*()

ChanCount ARDOUR::ChanCount::operator* ( const unsigned int  factor) const
inline

Definition at line 163 of file chan_count.h.

◆ operator+()

ChanCount ARDOUR::ChanCount::operator+ ( const ChanCount other) const
inline

Definition at line 142 of file chan_count.h.

◆ operator+=()

ChanCount& ARDOUR::ChanCount::operator+= ( const ChanCount other)
inline

Definition at line 183 of file chan_count.h.

◆ operator-()

ChanCount ARDOUR::ChanCount::operator- ( const ChanCount other) const
inline

underflow safe subtraction

Definition at line 151 of file chan_count.h.

◆ operator-=()

ChanCount& ARDOUR::ChanCount::operator-= ( const ChanCount other)
inline

underflow safe subtraction

Definition at line 172 of file chan_count.h.

◆ operator<()

bool ARDOUR::ChanCount::operator< ( const ChanCount other) const
inline

Definition at line 116 of file chan_count.h.

◆ operator<=()

bool ARDOUR::ChanCount::operator<= ( const ChanCount other) const
inline

Definition at line 125 of file chan_count.h.

◆ operator==()

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

Definition at line 104 of file chan_count.h.

◆ operator>()

bool ARDOUR::ChanCount::operator> ( const ChanCount other) const
inline

Definition at line 129 of file chan_count.h.

◆ operator>=()

bool ARDOUR::ChanCount::operator>= ( const ChanCount other) const
inline

Definition at line 138 of file chan_count.h.

◆ reset()

void ARDOUR::ChanCount::reset ( )
inline

zero count of all data types

Definition at line 53 of file chan_count.h.

◆ set()

void ARDOUR::ChanCount::set ( DataType  t,
uint32_t  count 
)
inline

set channel count for given type

Parameters
tdata type
countnumber of channels

Definition at line 63 of file chan_count.h.

◆ set_audio()

void ARDOUR::ChanCount::set_audio ( uint32_t  a)
inline

set number of audio channels

Parameters
anumber of audio channels

Definition at line 81 of file chan_count.h.

◆ set_midi()

void ARDOUR::ChanCount::set_midi ( uint32_t  m)
inline

set number of audio channels

Parameters
mnumber of midi channels

Definition at line 91 of file chan_count.h.

◆ state()

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

Member Data Documentation

◆ _counts

uint32_t ARDOUR::ChanCount::_counts[DataType::num_types]
private

Definition at line 211 of file chan_count.h.

◆ ZERO

const ChanCount ARDOUR::ChanCount::ZERO
static

Definition at line 208 of file chan_count.h.


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