summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-05-11 09:26:34 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-05-11 11:24:49 +0200
commitb310f4080736ac9675b870e6e081399c2d58e8c5 (patch)
tree95ab9a8d928a924b7a95a8b81a32ad7a23615e7f /src
parent4ad7a200b9850eba4b044c34e18006592563aeee (diff)
Fix "Error" state of kit and midimap on intially loading the plugin.
Diffstat (limited to 'src')
-rw-r--r--src/drumkitloader.cc17
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(),