From 30c2b53047b11b1517fa44b49adc52bc5119649c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 16 Sep 2018 18:39:21 +0200 Subject: Default to version 1.0 if the version attribute is missing from the drumkit and instrument xml. --- src/dgxmlparser.cc | 6 ++++-- 1 file 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"); -- cgit v1.2.3