From ff8562b14086b0af2b72e2545d141156a614c0f5 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 21 Sep 2021 03:39:26 +0200 Subject: [PATCH 1/3] Updates for new vstgui --- cmake/SfizzConfig.cmake | 6 +++--- plugins/editor/cmake/Vstgui.cmake | 3 +++ plugins/editor/external/vstgui4 | 2 +- plugins/editor/src/editor/GUIHelpers.cpp | 25 ++++++++++++++++++------ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/cmake/SfizzConfig.cmake b/cmake/SfizzConfig.cmake index 1cb4b0e6..aa3a225a 100644 --- a/cmake/SfizzConfig.cmake +++ b/cmake/SfizzConfig.cmake @@ -18,9 +18,9 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C++ compatibility level if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND CMAKE_CXX_STANDARD LESS 17) set(CMAKE_CXX_STANDARD 17) -elseif((SFIZZ_LV2_UI OR SFIZZ_VST OR SFIZZ_AU OR SFIZZ_VST2) AND CMAKE_CXX_STANDARD LESS 14) - # if the UI is part of the build, make it 14 - set(CMAKE_CXX_STANDARD 14) +elseif((SFIZZ_LV2_UI OR SFIZZ_VST OR SFIZZ_AU OR SFIZZ_VST2) AND CMAKE_CXX_STANDARD LESS 17) + # if the UI is part of the build, make it 17 + set(CMAKE_CXX_STANDARD 17) endif() # Set build profiling options diff --git a/plugins/editor/cmake/Vstgui.cmake b/plugins/editor/cmake/Vstgui.cmake index 0fb111dd..8f7ebe25 100644 --- a/plugins/editor/cmake/Vstgui.cmake +++ b/plugins/editor/cmake/Vstgui.cmake @@ -39,6 +39,7 @@ add_library(sfizz_vstgui STATIC EXCLUDE_FROM_ALL "${VSTGUI_BASEDIR}/vstgui/lib/cfileselector.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cfont.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cframe.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/cgradient.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cgradientview.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cgraphicspath.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/clayeredviewcontainer.cpp" @@ -57,6 +58,7 @@ add_library(sfizz_vstgui STATIC EXCLUDE_FROM_ALL "${VSTGUI_BASEDIR}/vstgui/lib/cview.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cviewcontainer.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/cvstguitimer.cpp" + "${VSTGUI_BASEDIR}/vstgui/lib/events.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/genericstringlistdatabrowsersource.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/pixelbuffer.cpp" "${VSTGUI_BASEDIR}/vstgui/lib/vstguidebug.cpp" @@ -69,6 +71,7 @@ if(WIN32) "${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/d2dgradient.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" diff --git a/plugins/editor/external/vstgui4 b/plugins/editor/external/vstgui4 index 2cf61f5e..f6db2b25 160000 --- a/plugins/editor/external/vstgui4 +++ b/plugins/editor/external/vstgui4 @@ -1 +1 @@ -Subproject commit 2cf61f5e1fefe4dcd3d19119ddf7b182719a2a5b +Subproject commit f6db2b250ce9c08ff3f6939f7a0744d5d3a0a133 diff --git a/plugins/editor/src/editor/GUIHelpers.cpp b/plugins/editor/src/editor/GUIHelpers.cpp index b5da7443..901891b5 100644 --- a/plugins/editor/src/editor/GUIHelpers.cpp +++ b/plugins/editor/src/editor/GUIHelpers.cpp @@ -5,6 +5,9 @@ // If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz #include "GUIHelpers.h" +#include "utility/vstgui_before.h" +#include +#include "utility/vstgui_after.h" class SFrameDisabler::KeyAndMouseHook : public CBaseObject, public IKeyboardHook, @@ -13,12 +16,10 @@ public: void setEnabled(bool value) { enabled_ = value; } protected: - int32_t onKeyDown(const VstKeyCode&, CFrame*) { return enabled_ ? -1 : 1; } - int32_t onKeyUp(const VstKeyCode&, CFrame*) { return enabled_ ? -1 : 1; } - void onMouseEntered(CView*, CFrame*) {} - void onMouseExited(CView*, CFrame*) {} - CMouseEventResult onMouseMoved(CFrame*, const CPoint&, const CButtonState&) { return enabled_ ? kMouseEventNotHandled : kMouseEventHandled; } - CMouseEventResult onMouseDown(CFrame*, const CPoint&, const CButtonState&) { return enabled_ ? kMouseEventNotHandled : kMouseEventHandled; } + void onKeyboardEvent(KeyboardEvent& event, CFrame* frame) override; + void onMouseEntered(CView* view, CFrame* frame) override {} + void onMouseExited(CView* view, CFrame* frame) override {} + void onMouseEvent(MouseEvent& event, CFrame* frame) override; private: bool enabled_ = true; @@ -51,3 +52,15 @@ void SFrameDisabler::disable() hook_->setEnabled(false); delayedEnabler_->stop(); } + +void SFrameDisabler::KeyAndMouseHook::onKeyboardEvent(KeyboardEvent& event, CFrame* frame) +{ + if (!enabled_) + event.consumed = true; +} + +void SFrameDisabler::KeyAndMouseHook::onMouseEvent(MouseEvent& event, CFrame* frame) +{ + if (!enabled_) + event.consumed = true; +} From 526525be6aed84036a64d5d9ab94b914a6f69d43 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 21 Sep 2021 19:41:23 +0200 Subject: [PATCH 2/3] Update filesystem to fix macOS c++17 --- external/filesystem | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/filesystem b/external/filesystem index 2a8b380f..7bc5c173 160000 --- a/external/filesystem +++ b/external/filesystem @@ -1 +1 @@ -Subproject commit 2a8b380f8d4e77b389c42a194ab9c70d8e3a0f1e +Subproject commit 7bc5c17305fe70518ca72162e244af1d12455a91 From 4b6b380ce4faf64adeb19dffd806f8d170281878 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 21 Sep 2021 20:44:16 +0200 Subject: [PATCH 3/3] Set macOS requirement to 10.14 to get c++17 working; fix this later --- cmake/SfizzConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/SfizzConfig.cmake b/cmake/SfizzConfig.cmake index aa3a225a..715144a9 100644 --- a/cmake/SfizzConfig.cmake +++ b/cmake/SfizzConfig.cmake @@ -52,7 +52,7 @@ endif() # Set macOS compatibility level if(APPLE) - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9") + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14") endif() # Do not define macros `min` and `max`