diff --git a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp index 77446d1de3..63c5dce263 100644 --- a/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp +++ b/extras/Projucer/Source/Project/UI/jucer_ProjectContentComponent.cpp @@ -1370,8 +1370,8 @@ void ProjectContentComponent::handleMissingSystemHeaders() String tabMessage ("Compiler not available due to missing system headers\nPlease install a recent version of Visual Studio and the Windows Desktop SDK"); String alertWindowMessage ("Missing system headers\nPlease install a recent version of Visual Studio and the Windows Desktop SDK"); #elif JUCE_LINUX || JUCE_BSD - String tabMessage ("Compiler not available due to missing system headers\nPlease insall using your package manager"); - String alertWindowMessage ("Missing system headers\nPlease insall using your package manager"); + String tabMessage ("Compiler not available due to missing system headers\nPlease install using your package manager"); + String alertWindowMessage ("Missing system headers\nPlease install using your package manager"); #endif setBuildEnabled (false, true); diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index ad1c4b8350..dc1f422cb1 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -27,7 +27,7 @@ #include //============================================================================== -#if JucePlugin_Build_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) +#if JucePlugin_Build_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) #if JUCE_PLUGINHOST_VST3 #if JUCE_MAC @@ -73,7 +73,7 @@ #endif #endif -#if JUCE_LINUX +#if JUCE_LINUX || JUCE_BSD #include std::vector>> getFdReadCallbacks(); @@ -1165,7 +1165,7 @@ private: //============================================================================== class JuceVST3Editor : public Vst::EditorView, public Steinberg::IPlugViewContentScaleSupport, - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD public Steinberg::Linux::IEventHandler, #endif private Timer @@ -1195,7 +1195,7 @@ private: REFCOUNT_METHODS (Vst::EditorView) //============================================================================== - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD void PLUGIN_API onFDIsSet (Steinberg::Linux::FileDescriptor fd) override { if (plugFrame != nullptr) @@ -1217,7 +1217,7 @@ private: if (strcmp (type, kPlatformTypeHWND) == 0) #elif JUCE_MAC if (strcmp (type, kPlatformTypeNSView) == 0 || strcmp (type, kPlatformTypeHIView) == 0) - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD if (strcmp (type, kPlatformTypeX11EmbedWindowID) == 0) #endif return kResultTrue; @@ -1235,7 +1235,7 @@ private: createContentWrapperComponentIfNeeded(); - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD component->setOpaque (true); component->addToDesktop (0, (void*) systemWindow); component->setVisible (true); @@ -1245,7 +1245,7 @@ private: component->startTimer (500); #endif - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD if (auto* runLoop = getHostRunLoop()) { for (auto& cb : getFdReadCallbacks()) @@ -1277,7 +1277,7 @@ private: { #if JUCE_WINDOWS component->removeFromDesktop(); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD fdCallbackMap.clear(); if (auto* runLoop = getHostRunLoop()) @@ -1571,7 +1571,7 @@ private: { resizeHostWindow(); - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD if (getHostType().isBitwigStudio()) repaint(); #endif @@ -1723,7 +1723,7 @@ private: #if JUCE_WINDOWS WindowsHooks hooks; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD std::unordered_map> fdCallbackMap; ::Display* display = XWindowSystem::getInstance()->getDisplay(); @@ -3082,7 +3082,7 @@ bool shutdownModule() #if JUCE_WINDOWS extern "C" __declspec (dllexport) bool InitDll() { return initModule(); } extern "C" __declspec (dllexport) bool ExitDll() { return shutdownModule(); } -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD void* moduleHandle = nullptr; int moduleEntryCounter = 0; diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp index 809280745a..3da348409c 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp @@ -42,7 +42,7 @@ void AudioPluginFormatManager::addDefaultFormats() jassert (dynamic_cast (format) == nullptr); #endif - #if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) + #if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) jassert (dynamic_cast (format) == nullptr); #endif @@ -64,7 +64,7 @@ void AudioPluginFormatManager::addDefaultFormats() formats.add (new VSTPluginFormat()); #endif - #if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) + #if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) formats.add (new VST3PluginFormat()); #endif diff --git a/modules/juce_audio_processors/format_types/VST3_SDK/JUCE_README.txt b/modules/juce_audio_processors/format_types/VST3_SDK/JUCE_README.txt new file mode 100644 index 0000000000..ffa860d2a3 --- /dev/null +++ b/modules/juce_audio_processors/format_types/VST3_SDK/JUCE_README.txt @@ -0,0 +1,2 @@ +Added a compiler error message to plugininterfaces/base/fplatform.h when +attempting to use the SDK on BSD diff --git a/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h b/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h index 3a93738937..f0bc0cde08 100644 --- a/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h +++ b/modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h @@ -16,6 +16,10 @@ #pragma once +#if JUCE_BSD + #error To build JUCE VST3 plug-ins on BSD you must use an external BSD-compatible VST3 SDK with JUCE_CUSTOM_VST3_SDK=1 +#endif + #define kLittleEndian 0 #define kBigEndian 1 diff --git a/modules/juce_audio_processors/format_types/juce_VST3Common.h b/modules/juce_audio_processors/format_types/juce_VST3Common.h index 8e9fdd08cc..2779a1914b 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Common.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Common.h @@ -91,7 +91,7 @@ inline void toString128 (Steinberg::Vst::String128 result, const juce::String& s static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeHWND; #elif JUCE_MAC static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeNSView; -#elif JUCE_LINUX +#elif JUCE_LINUX || JUCE_BSD static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeX11EmbedWindowID; #endif diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h index b9615db4cd..0daa0e2905 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -156,7 +156,7 @@ namespace Steinberg DEF_CLASS_IID (IPlugFrame) DEF_CLASS_IID (IPlugViewContentScaleSupport) - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD DEF_CLASS_IID (Linux::IRunLoop) #endif } diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 603e415330..978f1c9ebd 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -23,7 +23,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) +#if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) #include "juce_VST3Headers.h" #include "juce_VST3Common.h" @@ -841,7 +841,7 @@ struct DLLHandle if (auto* exitFn = (ExitModuleFn) getFunction (exitFnName)) exitFn(); - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD library.close(); #endif } @@ -866,7 +866,7 @@ struct DLLHandle void* getFunction (const char* functionName) { - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD return library.getFunction (functionName); #elif JUCE_MAC if (bundleRef == nullptr) @@ -890,7 +890,7 @@ private: static constexpr const char* exitFnName = "ExitDll"; using EntryProc = bool (PLUGIN_API*) (); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD static constexpr const char* entryFnName = "ModuleEntry"; static constexpr const char* exitFnName = "ModuleExit"; @@ -903,7 +903,7 @@ private: #endif //============================================================================== - #if JUCE_WINDOWS || JUCE_LINUX + #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD DynamicLibrary library; bool open() @@ -978,7 +978,7 @@ struct DLLHandleCache : public DeletedAtShutdown DLLHandle& findOrCreateHandle (const String& modulePath) { - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD File file (getDLLFileFromBundle (modulePath)); #else File file (modulePath); @@ -998,7 +998,7 @@ struct DLLHandleCache : public DeletedAtShutdown } private: - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD File getDLLFileFromBundle (const String& bundlePath) const { auto machineName = []() -> String @@ -1151,7 +1151,7 @@ struct VST3PluginWindow : public AudioProcessorEditor, removeScaleFactorListener(); - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD embeddedComponent.removeClient(); #endif @@ -1167,7 +1167,7 @@ struct VST3PluginWindow : public AudioProcessorEditor, view = nullptr; } - #if JUCE_LINUX + #if JUCE_LINUX || JUCE_BSD struct RunLoop final : public Steinberg::Linux::IRunLoop { ~RunLoop() @@ -1427,7 +1427,7 @@ private: addAndMakeVisible (embeddedComponent); #if JUCE_MAC pluginHandle = (HandleFormat) embeddedComponent.getView(); - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD pluginHandle = (HandleFormat) embeddedComponent.getHostWindowID(); #endif #endif @@ -1490,7 +1490,7 @@ private: #elif JUCE_MAC AutoResizingNSViewComponentWithParent embeddedComponent; using HandleFormat = NSView*; - #elif JUCE_LINUX + #elif JUCE_LINUX || JUCE_BSD XEmbedComponent embeddedComponent { true, false }; using HandleFormat = Window; #else @@ -3338,7 +3338,7 @@ bool VST3PluginFormat::fileMightContainThisPluginType (const String& fileOrIdent auto f = File::createFileWithoutCheckingPath (fileOrIdentifier); return f.hasFileExtension (".vst3") - #if JUCE_MAC || JUCE_LINUX + #if JUCE_MAC || JUCE_LINUX || JUCE_BSD && f.exists(); #else && f.existsAsFile(); diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h index 789fac9b5a..66d5123bfe 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h @@ -26,7 +26,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)) || DOXYGEN +#if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD)) || DOXYGEN /** Implements a plugin format for VST3s. diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 8a80cc7c43..76acae1d7b 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -55,7 +55,7 @@ #undef KeyPress #endif -#if ! JUCE_WINDOWS && ! JUCE_MAC && ! JUCE_LINUX +#if ! JUCE_WINDOWS && ! JUCE_MAC && ! JUCE_LINUX && ! JUCE_BSD #undef JUCE_PLUGINHOST_VST3 #define JUCE_PLUGINHOST_VST3 0 #endif @@ -68,7 +68,7 @@ namespace juce { -#if JUCE_PLUGINHOST_VST || (JUCE_PLUGINHOST_LADSPA && JUCE_LINUX || JUCE_BSD) +#if JUCE_PLUGINHOST_VST || (JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD)) static bool arrayContainsPlugin (const OwnedArray& list, const PluginDescription& desc)