From b310f4080736ac9675b870e6e081399c2d58e8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Thu, 11 May 2017 09:26:34 +0200 Subject: Fix "Error" state of kit and midimap on intially loading the plugin. --- src/drumkitloader.cc | 17 ++++++++++++----- 1 file 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(&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(), -- cgit v1.2.3