- t->set_attribute ("Content", lexical_cast<string> (c));
- t->set_attribute ("DCP", lexical_cast<string> (d));
- t->add_child_text (lexical_cast<string> (get (c, static_cast<dcp::Channel> (d))));
+ t->set_attribute ("Content", raw_convert<string> (c));
+ t->set_attribute ("DCP", raw_convert<string> (d));
+ t->add_child_text (raw_convert<string> (get (c, static_cast<dcp::Channel> (d))));
+ }
+ }
+}
+
+/** @return a string which is unique for a given AudioMapping configuration, for
+ * differentiation between different AudioMappings.
+ */
+string
+AudioMapping::digest () const
+{
+ MD5Digester digester;
+ digester.add (_content_channels);
+ for (int i = 0; i < _content_channels; ++i) {
+ for (int j = 0; j < MAX_DCP_AUDIO_CHANNELS; ++j) {
+ digester.add (_gain[i][j]);