- for (vector<vector<float> >::iterator i = _gain.begin(); i != _gain.end(); ++i) {
- for (vector<float>::iterator j = i->begin(); j != i->end(); ++j) {
- *j = 0;
+ for (auto& i: _gain) {
+ for (auto& j: i) {
+ j = 0;
+ }
+ }
+}
+
+
+void
+AudioMapping::take_from(AudioMapping const& other)
+{
+ auto input = std::min(input_channels(), other.input_channels());
+ auto output = std::min(output_channels(), other.output_channels());
+
+ for (auto i = 0; i < input; ++i) {
+ for (auto o = 0; o < output; ++o) {
+ set(i, o, other.get(i, o));