summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-07-04 19:04:56 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-07-04 19:04:56 +0200
commit2a3a269b12a28f0bfadca30ed800184a98f215b8 (patch)
treede1d74d2b413e5365b629f358aaf28ae68cea5eb /src/drumgizmo.cc
parent71e6faeaaa0bb3085fcd838046166025990424a6 (diff)
Clear all active events (ie. stop playing samples) when loading a new kit.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 345e89d..d84799d 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -119,6 +119,12 @@ void DrumGizmo::setRandomSeed(unsigned int seed)
bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
{
+ if(settings_getter.drumkit_file.hasChanged())
+ {
+ // New kit loaded/loading - old events no longer makes sense.
+ events_ds.clear();
+ }
+
if(settings_getter.enable_resampling.hasChanged())
{
enable_resampling = settings_getter.enable_resampling.getValue();