summaryrefslogtreecommitdiff
path: root/src/dgxmlparser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-10-10 17:31:35 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-10-14 22:04:13 +0200
commit05270cd4abe1cc61fb680b801676436f10069413 (patch)
tree7bf77d0753c8a9822c2a7ff06016c8f73cddb186 /src/dgxmlparser.cc
parent1f7d744819968aec3c82035f730558cb73e0bd18 (diff)
Added 'normalized' attribute to sample tag.
Diffstat (limited to 'src/dgxmlparser.cc')
-rw-r--r--src/dgxmlparser.cc13
1 files changed, 13 insertions, 0 deletions
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<typename T>
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"))