diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-03-19 21:11:31 +0100 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2014-03-19 21:11:31 +0100 |
commit | aa656f19d015febb1174c0c91cb1711657280c70 (patch) | |
tree | bedcde25df2bd4e9f1286047d2e47071bda0d94a /src/instrumentparser.cc | |
parent | d6f325454d47546d56525cf64c528f35f8dec430 (diff) |
Using power defined in xml if any.
Diffstat (limited to 'src/instrumentparser.cc')
-rw-r--r-- | src/instrumentparser.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/instrumentparser.cc b/src/instrumentparser.cc index 6580b09..c66608b 100644 --- a/src/instrumentparser.cc +++ b/src/instrumentparser.cc @@ -79,7 +79,16 @@ void InstrumentParser::startTag(std::string name, DEBUG(instrparser,"Missing required attribute 'name'.\n"); return; } - s = new Sample(attr["name"]); + + float power; + if(attr.find("power") == attr.end()) { + power = -1; + } else { + power = atof(attr["power"].c_str()); + DEBUG(instrparser, "Instrument power set to %f\n", power); + } + + s = new Sample(attr["name"], power); } if(name == "audiofile") { |