From 97bac5932d788f62f0501bc4ba1b8b085c8b9b83 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 28 Mar 2017 10:34:42 +0200 Subject: [PATCH] Fixed a problem when bypassing plugin. Fixed a SEGV when deleting the plugin. --- src/dexed.cpp | 42 ++++++++++++++++++------------------------ src/dexed.h | 1 + src/dexed.mk | 2 +- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/dexed.cpp b/src/dexed.cpp index e3eb539..bfd3f2e 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -52,7 +52,7 @@ Dexed::Dexed(double rate) : lvtk::Synth(p_n_ports, p_midi_in) engineOpl=new EngineOpl; engineMsfa=new FmCore; - for(i=0; ikeyup(); - } + notes_off(); return(true); break; } @@ -831,12 +814,23 @@ void Dexed::setMonoMode(bool mode) { } void Dexed::panic(void) { + for(uint8_t i=0;ioscSync(); + } + } + } +} + +void Dexed::notes_off(void) { for(uint8_t i=0;ioscSync(); + if(voices[i].live==true&&voices[i].keydown==true) { + voices[i].keydown=false; } } } diff --git a/src/dexed.h b/src/dexed.h index 7e04b9e..441a2a8 100644 --- a/src/dexed.h +++ b/src/dexed.h @@ -96,6 +96,7 @@ class Dexed : public lvtk::Synth void keyup(uint8_t pitch); void keydown(uint8_t pitch, uint8_t velo); void panic(void); + void notes_off(void); static const uint8_t MAX_ACTIVE_NOTES = 32; uint8_t max_notes=MAX_ACTIVE_NOTES; diff --git a/src/dexed.mk b/src/dexed.mk index 3427080..4014f7b 100644 --- a/src/dexed.mk +++ b/src/dexed.mk @@ -5,7 +5,7 @@ ###################################### DEXED_DEPENDENCIES = lvtk -DEXED_VERSION = da0fabe3de43de10c1e36899e751791888a7f4e3 +DEXED_VERSION = #da0fabe3de43de10c1e36899e751791888a7f4e3 DEXED_BUNDLES = dexed.lv2 DEXED_SITE = $(call github,dcoredump,dexed,$(DEXED_VERSION)) DEXED_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) MOD=1