From c251f04e32cdd6b00f601a7f10306ad541299a98 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 17 Jul 2011 11:23:14 +0100 Subject: [PATCH] Started with UI stuff again, slowly --- .../audio/plugin_client/LV2/juce_LV2_Wrapper.cpp | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) 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 3ee1ba0..17bf00f 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 @@ -453,7 +453,6 @@ const void* juce_lv2_extension_data(const char* uri) } //============================================================================== -#if 0 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) { printf("ui_instantiate()\n"); @@ -462,8 +461,7 @@ LV2UI_Handle juce_lv2ui_instantiate(const LV2UI_Descriptor* descriptor, const ch { if (strcmp(features[i]->URI, LV2_INSTANCE_ACCESS_URI) == 0 && features[i]->data) { JuceLV2Wrapper* wrapper = (JuceLV2Wrapper*)features[i]->data; - wrapper->do_ui_instantiate(descriptor->URI, write_function, controller, widget, features); - return wrapper; + // TODO } i++; } @@ -474,21 +472,19 @@ LV2UI_Handle juce_lv2ui_instantiate(const LV2UI_Descriptor* descriptor, const ch void juce_lv2ui_cleanup(LV2UI_Handle instance) { printf("ui_cleanup()\n"); - if (!instance) return; - JuceLV2Wrapper* wrapper = (JuceLV2Wrapper*)instance; - wrapper->do_ui_cleanup(); + // TODO } void juce_lv2ui_port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t buffer_size, uint32_t format, const void* buffer) { printf("ui_port_event()\n"); - if (!instance) return; - if (buffer_size != sizeof(float) || format != 0) return; - JuceLV2Wrapper* wrapper = (JuceLV2Wrapper*)instance; - float value = *(float*)buffer; - wrapper->do_ui_port_event(port_index, value); + + if (buffer_size == sizeof(float) && format == 0) + { + float value = *(float*)buffer; + // TODO + } } -#endif //============================================================================== // Create new LV2 objects @@ -506,7 +502,6 @@ LV2_Descriptor* getNewLv2Plugin() return Lv2Plugin; } -#if 0 LV2UI_Descriptor* getNewLv2UI(bool external) { LV2UI_Descriptor* Lv2UI = new LV2UI_Descriptor; @@ -517,7 +512,6 @@ LV2UI_Descriptor* getNewLv2UI(bool external) Lv2UI->extension_data = juce_lv2_extension_data; return Lv2UI; } -#endif //============================================================================== // Mac startup code.. @@ -531,8 +525,7 @@ LV2UI_Descriptor* getNewLv2UI(bool external) extern "C" __attribute__ ((visibility("default"))) const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { - initialiseMac(); - // 0 -> External UI; 1 -> JUCE UI + initialiseJuce_GUI(); return (index <= 1) ? getNewLv2UI((index == 0)) : nullptr; } @@ -547,8 +540,8 @@ LV2UI_Descriptor* getNewLv2UI(bool external) extern "C" __attribute__ ((visibility("default"))) const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { - // 0 -> External UI; 1 -> JUCE UI - return nullptr; //(index <= 1) ? getNewLv2UI((index == 0)) : nullptr; + initialiseJuce_GUI(); + return (index <= 1) ? getNewLv2UI((index == 0)) : nullptr; } // don't put initialiseJuce_GUI or shutdownJuce_GUI in these... it will crash! @@ -566,7 +559,7 @@ LV2UI_Descriptor* getNewLv2UI(bool external) extern "C" __declspec (dllexport) const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index) { - // 0 -> External UI; 1 -> JUCE UI + initialiseJuce_GUI(); return (index <= 1) ? getNewLv2UI((index == 0)) : nullptr; } -- 2.11.4.GIT