diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-09-03 14:08:41 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-09-03 14:08:41 +0200 |
commit | 1c25d3a69ac27dc1f93bca3a71996e757b452c4b (patch) | |
tree | a67541f62bd35577003f812b35ab6a35098e36ae /src/instrumentparser.cc | |
parent | a359d234ff53bcdab671faa169f45c4f14f5575d (diff) |
Add bleed controls for the drumkit with priority over those set in the instrument files.
Diffstat (limited to 'src/instrumentparser.cc')
-rw-r--r-- | src/instrumentparser.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/instrumentparser.cc b/src/instrumentparser.cc index 1f3948e..f49a6af 100644 --- a/src/instrumentparser.cc +++ b/src/instrumentparser.cc @@ -94,14 +94,13 @@ void InstrumentParser::startTag(const std::string& name, const attr_t& attr) return; } - bool main = false; + InstrumentChannel* channel = addOrGetChannel(attr.at("name")); + channel->main = main_state_t::is_not_main; if(attr.find("main") != attr.end()) { - main = attr.at("main") == "true"; + channel->main = (attr.at("main") == "true") ? + main_state_t::is_main : main_state_t::is_not_main; } - - InstrumentChannel* channel = addOrGetChannel(attr.at("name")); - channel->main = main; } if(name == "samples") @@ -169,7 +168,7 @@ void InstrumentParser::startTag(const std::string& name, const attr_t& attr) auto audio_file = std::make_unique<AudioFile>(path + "/" + attr.at("file"), filechannel, - instrument_channel->main); + instrument_channel); sample->addAudioFile(instrument_channel, audio_file.get()); @@ -263,8 +262,7 @@ InstrumentChannel* InstrumentParser::addOrGetChannel(const std::string& name) instrument.instrument_channels.emplace_back(name); InstrumentChannel& channel = instrument.instrument_channels.back(); - channel.main = true; // Ad-hoc added channels are all main by default for - // backwards compatibility. + channel.main = main_state_t::unset; return &channel; } |