From 5e8dd4224b39faa03cf3955062e14350b413a2c9 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 7 Aug 2011 13:59:08 +0100 Subject: [PATCH] Misc fixes --- demo.lv2/Juce_Demo_Plugin.ttl | 7 +-- .../audio/plugin_client/LV2/juce_LV2_Wrapper.cpp | 63 +++++++++++----------- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/demo.lv2/Juce_Demo_Plugin.ttl b/demo.lv2/Juce_Demo_Plugin.ttl index f1f6a9e..40bb197 100644 --- a/demo.lv2/Juce_Demo_Plugin.ttl +++ b/demo.lv2/Juce_Demo_Plugin.ttl @@ -3,13 +3,8 @@ @prefix lv2ev: . @prefix lv2ui: . - - a lv2ui:external ; - lv2ui:binary . - a lv2:Plugin ; - lv2ui:ui ; lv2:port [ a lv2:InputPort, lv2ev:EventPort; @@ -66,7 +61,7 @@ [ a lv2:InputPort; a lv2:ControlPort; - lv2:index 8; + lv2:index 7; lv2:symbol "delay"; lv2:name "delay"; lv2:default 0.5; 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 6539c77..fdf1d58 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 @@ -263,8 +263,6 @@ String get_plugin_ttl(String URI, String Binary) } else { plugin += " ],\n"; } - - port_index++; } plugin += " doap:name \"" + String(JucePlugin_Name) + "\" ;\n"; @@ -370,6 +368,13 @@ public: { printf("JuceLV2Wrapper()\n"); + JUCE_AUTORELEASEPOOL; + initialiseJuce_GUI(); + +#if JUCE_LINUX + MessageManagerLock mmLock; +#endif + filter = createPluginFilter(); jassert(filter != nullptr); @@ -422,19 +427,34 @@ public: ~JuceLV2Wrapper() { - stopTimer(); + JUCE_AUTORELEASEPOOL + + { +#if JUCE_LINUX + MessageManagerLock mmLock; +#endif + stopTimer(); + + delete filter; + filter = nullptr; - delete filter; - filter = nullptr; + channels.free(); + deleteTempChannels(); - channels.free(); - deleteTempChannels(); + ports_ctrl.clear(); + ports_ctrl_last.clear(); - ports_ctrl.clear(); - ports_ctrl_last.clear(); + jassert (activePlugins.contains (this)); + activePlugins.removeValue (this); + } - jassert (activePlugins.contains (this)); - activePlugins.removeValue (this); + if (activePlugins.size() == 0) + { +#if JUCE_LINUX + SharedMessageThread::deleteInstance(); +#endif + shutdownJuce_GUI(); + } } //============================================================================== @@ -789,13 +809,6 @@ 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) { - JUCE_AUTORELEASEPOOL; - initialiseJuce_GUI(); - -#if JUCE_LINUX - MessageManagerLock mmLock; -#endif - JuceLV2Wrapper* wrapper = new JuceLV2Wrapper(descriptor, sample_rate, features); return wrapper; } @@ -826,23 +839,9 @@ void juce_lv2_deactivate(LV2_Handle instance) void juce_lv2_cleanup(LV2_Handle instance) { - JUCE_AUTORELEASEPOOL; - -#if JUCE_LINUX - MessageManagerLock mmLock; -#endif - JuceLV2Wrapper* wrapper = (JuceLV2Wrapper*)instance; wrapper->do_cleanup(); delete wrapper; - - if (activePlugins.size() == 0) - { - #if JUCE_LINUX - SharedMessageThread::deleteInstance(); - #endif - shutdownJuce_GUI(); - } } const void* juce_lv2_extension_data(const char* uri) -- 2.11.4.GIT