Normalise XML attribute names to be camelCase (#2241).
[dcpomatic.git] / src / lib / audio_mapping.cc
index 8b9f102a56fdae460987cac010ee87ab89098178..3a1809ae88a89efb04da8b9fd85916cc2085dd8f 100644 (file)
 #include "audio_processor.h"
 #include "digester.h"
 #include "util.h"
-#include "warnings.h"
 #include <dcp/raw_convert.h>
+#include <dcp/warnings.h>
 #include <libcxml/cxml.h>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 #include <boost/regex.hpp>
 #include <iostream>
 
@@ -125,7 +125,7 @@ AudioMapping::make_default (AudioProcessor const * processor, optional<boost::fi
                        if (filename) {
                                for (int i = 0; i < regexes; ++i) {
                                        boost::regex e (regex[i].regex, boost::regex::icase);
-                                       if (boost::regex_match(filename->string(), e) && regex[i].channel < output_channels()) {
+                                       if (boost::regex_match(filename->filename().string(), e) && regex[i].channel < output_channels()) {
                                                set (0, regex[i].channel, 1);
                                                guessed = true;
                                        }
@@ -169,8 +169,8 @@ AudioMapping::AudioMapping (cxml::ConstNodePtr node, int state_version)
                                        );
                        } 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())
                                        );
                        }
@@ -227,8 +227,8 @@ AudioMapping::as_xml (xmlpp::Node* node) const
        for (int c = 0; c < _input_channels; ++c) {
                for (int d = 0; d < _output_channels; ++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)));
                }
        }