From 05270cd4abe1cc61fb680b801676436f10069413 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 10 Oct 2019 17:31:35 +0200 Subject: Added 'normalized' attribute to sample tag. --- src/dgxmlparser.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/dgxmlparser.cc') diff --git a/src/dgxmlparser.cc b/src/dgxmlparser.cc index 7f62a64..b924cc8 100644 --- a/src/dgxmlparser.cc +++ b/src/dgxmlparser.cc @@ -94,6 +94,17 @@ static bool assign(main_state_t& dest, const std::string& val) return true; } +static bool assign(bool& dest, const std::string& val) +{ + if(val == "true" || val == "false") + { + dest = val == "true"; + return true; + } + + return false; +} + template static bool attrcpy(T& dest, const pugi::xml_node& src, const std::string& attr, LogFunction logger, const std::string& filename, bool opt = false) { @@ -343,6 +354,8 @@ bool parseInstrumentFile(const std::string& filename, InstrumentDOM& dom, LogFun else { res &= attrcpy(dom.samples.back().power, sample, "power", logger, filename); + dom.samples.back().normalized = false; + res &= attrcpy(dom.samples.back().normalized, sample, "normalized", logger, filename, true); } for(pugi::xml_node audiofile: sample.children("audiofile")) -- cgit v1.2.3