13
0

add chan-mapping count/size()

This commit is contained in:
Robin Gareus 2016-04-01 22:54:00 +02:00
parent 91c7845d40
commit c25962aa7e
2 changed files with 13 additions and 0 deletions

View File

@ -86,6 +86,8 @@ public:
*/ */
bool is_monotonic () const; bool is_monotonic () const;
uint32_t count () const;
/** Test if this mapping is a subset /** Test if this mapping is a subset
* @param superset to test against * @param superset to test against
* @returns true if all mapping are also present in the superset * @returns true if all mapping are also present in the superset

View File

@ -184,6 +184,17 @@ ChanMapping::is_identity (ChanCount offset) const
return true; return true;
} }
uint32_t
ChanMapping::count () const
{
uint32_t rv = 0;
const Mappings& mp (mappings());
for (Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
rv += tm->second.size ();
}
return rv;
}
} // namespace ARDOUR } // namespace ARDOUR
std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm) std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)