diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-08 18:16:19 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-08 18:16:19 +0200 |
commit | e27096b054cbaa5c58063f96ee64b3af3af3e7bd (patch) | |
tree | 3630627a1de9c6592d21adb800f1e686e89310f9 /libs/ardour/chan_mapping.cc | |
parent | 752662051a1d7217ce842ded78d1ee8e041a112f (diff) |
consistent count/n_total API
Diffstat (limited to 'libs/ardour/chan_mapping.cc')
-rw-r--r-- | libs/ardour/chan_mapping.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/ardour/chan_mapping.cc b/libs/ardour/chan_mapping.cc index 1d59faff00..ca422b5bce 100644 --- a/libs/ardour/chan_mapping.cc +++ b/libs/ardour/chan_mapping.cc @@ -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) |