summaryrefslogtreecommitdiff
path: root/src/drumkitparser.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-09-02 10:30:02 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-09-02 10:30:02 +0200
commite37c5f5048bb440140dc56ce773d105fc2129385 (patch)
tree0dfe0ab9faec524fd1ee085c6cf763aa15484331 /src/drumkitparser.cc
parent6a96bcf1659d07cd3a7f7e65519007abfaeda2a0 (diff)
Implement master bleed control in the instrument parser and engine.
Diffstat (limited to 'src/drumkitparser.cc')
-rw-r--r--src/drumkitparser.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc
index dd79bce..f517ef7 100644
--- a/src/drumkitparser.cc
+++ b/src/drumkitparser.cc
@@ -187,16 +187,17 @@ void DrumKitParser::endTag(const std::string& name)
{
auto ptr = std::make_unique<Instrument>(settings, rand);
ptr->setGroup(instr_group);
-
+
InstrumentParser parser(*ptr);
parser.parseFile(path + "/" + instr_file);
// Transfer ownership to the DrumKit object.
- kit.instruments.push_back(std::move(ptr));
+ kit.instruments.emplace_back(std::move(ptr));
+ Instrument& instrument = *kit.instruments.back();
// Assign kit channel numbers to instruments channels.
- for (auto& c: parser.channellist) {
- std::string cname = c->name;
+ for (auto& c: instrument.instrument_channels) {
+ std::string cname = c.name;
if(channelmap.find(cname) != channelmap.end())
{
cname = channelmap[cname];
@@ -206,14 +207,14 @@ void DrumKitParser::endTag(const std::string& name)
{
if(kit.channels[cnt].name == cname)
{
- c->num = kit.channels[cnt].num;
+ c.num = kit.channels[cnt].num;
}
}
- if(c->num == NO_CHANNEL)
+ if(c.num == NO_CHANNEL)
{
ERR(kitparser, "Missing channel '%s' in instrument '%s'\n",
- c->name.c_str(), ptr->getName().c_str());
+ c.name.c_str(), instrument.getName().c_str());
}
else
{