summaryrefslogtreecommitdiff
path: root/libs/plugins
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-08-24 13:01:40 +0200
committerRobin Gareus <robin@gareus.org>2016-08-24 13:05:47 +0200
commitf5602adfe8a5f4de2362f2ae5c1071bdbb0cbeec (patch)
tree3c8e60564df7745e5859593464cb007924cb5ab2 /libs/plugins
parent8a3b246bb323a7e06322679525d7d1d822474337 (diff)
tweak a-fluidsynth reinit strategy.
reset synth in offline thread, queue panic on deactivate to be called in run() after first re-activate. Initial activation does not warrant a panic.
Diffstat (limited to 'libs/plugins')
-rw-r--r--libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c
index 11015b5ba1..79f5586e3f 100644
--- a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c
+++ b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.c
@@ -281,7 +281,7 @@ instantiate (const LV2_Descriptor* descriptor,
/* initialize plugin state */
- self->panic = true;
+ self->panic = false;
self->inform_ui = false;
self->initialized = false;
self->reinit_in_progress = false;
@@ -327,7 +327,7 @@ connect_port (LV2_Handle instance,
}
static void
-activate (LV2_Handle instance)
+deactivate (LV2_Handle instance)
{
AFluidSynth* self = (AFluidSynth*)instance;
self->panic = true;
@@ -352,8 +352,6 @@ run (LV2_Handle instance, uint32_t n_samples)
} else if (self->panic) {
fluid_synth_all_notes_off (self->synth, -1);
fluid_synth_all_sounds_off (self->synth, -1);
- //fluid_synth_reset_reverb (self->synth);
- //fluid_synth_reset_chorus (self->synth);
self->panic = false;
}
@@ -506,6 +504,13 @@ work (LV2_Handle instance,
}
self->initialized = load_sf2 (self, self->queue_sf2_file_path);
+
+ if (self->initialized) {
+ fluid_synth_all_notes_off (self->synth, -1);
+ fluid_synth_all_sounds_off (self->synth, -1);
+ self->panic = false;
+ }
+
respond (handle, 1, "");
return LV2_WORKER_SUCCESS;
}
@@ -519,7 +524,6 @@ work_response (LV2_Handle instance,
self->reinit_in_progress = false;
self->queue_reinit = false;
self->inform_ui = true;
- self->panic = true;
if (self->initialized) {
strcpy (self->current_sf2_file_path, self->queue_sf2_file_path);
@@ -607,9 +611,9 @@ static const LV2_Descriptor descriptor = {
AFS_URN,
instantiate,
connect_port,
- activate,
- run,
NULL,
+ run,
+ deactivate,
cleanup,
extension_data
};