summaryrefslogtreecommitdiff
path: root/src/dgxmlparser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-06-17 15:26:07 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-12 11:11:44 +0200
commitbd0e48a876f25751ae7e0d025178b19d773ca00e (patch)
treea503de41fbae079d2ea8084d2d4d716482413896 /src/dgxmlparser.cc
parent8dd1ea54a2d2198004c82fe75b45714917b440a1 (diff)
Finished DOMLoader and fixed the broken unit-tests.
Diffstat (limited to 'src/dgxmlparser.cc')
-rw-r--r--src/dgxmlparser.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/dgxmlparser.cc b/src/dgxmlparser.cc
index cc76b3e..3fdedc2 100644
--- a/src/dgxmlparser.cc
+++ b/src/dgxmlparser.cc
@@ -114,9 +114,11 @@ bool parseDrumkitFile(const std::string& filename, DrumkitDOM& dom)
//TODO: handle xml version
pugi::xml_node drumkit = doc.child("drumkit");
- res &= attrcpy(dom.description, drumkit, "description");
res &= attrcpy(dom.name, drumkit, "name");
- res &= attrcpy(dom.samplerate, drumkit, "samplerate");
+ res &= attrcpy(dom.version, drumkit, "version");
+ res &= attrcpy(dom.description, drumkit, "description");
+ dom.samplerate = 44100.0;
+ res &= attrcpy(dom.samplerate, drumkit, "samplerate", true);
pugi::xml_node channels = doc.child("drumkit").child("channels");
for(pugi::xml_node channel: channels.children("channel"))
@@ -158,6 +160,8 @@ bool parseInstrumentFile(const std::string& filename, InstrumentDOM& dom)
pugi::xml_node instrument = doc.child("instrument");
res &= attrcpy(dom.name, instrument, "name");
+ res &= attrcpy(dom.version, instrument, "version");
+ res &= attrcpy(dom.description, instrument, "description", true);
pugi::xml_node channels = instrument.child("channels");
for(pugi::xml_node channel : channels.children("channel"))
@@ -168,7 +172,7 @@ bool parseInstrumentFile(const std::string& filename, InstrumentDOM& dom)
res &= attrcpy(dom.instrument_channels.back().main, channel, "main", true);
}
- pugi::xml_node samples = doc.child("instrument").child("samples");
+ pugi::xml_node samples = instrument.child("samples");
for(pugi::xml_node sample: samples.children("sample"))
{
dom.samples.emplace_back();