diff options
author | Robin Gareus <robin@gareus.org> | 2016-03-30 15:22:19 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-03-30 15:28:15 +0200 |
commit | 5278d56031c51d9619fd6169fec5c1d28c928507 (patch) | |
tree | 736479675b8bc32728c98f26c456cca6d1d50feb /libs/ardour/ardour/chan_mapping.h | |
parent | 1316e85d4143a1f77ad911028bb929dcc3c83c0f (diff) |
allow to sum channel maps
Diffstat (limited to 'libs/ardour/ardour/chan_mapping.h')
-rw-r--r-- | libs/ardour/ardour/chan_mapping.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/ardour/chan_mapping.h b/libs/ardour/ardour/chan_mapping.h index 4b0b930b02..730ecadc72 100644 --- a/libs/ardour/ardour/chan_mapping.h +++ b/libs/ardour/ardour/chan_mapping.h @@ -97,6 +97,20 @@ public: return ! (*this == other); } + ChanMapping operator+=(const ChanMapping& other) { + const ChanMapping::Mappings& mp (other.mappings()); + for (Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) { + for (TypeMapping::const_iterator i = tm->second.begin(); i != tm->second.end(); ++i) { +#if 0 + bool valid; uint32_t x = get (tm->first, i->first, &valid); + assert (!valid || x == i->second); +#endif + set (tm->first, i->first, i->second); + } + } + return *this; + } + private: Mappings _mappings; }; |