consistent count/n_total API
[ardour.git] / libs / ardour / chan_mapping.cc
index 1d59faff00033def1aa2858cac7f1d6dcc39a4de..ca422b5bced2fc260da5e726a061a08f4962b73d 100644 (file)
@@ -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)