summaryrefslogtreecommitdiff
path: root/src/instrumentparser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-03-30 11:15:57 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-03-30 11:15:57 +0200
commit011143d37aa438a7204c6a4a407db5c49e3fc6c5 (patch)
tree7fabae02245367c697f5fe3fe35009d3cb55f960 /src/instrumentparser.cc
parentf271a3905a0e8d16f9258ba0b8743a8fd689e787 (diff)
parentc852a24fc978ca7916c0f5819bfed870a1d9519e (diff)
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
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") {