diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-03-30 11:15:57 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-03-30 11:15:57 +0200 |
commit | 011143d37aa438a7204c6a4a407db5c49e3fc6c5 (patch) | |
tree | 7fabae02245367c697f5fe3fe35009d3cb55f960 /src/instrumentparser.cc | |
parent | f271a3905a0e8d16f9258ba0b8743a8fd689e787 (diff) | |
parent | c852a24fc978ca7916c0f5819bfed870a1d9519e (diff) |
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
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") { |