From 28096a402947b05c7e923e075f926263a3279a42 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 22 Apr 2021 18:18:53 +0200 Subject: Fix crash when doing async-load in cli. --- src/drumkitloader.cc | 5 ++++- src/settings.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc index 6a4c9f4..9167201 100644 --- a/src/drumkitloader.cc +++ b/src/drumkitloader.cc @@ -138,7 +138,7 @@ bool DrumKitLoader::loadkit(const std::string& file) settings.drumkit_samplerate.store(44100); settings.load_status_text.store(""); - settings.drumkit_load_status.store(LoadStatus::Loading); + settings.drumkit_load_status.store(LoadStatus::Parsing); // Parse drumkit and instrument xml @@ -226,6 +226,9 @@ bool DrumKitLoader::loadkit(const std::string& file) settings.midimap_file = drumkit_path + "/" + drumkitdom.metadata.default_midimap_file; } + // Done parsing. Now start loading the audio + settings.midimap_load_status.store(LoadStatus::Loading); + loadKitAudio(kit); DEBUG(loadkit, "loadkit: Success\n"); diff --git a/src/settings.h b/src/settings.h index 7507827..fb93d79 100644 --- a/src/settings.h +++ b/src/settings.h @@ -38,6 +38,7 @@ enum class LoadStatus : unsigned int { Idle, + Parsing, Loading, Done, Error -- cgit v1.2.3