consistent count/n_total API
This commit is contained in:
parent
752662051a
commit
e27096b054
@ -88,7 +88,9 @@ public:
|
||||
*/
|
||||
bool is_monotonic () const;
|
||||
|
||||
uint32_t count () const;
|
||||
uint32_t n_total () const;
|
||||
|
||||
ChanCount count () const;
|
||||
|
||||
XMLNode* state(const std::string& name) const;
|
||||
|
||||
|
@ -219,8 +219,9 @@ ChanMapping::is_identity (ChanCount offset) const
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ChanMapping::count () const
|
||||
ChanMapping::n_total () const
|
||||
{
|
||||
// fast version of count().n_total();
|
||||
uint32_t rv = 0;
|
||||
const Mappings& mp (mappings());
|
||||
for (Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
|
||||
@ -229,6 +230,19 @@ ChanMapping::count () const
|
||||
return rv;
|
||||
}
|
||||
|
||||
ChanCount
|
||||
ChanMapping::count () const
|
||||
{
|
||||
ChanCount rv;
|
||||
const Mappings& mp (mappings());
|
||||
for (Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
|
||||
rv.set (tm->first, tm->second.size ());
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)
|
||||
|
@ -1073,7 +1073,7 @@ PluginInsert::check_inplace ()
|
||||
{
|
||||
bool inplace_ok = !_plugins.front()->inplace_broken ();
|
||||
|
||||
if (_thru_map.count () > 0) {
|
||||
if (_thru_map.n_total () > 0) {
|
||||
// TODO once midi-bypass is part of the mapping, ignore it
|
||||
inplace_ok = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user