diff --git a/.gitmodules b/.gitmodules index 7850d1b81..441fc8070 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,7 +17,7 @@ shallow = true [submodule "vst/external/VST_SDK/VST3_SDK/vstgui4"] path = plugins/editor/external/vstgui4 - url = https://github.com/sfztools/vstgui.git + url = https://github.com/steinbergmedia/vstgui.git shallow = true [submodule "external/st_audiofile/thirdparty/dr_libs"] path = external/st_audiofile/thirdparty/dr_libs diff --git a/plugins/editor/cmake/Vstgui.cmake b/plugins/editor/cmake/Vstgui.cmake index 136dab444..0fb111ddb 100644 --- a/plugins/editor/cmake/Vstgui.cmake +++ b/plugins/editor/cmake/Vstgui.cmake @@ -2,21 +2,6 @@ add_library(sfizz_vstgui STATIC EXCLUDE_FROM_ALL "${VSTGUI_BASEDIR}/vstgui/lib/animation/animations.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/animation/animator.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/animation/timingfunctions.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cbitmap.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cbitmapfilter.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/ccolor.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cdatabrowser.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cdrawcontext.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cdrawmethods.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cdropsource.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cfileselector.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cfont.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cframe.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cgradientview.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/cgraphicspath.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/clayeredviewcontainer.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/clinestyle.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/coffscreencontext.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/controls/cautoanimation.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/controls/cbuttons.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/controls/ccolorchooser.cpp" @@ -40,6 +25,25 @@ add_library(sfizz_vstgui STATIC EXCLUDE_FROM_ALL "${VSTGUI_BASEDIR}/vstgui/lib/controls/ctextlabel.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/controls/cvumeter.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/controls/cxypad.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/platformfactory.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/fileresourceinputstream.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/genericoptionmenu.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/generictextedit.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cbitmap.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cbitmapfilter.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/ccolor.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cdatabrowser.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cdrawcontext.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cdrawmethods.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cdropsource.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cfileselector.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cfont.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cframe.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cgradientview.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cgraphicspath.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/clayeredviewcontainer.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/clinestyle.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/coffscreencontext.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/copenglview.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cpoint.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/crect.cpp" @@ -54,43 +58,35 @@ add_library(sfizz_vstgui STATIC EXCLUDE_FROM_ALL "${VSTGUI_BASEDIR}/vstgui/lib/cviewcontainer.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cvstguitimer.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/genericstringlistdatabrowsersource.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/genericoptionmenu.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/platformfactory.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/vstguidebug.cpp") + "${VSTGUI_BASEDIR}/vstgui/lib/pixelbuffer.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/vstguidebug.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/vstguiinit.cpp") add_library(sfizz::vstgui ALIAS sfizz_vstgui) if(WIN32) target_sources(sfizz_vstgui PRIVATE - "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/fileresourceinputstream.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/direct2d/d2dbitmap.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/direct2d/d2ddrawcontext.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/direct2d/d2dfont.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/direct2d/d2dgraphicspath.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32datapackage.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32dragging.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32factory.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32frame.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32openglview.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32optionmenu.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32support.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32resourcestream.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32support.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32textedit.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/win32factory.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/winfileselector.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/winstring.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/win32/wintimer.cpp") elseif(APPLE) target_sources(sfizz_vstgui PRIVATE - "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/fileresourceinputstream.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/genericoptionmenu.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/generictextedit.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/carbon/hiviewframe.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/carbon/hiviewoptionmenu.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/carbon/hiviewtextedit.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/caviewlayer.mm" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cfontmac.mm" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cgbitmap.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cgdrawcontext.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cocoa/autoreleasepool.mm" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cocoa/cocoahelpers.mm" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cocoa/cocoaopenglview.mm" @@ -98,6 +94,10 @@ elseif(APPLE) "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cocoa/nsviewdraggingsession.mm" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cocoa/nsviewframe.mm" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cocoa/nsviewoptionmenu.mm" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/caviewlayer.mm" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cfontmac.mm" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cgbitmap.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/cgdrawcontext.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/macclipboard.mm" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/macfactory.mm" "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/macfileselector.mm" @@ -107,8 +107,6 @@ elseif(APPLE) "${VSTGUI_BASEDIR}/vstgui/lib/platform/mac/quartzgraphicspath.cpp") else() target_sources(sfizz_vstgui PRIVATE - "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/fileresourceinputstream.cpp" - "${VSTGUI_BASEDIR}/vstgui/lib/platform/common/generictextedit.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/linux/cairobitmap.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/linux/cairocontext.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/platform/linux/cairofont.cpp" diff --git a/plugins/editor/external/vstgui4 b/plugins/editor/external/vstgui4 index f4fe0d0b1..fd492f0a0 160000 --- a/plugins/editor/external/vstgui4 +++ b/plugins/editor/external/vstgui4 @@ -1 +1 @@ -Subproject commit f4fe0d0b1e53443342ba732a0e715ce5c96b49df +Subproject commit fd492f0a09b6830bbc04dc4da53df4297fbde1bd diff --git a/plugins/lv2/sfizz_ui.cpp b/plugins/lv2/sfizz_ui.cpp index 9627d7e17..1730fdf32 100644 --- a/plugins/lv2/sfizz_ui.cpp +++ b/plugins/lv2/sfizz_ui.cpp @@ -57,8 +57,10 @@ #include "editor/utility/vstgui_before.h" #include "vstgui/lib/cframe.h" #include "vstgui/lib/platform/iplatformframe.h" +#include "vstgui/lib/platform/platformfactory.h" #if defined(_WIN32) #include "vstgui/lib/platform/platform_win32.h" +#include "vstgui/lib/platform/win32/win32factory.h" #endif #include "editor/utility/vstgui_after.h" using namespace VSTGUI; @@ -83,6 +85,7 @@ struct sfizz_ui_t : EditorController, VSTGUIEditorInterface { #if MAC BundleRefInitializer bundleRefInitializer; #endif + VSTGUIInitializer vstguiInitializer; LV2UI_Write_Function write = nullptr; LV2UI_Controller con = nullptr; LV2_URID_Map *map = nullptr; @@ -229,8 +232,9 @@ instantiate(const LV2UI_Descriptor *descriptor, if (!fixBundlePath(realBundlePath)) return nullptr; + const Win32Factory* winFactory = VSTGUI::getPlatformFactory().asWin32Factory(); std::string resourcePath = realBundlePath + "\\Contents\\Resources\\"; - IWin32PlatformFrame::setResourceBasePath(resourcePath.c_str()); + winFactory->setResourceBasePath(resourcePath.c_str()); #endif // makes labels refresh correctly @@ -249,7 +253,7 @@ instantiate(const LV2UI_Descriptor *descriptor, config = &x11Config; #endif - if (!uiFrame->open(parentWindowId, kDefaultNative, config)) + if (!uiFrame->open(parentWindowId, PlatformType::kDefaultNative, config)) return nullptr; Editor *editor = new Editor(*self); diff --git a/plugins/lv2/vstgui_helpers.cpp b/plugins/lv2/vstgui_helpers.cpp index 31637bb00..02a2b4dce 100644 --- a/plugins/lv2/vstgui_helpers.cpp +++ b/plugins/lv2/vstgui_helpers.cpp @@ -22,6 +22,7 @@ #if MAC #include "vstgui/plugin-bindings/getpluginbundle.h" #endif +#include "vstgui/lib/vstguiinit.h" #if LINUX void Lv2IdleRunLoop::execIdle() @@ -214,3 +215,32 @@ BundleRefInitializer::~BundleRefInitializer() } // namespace VSTGUI #endif + +namespace VSTGUI { + +static volatile size_t gVstguiInitCount = 0; +static std::mutex gVstguiInitMutex; + +VSTGUIInitializer::VSTGUIInitializer() +{ + std::lock_guard lock(gVstguiInitMutex); + if (gVstguiInitCount++ == 0) { +#if WINDOWS + VSTGUI::init((HINSTANCE)hInstance); +#elif MAC + VSTGUI::init((CFBundleRef)gBundleRef); +#else + VSTGUI::init(soHandle); +#endif + } +} + +VSTGUIInitializer::~VSTGUIInitializer() +{ + std::lock_guard lock(gVstguiInitMutex); + if (--gVstguiInitCount == 0) { + VSTGUI::exit(); + } +} + +} // namespace VSTGUI diff --git a/plugins/lv2/vstgui_helpers.h b/plugins/lv2/vstgui_helpers.h index 2fbcd841c..165ee45e7 100644 --- a/plugins/lv2/vstgui_helpers.h +++ b/plugins/lv2/vstgui_helpers.h @@ -87,3 +87,15 @@ class BundleRefInitializer { }; } #endif + +namespace VSTGUI +{ +class VSTGUIInitializer { +public: + VSTGUIInitializer(); + ~VSTGUIInitializer(); +private: + VSTGUIInitializer(const VSTGUIInitializer&) = delete; + VSTGUIInitializer& operator=(const VSTGUIInitializer&) = delete; +}; +} diff --git a/plugins/vst/CMakeLists.txt b/plugins/vst/CMakeLists.txt index b80f99465..c6b3cdc81 100644 --- a/plugins/vst/CMakeLists.txt +++ b/plugins/vst/CMakeLists.txt @@ -48,7 +48,6 @@ add_library(sfizz-vst3-core STATIC FileTrie.cpp NativeHelpers.h NativeHelpers.cpp - VstPluginFactory.cpp IdleUpdateHandler.h X11RunLoop.h X11RunLoop.cpp) @@ -92,10 +91,12 @@ else() endif() # Build the plugin -add_library(${VSTPLUGIN_PRJ_NAME} MODULE) +add_library(${VSTPLUGIN_PRJ_NAME} MODULE "VstPluginFactory.cpp") if(WIN32) target_sources(${VSTPLUGIN_PRJ_NAME} PRIVATE vst3.def) endif() +target_include_directories(${VSTPLUGIN_PRJ_NAME} + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(${VSTPLUGIN_PRJ_NAME} PRIVATE sfizz-vst3-core) set_target_properties(${VSTPLUGIN_PRJ_NAME} PROPERTIES @@ -176,12 +177,14 @@ elseif(SFIZZ_AU) set(AUPLUGIN_BUNDLE_NAME "${PROJECT_NAME}.component") add_library(${AUPLUGIN_PRJ_NAME} MODULE + "VstPluginFactory.cpp" "${AUWRAPPER_BASEDIR}/aucarbonview.mm" "${AUWRAPPER_BASEDIR}/aucocoaview.mm" "${AUWRAPPER_BASEDIR}/ausdk.mm" "${AUWRAPPER_BASEDIR}/auwrapper.mm" "${AUWRAPPER_BASEDIR}/NSDataIBStream.mm") target_include_directories(${AUPLUGIN_PRJ_NAME} PRIVATE + "${CMAKE_CURRENT_BINARY_DIR}" "${VST3SDK_BASEDIR}") target_link_libraries(${AUPLUGIN_PRJ_NAME} PRIVATE "${APPLE_FOUNDATION_LIBRARY}" @@ -326,12 +329,14 @@ if(SFIZZ_VST2) endif() add_library(${VST2PLUGIN_PRJ_NAME} MODULE + "VstPluginFactory.cpp" "Vst2PluginFactory.cpp" "${VST2WRAPPER_BASEDIR}/vst2wrapper.cpp" "${VST2WRAPPER_BASEDIR}/../basewrapper/basewrapper.cpp" "${VST2SDK_BASEDIR}/public.sdk/source/vst2.x/audioeffect.cpp" "${VST2SDK_BASEDIR}/public.sdk/source/vst2.x/audioeffectx.cpp") target_include_directories(${VST2PLUGIN_PRJ_NAME} PRIVATE + "${CMAKE_CURRENT_BINARY_DIR}" "${VST2SDK_BASEDIR}") if(NOT WIN32) diff --git a/plugins/vst/SfizzVstController.cpp b/plugins/vst/SfizzVstController.cpp index 50d286037..159f6a395 100644 --- a/plugins/vst/SfizzVstController.cpp +++ b/plugins/vst/SfizzVstController.cpp @@ -334,8 +334,10 @@ FUnknown* SfizzVstController::createInstance(void*) return static_cast(new SfizzVstController); } -/* - Note(jpc) Generated at random with uuidgen. - Can't find docs on it... maybe it's to register somewhere? - */ +template <> +FUnknown* createInstance(void* context) +{ + return SfizzVstController::createInstance(context); +} + FUID SfizzVstController::cid = SfizzVstController_cid; diff --git a/plugins/vst/SfizzVstEditor.h b/plugins/vst/SfizzVstEditor.h index 79cbb0ee9..780e2b2fd 100644 --- a/plugins/vst/SfizzVstEditor.h +++ b/plugins/vst/SfizzVstEditor.h @@ -29,7 +29,7 @@ class SfizzVstEditor : public Vst::VSTGUIEditor, absl::Span triggerUpdates); ~SfizzVstEditor(); - bool PLUGIN_API open(void* parent, const VSTGUI::PlatformType& platformType = VSTGUI::kDefaultNative) override; + bool PLUGIN_API open(void* parent, const VSTGUI::PlatformType& platformType) override; void PLUGIN_API close() override; SfizzVstController* getController() const diff --git a/plugins/vst/SfizzVstIDs.h b/plugins/vst/SfizzVstIDs.h index e8175a803..bdd629a7d 100644 --- a/plugins/vst/SfizzVstIDs.h +++ b/plugins/vst/SfizzVstIDs.h @@ -7,7 +7,14 @@ #pragma once #include +/* + Note(jpc) Generated at random with uuidgen. + Can't find docs on it... maybe it's to register somewhere? + */ #define SfizzVstProcessor_cid \ Steinberg::FUID(0xe8fab718, 0x15ed46e3, 0x8b598310, 0x1e12993f) #define SfizzVstController_cid \ Steinberg::FUID(0x7129736c, 0xbc784134, 0xbb899d56, 0x2ebafe4f) + +template +Steinberg::FUnknown* createInstance(void*); diff --git a/plugins/vst/SfizzVstProcessor.cpp b/plugins/vst/SfizzVstProcessor.cpp index dee37c41b..fbf310654 100644 --- a/plugins/vst/SfizzVstProcessor.cpp +++ b/plugins/vst/SfizzVstProcessor.cpp @@ -609,11 +609,6 @@ tresult PLUGIN_API SfizzVstProcessor::notify(Vst::IMessage* message) return result; } -FUnknown* SfizzVstProcessor::createInstance(void*) -{ - return static_cast(new SfizzVstProcessor); -} - void SfizzVstProcessor::receiveMessage(int delay, const char* path, const char* sig, const sfizz_arg_t* args) { uint8_t* oscTemp = _oscTemp.get(); @@ -863,8 +858,15 @@ bool SfizzVstProcessor::writeMessage(Ring_Buffer& fifo, const char* type, const return true; } -/* - Note(jpc) Generated at random with uuidgen. - Can't find docs on it... maybe it's to register somewhere? - */ +FUnknown* SfizzVstProcessor::createInstance(void*) +{ + return static_cast(new SfizzVstProcessor); +} + +template <> +FUnknown* createInstance(void* context) +{ + return SfizzVstProcessor::createInstance(context); +} + FUID SfizzVstProcessor::cid = SfizzVstProcessor_cid; diff --git a/plugins/vst/VstPluginFactory.cpp b/plugins/vst/VstPluginFactory.cpp index cda0d7f30..462caff42 100644 --- a/plugins/vst/VstPluginFactory.cpp +++ b/plugins/vst/VstPluginFactory.cpp @@ -4,19 +4,21 @@ // license. You should have receive a LICENSE.md file along with the code. // If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz -#include "SfizzVstProcessor.h" -#include "SfizzVstController.h" +#include "SfizzVstIDs.h" #include "VstPluginDefs.h" #include "public.sdk/source/main/pluginfactory.h" #include "pluginterfaces/vst/ivstcomponent.h" #include "pluginterfaces/vst/ivstaudioprocessor.h" #include "pluginterfaces/vst/ivsteditcontroller.h" +class SfizzVstProcessor; +class SfizzVstController; + BEGIN_FACTORY_DEF(VSTPLUGIN_VENDOR, VSTPLUGIN_URL, "mailto:" VSTPLUGIN_EMAIL) -DEF_CLASS2 (INLINE_UID_FROM_FUID(SfizzVstProcessor::cid), +DEF_CLASS2 (INLINE_UID_FROM_FUID(SfizzVstProcessor_cid), PClassInfo::kManyInstances, kVstAudioEffectClass, VSTPLUGIN_NAME, @@ -24,9 +26,9 @@ DEF_CLASS2 (INLINE_UID_FROM_FUID(SfizzVstProcessor::cid), Vst::PlugType::kInstrumentSynth, VSTPLUGIN_VERSION, kVstVersionString, - SfizzVstProcessor::createInstance) + createInstance) -DEF_CLASS2 (INLINE_UID_FROM_FUID(SfizzVstController::cid), +DEF_CLASS2 (INLINE_UID_FROM_FUID(SfizzVstController_cid), PClassInfo::kManyInstances, kVstComponentControllerClass, VSTPLUGIN_NAME, @@ -34,16 +36,6 @@ DEF_CLASS2 (INLINE_UID_FROM_FUID(SfizzVstController::cid), "", // not used here VSTPLUGIN_VERSION, kVstVersionString, - SfizzVstController::createInstance) + createInstance) END_FACTORY - -bool InitModule() -{ - return true; -} - -bool DeinitModule() -{ - return true; -} diff --git a/plugins/vst/cmake/Vst3.cmake b/plugins/vst/cmake/Vst3.cmake index 2545655c8..9b1604381 100644 --- a/plugins/vst/cmake/Vst3.cmake +++ b/plugins/vst/cmake/Vst3.cmake @@ -57,6 +57,9 @@ endif() function(plugin_add_vst3sdk NAME) target_link_libraries("${NAME}" PRIVATE vst3sdk) + target_sources("${NAME}" PRIVATE + "${VST3SDK_BASEDIR}/public.sdk/source/main/moduleinit.cpp" + "${VST3SDK_BASEDIR}/public.sdk/source/main/pluginfactory.cpp") if(WIN32) target_sources("${NAME}" PRIVATE "${VST3SDK_BASEDIR}/public.sdk/source/main/dllmain.cpp") @@ -98,9 +101,9 @@ add_library(vst3sdk_vstgui STATIC EXCLUDE_FROM_ALL if(WIN32) target_sources(vst3sdk_vstgui PRIVATE "${VST3SDK_BASEDIR}/public.sdk/source/vst/vstgui_win32_bundle_support.cpp") + target_compile_definitions(vst3sdk_vstgui PRIVATE "SMTG_MODULE_IS_BUNDLE=1") endif() target_link_libraries(vst3sdk_vstgui PUBLIC vst3sdk sfizz::vstgui) -target_compile_definitions(vst3sdk_vstgui PRIVATE "SMTG_MODULE_IS_BUNDLE=1") function(plugin_add_vstgui NAME) target_link_libraries("${NAME}" PRIVATE vst3sdk_vstgui) diff --git a/plugins/vst/external/VST_SDK/VST3_SDK/base b/plugins/vst/external/VST_SDK/VST3_SDK/base index 7b977c031..985fe0192 160000 --- a/plugins/vst/external/VST_SDK/VST3_SDK/base +++ b/plugins/vst/external/VST_SDK/VST3_SDK/base @@ -1 +1 @@ -Subproject commit 7b977c031f42a6bab08e8b10f4f8df0a1f516c38 +Subproject commit 985fe019276ee03c2751a1736ba3b390678e29f2 diff --git a/plugins/vst/external/VST_SDK/VST3_SDK/pluginterfaces b/plugins/vst/external/VST_SDK/VST3_SDK/pluginterfaces index fe202edc9..b8566ef3b 160000 --- a/plugins/vst/external/VST_SDK/VST3_SDK/pluginterfaces +++ b/plugins/vst/external/VST_SDK/VST3_SDK/pluginterfaces @@ -1 +1 @@ -Subproject commit fe202edc93e9a01a1f79a614cc9a292dc9bf3e6e +Subproject commit b8566ef3b2a0cba60a96e3ef2001224c865c8b36 diff --git a/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk b/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk index a3a3ed1b1..c3948deb4 160000 --- a/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk +++ b/plugins/vst/external/VST_SDK/VST3_SDK/public.sdk @@ -1 +1 @@ -Subproject commit a3a3ed1b1620df0b064564f1fd5423ae110234a0 +Subproject commit c3948deb407bdbff89de8fb6ab8500ea4df9d6d9