#include "constants.h"
#include "dcpomatic_assert.h"
#include "digester.h"
+#include "util.h"
#include <dcp/raw_convert.h>
#include <dcp/warnings.h>
#include <libcxml/cxml.h>
);
} else {
set (
- i->number_attribute<int>("Input"),
- i->number_attribute<int>("Output"),
+ number_attribute<int>(i, "Input", "input"),
+ number_attribute<int>(i, "Output", "output"),
raw_convert<float>(i->content())
);
}
for (int c = 0; c < input; ++c) {
for (int d = 0; d < output; ++d) {
auto t = node->add_child ("Gain");
- t->set_attribute ("Input", raw_convert<string> (c));
- t->set_attribute ("Output", raw_convert<string> (d));
+ t->set_attribute("input", raw_convert<string>(c));
+ t->set_attribute("output", raw_convert<string>(d));
t->add_child_text (raw_convert<string> (get (c, d)));
}
}
}
}
}
+
+
+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));
+ }
+ }
+}
+