From f9831fe56a5d0543ef059b00f5885ccdb2f3c676 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 15 Sep 2016 16:41:04 +0200 Subject: Make sure we set progress to 0 when starting to load a new kit. Also set progress to 100% when showing an error in order to be sure we actually have a progressbar to paint red. --- src/drumkitloader.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc index 7eab562..2be5408 100644 --- a/src/drumkitloader.cc +++ b/src/drumkitloader.cc @@ -79,9 +79,16 @@ bool DrumKitLoader::loadkit(const std::string& file) { settings.drumkit_load_status.store(LoadStatus::Idle); + settings.number_of_files_loaded.store(0); + if(file == "") { settings.drumkit_load_status.store(LoadStatus::Error); + + // Show a full bar + settings.number_of_files.store(1); + settings.number_of_files_loaded.store(1); + return false; } @@ -100,6 +107,11 @@ bool DrumKitLoader::loadkit(const std::string& file) { ERR(drumgizmo, "Drumkit parser failed: %s\n", file.c_str()); settings.drumkit_load_status.store(LoadStatus::Error); + + // Show a full bar + settings.number_of_files.store(1); + settings.number_of_files_loaded.store(1); + return false; } -- cgit v1.2.3