Updates for new vstgui
This commit is contained in:
parent
99d907e5c7
commit
ff8562b140
4 changed files with 26 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
2
plugins/editor/external/vstgui4
vendored
2
plugins/editor/external/vstgui4
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 2cf61f5e1fefe4dcd3d19119ddf7b182719a2a5b
|
||||
Subproject commit f6db2b250ce9c08ff3f6939f7a0744d5d3a0a133
|
||||
|
|
@ -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 <vstgui/lib/events.h>
|
||||
#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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue