From 5b7f9ecbeeec316019a7cb4d9d7cbd32237a318c Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 15 Jul 2011 23:29:38 +0100 Subject: [PATCH] No need for special LV2 PluginCharacteristcs --- demo/JuceLibraryCode/JucePluginCharacteristics.h | 2 -- .../src/audio/plugin_client/LV2/lv2_rdf_gen.cpp | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/demo/JuceLibraryCode/JucePluginCharacteristics.h b/demo/JuceLibraryCode/JucePluginCharacteristics.h index e2fd8be..190dcda 100644 --- a/demo/JuceLibraryCode/JucePluginCharacteristics.h +++ b/demo/JuceLibraryCode/JucePluginCharacteristics.h @@ -45,7 +45,5 @@ #define JucePlugin_RTASManufacturerCode JucePlugin_ManufacturerCode #define JucePlugin_RTASProductId JucePlugin_PluginCode #define JUCE_USE_VSTSDK_2_4 1 -#define JucePlugin_LV2Includes "PluginProcessor.h" -#define JucePlugin_LV2ClassName JuceDemoPluginAudioProcessor #endif // __PLUGINCHARACTERISTICS_D4EFFF1A__ diff --git a/juce/source/src/audio/plugin_client/LV2/lv2_rdf_gen.cpp b/juce/source/src/audio/plugin_client/LV2/lv2_rdf_gen.cpp index 4cc88b1..45f8346 100644 --- a/juce/source/src/audio/plugin_client/LV2/lv2_rdf_gen.cpp +++ b/juce/source/src/audio/plugin_client/LV2/lv2_rdf_gen.cpp @@ -9,8 +9,6 @@ #include "JuceHeader.h" #include "JucePluginCharacteristics.h" -#include JucePlugin_LV2Includes - // These are dummy values! enum FakePlugCategory { @@ -27,6 +25,8 @@ enum FakePlugCategory kPlugCategGenerator }; +extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); + String name_to_symbol(String Name) { String Symbol = Name.trimStart().trimEnd().replace(" ", "_").toLowerCase(); @@ -124,7 +124,7 @@ String get_manifest_ttl(String URI, String Binary) String get_plugin_ttl(String URI, String Binary) { - JucePlugin_LV2ClassName* JucePlugin = new JucePlugin_LV2ClassName(); + AudioProcessor* filter = createPluginFilter(); String plugin; plugin += "@prefix doap: .\n"; @@ -135,7 +135,7 @@ String get_plugin_ttl(String URI, String Binary) plugin += "@prefix lv2ui: .\n"; plugin += "\n"; - if (JucePlugin->hasEditor()) { + if (filter->hasEditor()) { plugin += "<" + get_juce_ui_uri() + ">\n"; plugin += " a lv2ui:JUCEUI ;\n"; plugin += " lv2ui:binary <" + Binary + ".so> .\n"; @@ -225,7 +225,7 @@ String get_plugin_ttl(String URI, String Binary) plugin += "\n"; #endif - for (i=0; i < JucePlugin->getNumParameters(); i++) { + for (i=0; i < filter->getNumParameters(); i++) { if (i == 0) { plugin += " lv2:port [\n"; } else { @@ -236,9 +236,9 @@ String get_plugin_ttl(String URI, String Binary) plugin += " a lv2:ControlPort;\n"; //plugin += " lv2:datatype lv2:float;\n"; plugin += " lv2:index " + String(port_index) + ";\n"; - plugin += " lv2:symbol \"" + name_to_symbol(JucePlugin->getParameterName(i)) + "\";\n"; - plugin += " lv2:name \"" + JucePlugin->getParameterName(i) + "\";\n"; - plugin += " lv2:default " + float_to_string(JucePlugin->getParameter(i)) + ";\n"; + plugin += " lv2:symbol \"" + name_to_symbol(filter->getParameterName(i)) + "\";\n"; + plugin += " lv2:name \"" + filter->getParameterName(i) + "\";\n"; + plugin += " lv2:default " + float_to_string(filter->getParameter(i)) + ";\n"; plugin += " lv2:minimum 0.0;\n"; plugin += " lv2:maximum 1.0;\n"; // TODO - units @@ -252,14 +252,14 @@ String get_plugin_ttl(String URI, String Binary) port_index++; } - if (JucePlugin->getNumParameters() > 0) { + if (filter->getNumParameters() > 0) { plugin += "\n"; } plugin += " doap:name \"" + String(JucePlugin_Name) + "\" ;\n"; plugin += " doap:creator \"" + String(JucePlugin_Manufacturer) + "\" .\n"; - delete JucePlugin; + delete filter; return plugin; } -- 2.11.4.GIT