From 05214baa5fef32c1871a15491c4631803dd7e0b9 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 17 Jul 2011 13:11:57 +0100 Subject: [PATCH] Small fixing --- .../src/audio/plugin_client/LV2/juce_LV2_Wrapper.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/juce/source/src/audio/plugin_client/LV2/juce_LV2_Wrapper.cpp b/juce/source/src/audio/plugin_client/LV2/juce_LV2_Wrapper.cpp index 94ecb18..7088766 100644 --- a/juce/source/src/audio/plugin_client/LV2/juce_LV2_Wrapper.cpp +++ b/juce/source/src/audio/plugin_client/LV2/juce_LV2_Wrapper.cpp @@ -57,6 +57,8 @@ public: port_count (0) { printf("JuceLV2Wrapper()\n"); + initialiseJuce_GUI(); + filter = createPluginFilter(); filter->setPlayConfigDetails(numInChans, numOutChans, 0, 0); @@ -123,6 +125,11 @@ public: jassert (activePlugins.contains (this)); activePlugins.removeValue (this); + + if (activePlugins.size() == 0) + { + shutdownJuce_GUI(); + } } } @@ -498,6 +505,7 @@ private: // LV2 descriptor functions LV2_Handle juce_lv2_instantiate(const LV2_Descriptor* descriptor, double sample_rate, const char* bundle_path, const LV2_Feature* const* features) { + MessageManagerLock mmLock; JuceLV2Wrapper* wrapper = new JuceLV2Wrapper(descriptor, sample_rate, features); return wrapper; } @@ -528,6 +536,7 @@ void juce_lv2_deactivate(LV2_Handle instance) void juce_lv2_cleanup(LV2_Handle instance) { + MessageManagerLock mmLock; JuceLV2Wrapper* wrapper = (JuceLV2Wrapper*)instance; wrapper->do_cleanup(); delete wrapper; @@ -542,6 +551,7 @@ const void* juce_lv2_extension_data(const char* uri) //============================================================================== LV2UI_Handle juce_lv2ui_instantiate(const LV2UI_Descriptor* descriptor, const char* plugin_uri, const char* bundle_path, LV2UI_Write_Function write_function, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) { + MessageManagerLock mmLock; for (uint16_t i = 0; features[i]; i++) { if (strcmp(features[i]->URI, LV2_INSTANCE_ACCESS_URI) == 0 && features[i]->data) @@ -557,6 +567,7 @@ LV2UI_Handle juce_lv2ui_instantiate(const LV2UI_Descriptor* descriptor, const ch void juce_lv2ui_port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t buffer_size, uint32_t format, const void* buffer) { + MessageManagerLock mmLock; JuceLv2Editor* editor = (JuceLv2Editor*)instance; if (buffer_size == sizeof(float) && format == 0) @@ -568,8 +579,9 @@ void juce_lv2ui_port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t void juce_lv2ui_cleanup(LV2UI_Handle instance) { + MessageManagerLock mmLock; JuceLv2Editor* editor = (JuceLv2Editor*)instance; - editor->do_cleanup(); + //editor->do_cleanup(); delete editor; } -- 2.11.4.GIT