20 #ifndef __ardour_chan_count_h__
21 #define __ardour_chan_count_h__
61 inline uint32_t
n (
DataType t)
const {
return _counts[t]; }
79 if (_counts[i] != other.
_counts[i])
86 return ! (*
this == other);
91 if (_counts[*t] > other.
_counts[*t]) {
95 return (*
this != other);
99 return ( (*
this < other) || (*
this == other) );
104 if (_counts[*t] < other.
_counts[*t]) {
108 return (*
this != other);
112 return ( (*
this > other) || (*
this == other) );
118 ret.
set(*t,
get(*t) + other.
get(*t));
125 _counts[*t] += other.
_counts[*t];
133 ret.
set(*t, std::min(a.
get(*t), b.
get(*t)));
141 ret.
set(*t, std::max(a.
get(*t), b.
get(*t)));
159 #endif // __ardour_chan_count_h__
std::ostream & operator<<(std::ostream &o, const ARDOUR::ChanCount &c)
bool operator>(const ChanCount &other) const
bool operator!=(const ChanCount &other) const
static ChanCount min(const ChanCount &a, const ChanCount &b)
ChanCount(DataType type, uint32_t channels)
bool operator==(const ChanCount &other) const
uint32_t _counts[DataType::num_types]
bool operator>=(const ChanCount &other) const
static ChanCount max(const ChanCount &a, const ChanCount &b)
static const uint32_t num_types
void set_audio(uint32_t a)
ChanCount operator+(const ChanCount &other) const
uint32_t get(DataType t) const
void set_midi(uint32_t m)
void set(DataType t, uint32_t count)
bool operator<(const ChanCount &other) const
ChanCount & operator+=(const ChanCount &other)
bool operator<=(const ChanCount &other) const
static const ChanCount INFINITE
static const ChanCount ZERO
uint32_t n(DataType t) const