summaryrefslogtreecommitdiff
path: root/src/instrumentparser.cc
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2014-03-19 21:11:31 +0100
committerJonas Suhr Christensen <jsc@umbraculum.org>2014-03-19 21:11:31 +0100
commitaa656f19d015febb1174c0c91cb1711657280c70 (patch)
treebedcde25df2bd4e9f1286047d2e47071bda0d94a /src/instrumentparser.cc
parentd6f325454d47546d56525cf64c528f35f8dec430 (diff)
Using power defined in xml if any.
Diffstat (limited to 'src/instrumentparser.cc')
-rw-r--r--src/instrumentparser.cc11
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") {