|
- diff --git a/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp b/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp
- index 2f4b727..97e8a96 100644
- --- a/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp
- +++ b/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp
- @@ -52,7 +52,7 @@
- #define JucePlugin_WantsLV2State 1
- #endif
-
- -#if JUCE_LINUX
- +#if JUCE_LINUX && ! JUCE_LINUX_EMBED
- #include <X11/Xlib.h>
- #undef KeyPress
- #endif
- @@ -79,12 +79,12 @@
-
- #include "../utility/juce_IncludeModuleHeaders.h"
-
- +#if JUCE_LINUX && ! JUCE_LINUX_EMBED
- namespace juce
- {
- - #if JUCE_LINUX
- extern Display* display;
- - #endif
- }
- +#endif
-
- #define JUCE_LV2_STATE_STRING_URI "urn:juce:stateString"
- #define JUCE_LV2_STATE_BINARY_URI "urn:juce:stateBinary"
- @@ -200,6 +200,7 @@ const String makeManifestFile (AudioProcessor* const filter, const String& binar
- text += " rdfs:seeAlso <" + binary + ".ttl> .\n";
- text += "\n";
-
- +#if ! JUCE_LINUX_EMBED
- // UIs
- if (filter->hasEditor())
- {
- @@ -211,19 +212,20 @@ const String makeManifestFile (AudioProcessor* const filter, const String& binar
- text += "\n";
-
- text += "<" + pluginURI + "#ParentUI>\n";
- -#if JUCE_MAC
- + #if JUCE_MAC
- text += " a ui:CocoaUI ;\n";
- -#elif JUCE_LINUX
- + #elif JUCE_LINUX
- text += " a ui:X11UI ;\n";
- -#elif JUCE_WINDOWS
- + #elif JUCE_WINDOWS
- text += " a ui:WindowsUI ;\n";
- -#endif
- + #endif
- text += " ui:binary <" + binary + PLUGIN_EXT "> ;\n";
- text += " lv2:requiredFeature <" LV2_INSTANCE_ACCESS_URI "> ;\n";
- text += " lv2:optionalFeature ui:noUserResize ;\n";
- text += " lv2:extensionData <" LV2_PROGRAMS__UIInterface "> .\n";
- text += "\n";
- }
- +#endif
-
- #if JucePlugin_WantsLV2Presets
- const String presetSeparator(pluginURI.contains("#") ? ":" : "#");
- @@ -273,6 +275,7 @@ const String makePluginFile (AudioProcessor* const filter, const int maxNumInput
- text += " <" LV2_PROGRAMS__Interface "> ;\n";
- text += "\n";
-
- +#if ! JUCE_LINUX_EMBED
- // UIs
- if (filter->hasEditor())
- {
- @@ -280,6 +283,7 @@ const String makePluginFile (AudioProcessor* const filter, const int maxNumInput
- text += " <" + pluginURI + "#ParentUI> ;\n";
- text += "\n";
- }
- +#endif
-
- uint32 portIndex = 0;
-
- @@ -570,6 +574,7 @@ private:
- };
- #endif
-
- +#if ! JUCE_LINUX_EMBED
- //==============================================================================
- /**
- Lightweight DocumentWindow subclass for external ui
- @@ -1105,6 +1110,8 @@ private:
- JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceLv2UIWrapper)
- };
-
- +#endif /* JUCE_LINUX_EMBED */
- +
- //==============================================================================
- /**
- Juce LV2 handle
- @@ -1249,7 +1256,9 @@ public:
- {
- const MessageManagerLock mmLock;
-
- +#if ! JUCE_LINUX_EMBED
- ui = nullptr;
- +#endif
- filter = nullptr;
-
- if (progDesc.name != nullptr)
- @@ -1818,8 +1827,10 @@ public:
- String stateData (CharPointer_UTF8(static_cast<const char*>(data)));
- filter->setStateInformationString (stateData);
-
- + #if ! JUCE_LINUX_EMBED
- if (ui != nullptr)
- ui->repaint();
- + #endif
-
- return LV2_STATE_SUCCESS;
- }
- @@ -1828,8 +1839,10 @@ public:
- {
- filter->setCurrentProgramStateInformation (data, size);
-
- + #if ! JUCE_LINUX_EMBED
- if (ui != nullptr)
- ui->repaint();
- + #endif
-
- return LV2_STATE_SUCCESS;
- }
- @@ -1852,6 +1865,7 @@ public:
- #endif
- }
-
- +#if ! JUCE_LINUX_EMBED
- //==============================================================================
- JuceLv2UIWrapper* getUI (LV2UI_Write_Function writeFunction, LV2UI_Controller controller, LV2UI_Widget* widget,
- const LV2_Feature* const* features, bool isExternal)
- @@ -1865,6 +1879,7 @@ public:
-
- return ui;
- }
- +#endif
-
- private:
- #if JUCE_LINUX
- @@ -1874,7 +1889,9 @@ private:
- #endif
-
- ScopedPointer<AudioProcessor> filter;
- +#if ! JUCE_LINUX_EMBED
- ScopedPointer<JuceLv2UIWrapper> ui;
- +#endif
- HeapBlock<float*> channels;
- MidiBuffer midiEvents;
- int numInChans, numOutChans;
- @@ -2033,6 +2050,7 @@ static const void* juceLV2_ExtensionData (const char* uri)
- return nullptr;
- }
-
- +#if ! JUCE_LINUX_EMBED
- //==============================================================================
- // LV2 UI descriptor functions
-
- @@ -2068,6 +2086,7 @@ static void juceLV2UI_Cleanup (LV2UI_Handle handle)
- {
- ((JuceLv2UIWrapper*)handle)->lv2Cleanup();
- }
- +#endif
-
- //==============================================================================
- // static LV2 Descriptor objects
- @@ -2083,6 +2102,7 @@ static const LV2_Descriptor JuceLv2Plugin = {
- juceLV2_ExtensionData
- };
-
- +#if ! JUCE_LINUX_EMBED
- static const LV2UI_Descriptor JuceLv2UI_External = {
- strdup(String(getPluginURI() + "#ExternalUI").toRawUTF8()),
- juceLV2UI_InstantiateExternal,
- @@ -2098,14 +2118,17 @@ static const LV2UI_Descriptor JuceLv2UI_Parent = {
- nullptr,
- nullptr
- };
- +#endif
-
- static const struct DescriptorCleanup {
- DescriptorCleanup() {}
- ~DescriptorCleanup()
- {
- free((void*)JuceLv2Plugin.URI);
- +#if ! JUCE_LINUX_EMBED
- free((void*)JuceLv2UI_External.URI);
- free((void*)JuceLv2UI_Parent.URI);
- +#endif
- }
- } _descCleanup;
-
- @@ -2130,6 +2153,7 @@ JUCE_EXPORTED_FUNCTION const LV2_Descriptor* lv2_descriptor (uint32 index)
- return (index == 0) ? &JuceLv2Plugin : nullptr;
- }
-
- +#if ! JUCE_LINUX_EMBED
- JUCE_EXPORTED_FUNCTION const LV2UI_Descriptor* lv2ui_descriptor (uint32 index);
- JUCE_EXPORTED_FUNCTION const LV2UI_Descriptor* lv2ui_descriptor (uint32 index)
- {
- @@ -2143,5 +2167,6 @@ JUCE_EXPORTED_FUNCTION const LV2UI_Descriptor* lv2ui_descriptor (uint32 index)
- return nullptr;
- }
- }
- +#endif
-
- #endif
- diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp
- index 8df41ca..4c0a6a1 100644
- --- a/modules/juce_audio_processors/juce_audio_processors.cpp
- +++ b/modules/juce_audio_processors/juce_audio_processors.cpp
- @@ -47,7 +47,7 @@
- #endif
- #endif
-
- -#if JUCE_PLUGINHOST_VST && JUCE_LINUX
- +#if JUCE_PLUGINHOST_VST && JUCE_LINUX && ! JUCE_LINUX_EMBED
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #undef KeyPress
- @@ -161,7 +161,9 @@ void AutoResizingNSViewComponentWithParent::timerCallback()
- #include "format/juce_AudioPluginFormat.cpp"
- #include "format/juce_AudioPluginFormatManager.cpp"
- #include "processors/juce_AudioProcessor.cpp"
- -#include "processors/juce_AudioProcessorEditor.cpp"
- +#if ! JUCE_LINUX_EMBED
- + #include "processors/juce_AudioProcessorEditor.cpp"
- +#endif
- #include "processors/juce_AudioProcessorGraph.cpp"
- #include "processors/juce_GenericAudioProcessorEditor.cpp"
- #include "processors/juce_PluginDescription.cpp"
- diff --git a/modules/juce_events/juce_events.cpp b/modules/juce_events/juce_events.cpp
- index 729a78f..6d69c40 100644
- --- a/modules/juce_events/juce_events.cpp
- +++ b/modules/juce_events/juce_events.cpp
- @@ -55,10 +55,12 @@
- #import <IOKit/pwr_mgt/IOPMLib.h>
-
- #elif JUCE_LINUX
- - #include <X11/Xlib.h>
- - #include <X11/Xresource.h>
- - #include <X11/Xutil.h>
- - #undef KeyPress
- + #if ! JUCE_LINUX_EMBED
- + #include <X11/Xlib.h>
- + #include <X11/Xresource.h>
- + #include <X11/Xutil.h>
- + #undef KeyPress
- + #endif
- #include <unistd.h>
- #endif
-
- @@ -91,6 +93,9 @@ namespace juce
- #elif JUCE_WINDOWS
- #include "native/juce_win32_Messaging.cpp"
-
- +#elif JUCE_LINUX_EMBED
- + #include "native/juce_linux-embed_Messaging.cpp"
- +
- #elif JUCE_LINUX
- #include "native/juce_ScopedXLock.h"
- #include "native/juce_linux_Messaging.cpp"
|