diff options
author | André Nusser <andre.nusser@googlemail.com> | 2017-05-11 09:26:34 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2017-05-11 11:24:49 +0200 |
commit | b310f4080736ac9675b870e6e081399c2d58e8c5 (patch) | |
tree | 95ab9a8d928a924b7a95a8b81a32ad7a23615e7f | |
parent | 4ad7a200b9850eba4b044c34e18006592563aeee (diff) |
Fix "Error" state of kit and midimap on intially loading the plugin.
-rw-r--r-- | src/drumkitloader.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc index a7afee4..6f0521b 100644 --- a/src/drumkitloader.cc +++ b/src/drumkitloader.cc @@ -85,11 +85,14 @@ bool DrumKitLoader::loadkit(const std::string& file) if(file == "") { - settings.drumkit_load_status.store(LoadStatus::Error); + if (getter.reload_counter.getValue() != 0) + { + settings.drumkit_load_status.store(LoadStatus::Error); - // Show a full bar - settings.number_of_files.store(1); - settings.number_of_files_loaded.store(1); + // Show a full bar + settings.number_of_files.store(1); + settings.number_of_files_loaded.store(1); + } return false; } @@ -252,7 +255,11 @@ void DrumKitLoader::thread_main() if(getter.midimap_file.hasChanged() || newKit) { auto ie_midi = dynamic_cast<AudioInputEngineMidi*>(&ie); - if(ie_midi) + + // if there's a midi engine and this is not just the default midimap + // name which is set. + if(ie_midi && (getter.midimap_file.getValue() != "" || + getter.reload_counter.getValue() != 0)) { settings.midimap_load_status.store(LoadStatus::Loading); bool ret = ie_midi->loadMidiMap(getter.midimap_file.getValue(), |