diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-09-16 18:39:21 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-09-16 18:39:21 +0200 |
commit | 30c2b53047b11b1517fa44b49adc52bc5119649c (patch) | |
tree | 9bc03c8fd3574b3f5507711589f168f8dc4147e6 | |
parent | 8205b1cb55e41085f8d044839964dcbcf7d0ae9c (diff) |
Default to version 1.0 if the version attribute is missing from the drumkit and instrument xml.
-rw-r--r-- | src/dgxmlparser.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dgxmlparser.cc b/src/dgxmlparser.cc index 8599b2b..9d3249e 100644 --- a/src/dgxmlparser.cc +++ b/src/dgxmlparser.cc @@ -116,7 +116,8 @@ bool parseDrumkitFile(const std::string& filename, DrumkitDOM& dom) pugi::xml_node drumkit = doc.child("drumkit"); res &= attrcpy(dom.name, drumkit, "name"); - res &= attrcpy(dom.version, drumkit, "version"); + dom.version = "1.0"; + res &= attrcpy(dom.version, drumkit, "version", true); res &= attrcpy(dom.description, drumkit, "description"); dom.samplerate = 44100.0; res &= attrcpy(dom.samplerate, drumkit, "samplerate", true); @@ -165,7 +166,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"); + dom.version = "1.0"; + res &= attrcpy(dom.version, instrument, "version", true); res &= attrcpy(dom.description, instrument, "description", true); pugi::xml_node channels = instrument.child("channels"); |