diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-09-15 16:41:04 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-09-15 16:41:04 +0200 |
commit | f9831fe56a5d0543ef059b00f5885ccdb2f3c676 (patch) | |
tree | acc99d9c98aa65fce16e94458dbdc37fe07a385c /src/drumkitloader.cc | |
parent | d3b27a6ad3d5036a706b0f0c00a4173e2881bc75 (diff) |
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.
Diffstat (limited to 'src/drumkitloader.cc')
-rw-r--r-- | src/drumkitloader.cc | 12 |
1 files changed, 12 insertions, 0 deletions
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; } |