diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-09-15 09:28:15 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-09-15 09:28:15 +0200 |
commit | 22e8c588324184b777cea9f55ec0fc73b56949b8 (patch) | |
tree | cb75167772447848650d90b01c171b344cdc61e3 /src/instrumentparser.cc | |
parent | 9883fb4fc232ebdea44dcf7b015499d31f999695 (diff) |
New experimental sample selector (enable using --with-experimental argument on ./configure).
Diffstat (limited to 'src/instrumentparser.cc')
-rw-r--r-- | src/instrumentparser.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/instrumentparser.cc b/src/instrumentparser.cc index 15195e1..454877f 100644 --- a/src/instrumentparser.cc +++ b/src/instrumentparser.cc @@ -57,6 +57,18 @@ void InstrumentParser::startTag(std::string name, if(attr.find("description") != attr.end()) instrument._description = attr["description"]; + + if(attr.find("version") != attr.end()) { + try { + instrument._version = VersionStr(attr["version"]); + } catch(const char *err) { + ERR(instrparser, "Error parsing version number: %s, using 1.0\n", err); + instrument._version = VersionStr(1,0,0); + } + } else { + WARN(instrparser, "Missing version number, assuming 1.0\n"); + instrument._version = VersionStr(1,0,0); + } } if(name == "samples") { @@ -147,6 +159,10 @@ void InstrumentParser::endTag(std::string name) instrument.samplelist.push_back(s); s = NULL; } + + if(name == "instrument") { + instrument.finalise(); + } } int InstrumentParser::readData(char *data, size_t size) |