feat(vst): stand up VST3 instrument spike (S1) — skeleton, IPlugView↔LICE editor, REAPER bridge read
Vendor Steinberg VST3 SDK (v3.7.9_build_61); add reasampler_vst.vst3 as a second, additive build artifact with pure editor-geometry + bridge-marshal helpers under CTest.
This commit is contained in:
+102
@@ -584,6 +584,28 @@ add_executable(card_drag_tests tests/test_card_drag.cpp)
|
||||
target_link_libraries(card_drag_tests PRIVATE card_drag)
|
||||
add_test(NAME card_drag_tests COMMAND card_drag_tests)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 2i) Pure VST3-instrument helpers (Phase S1) — NO VST3, NO REAPER, NO SWELL/LICE.
|
||||
# editor_geometry: the IPlugView LICE editor's rectangle layout + hit-test math
|
||||
# (mirror of mode_switch/bank_grid). bridge_marshal: the REAPER VST-host bridge
|
||||
# read marshalling — GetProjExtState result decode + a small JSON string-field
|
||||
# reader (mirror of capture_paths/wav_trim). Both are unit-tested outside the DAW;
|
||||
# the VST3 shell (src/vst/*) that draws/routes/invokes is DAW-verified.
|
||||
# ---------------------------------------------------------------------------
|
||||
add_library(editor_geometry STATIC src/vst/editor_geometry.cpp)
|
||||
target_include_directories(editor_geometry PUBLIC src/vst)
|
||||
|
||||
add_library(bridge_marshal STATIC src/vst/bridge_marshal.cpp)
|
||||
target_include_directories(bridge_marshal PUBLIC src/vst)
|
||||
|
||||
add_executable(editor_geometry_tests tests/test_editor_geometry.cpp)
|
||||
target_link_libraries(editor_geometry_tests PRIVATE editor_geometry)
|
||||
add_test(NAME editor_geometry_tests COMMAND editor_geometry_tests)
|
||||
|
||||
add_executable(bridge_marshal_tests tests/test_bridge_marshal.cpp)
|
||||
target_link_libraries(bridge_marshal_tests PRIVATE bridge_marshal)
|
||||
add_test(NAME bridge_marshal_tests COMMAND bridge_marshal_tests)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 4) The REAPER extension — a loadable module (dlopen'd by REAPER, not linked).
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -671,3 +693,83 @@ else()
|
||||
# php ${WDL_INC}/swell/mac_resgen.php src/resource.rc
|
||||
# target_sources(reaper_reasampler PRIVATE src/resource.rc_mac_dlg.h) # generated
|
||||
endif()
|
||||
|
||||
# ===========================================================================
|
||||
# 5) The ReaSampler VST3 instrument — the SECOND build artifact (Phase S1).
|
||||
#
|
||||
# Windows-only, VST3-only, REAPER-only (D5). A separate native VST3 plugin the user
|
||||
# instantiates on an instrument track. Additive: the reaper_reasampler target above
|
||||
# builds unchanged. This is the S1 opening spike — a silent-but-loading
|
||||
# SingleComponentEffect skeleton, an IPlugView<->LICE editor, and the REAPER VST-host
|
||||
# bridge read — not yet a sampler.
|
||||
#
|
||||
# ONE-TIME SDK SUBMODULE SETUP (see README / .gitmodules): the vst3sdk superproject is
|
||||
# vendored pinned to tag v3.7.9_build_61; only three of its sub-submodules are needed
|
||||
# (VSTGUI/examples/tests are NOT). After `git submodule update --init vendor/vst3sdk`:
|
||||
# cd vendor/vst3sdk && git submodule update --init pluginterfaces base public.sdk
|
||||
# ===========================================================================
|
||||
if(WIN32)
|
||||
set(VST3_SDK ${CMAKE_CURRENT_SOURCE_DIR}/vendor/vst3sdk)
|
||||
|
||||
# --- 5a) The bounded slice of the Steinberg VST3 SDK this spike needs. --------
|
||||
# Enumerated (not add_subdirectory of the whole SDK) to keep the build hermetic and
|
||||
# lean, matching the project's two-submodule discipline: no VSTGUI, no examples, no
|
||||
# SDK-global CMake helpers/install machinery. Pinned to tag v3.7.9_build_61, so the
|
||||
# list is fixed. If the SDK tag is bumped, re-verify this set.
|
||||
add_library(vst3_sdk STATIC
|
||||
# pluginterfaces/base — FUnknown, IIDs, string table, ustring.
|
||||
${VST3_SDK}/pluginterfaces/base/funknown.cpp
|
||||
${VST3_SDK}/pluginterfaces/base/coreiids.cpp
|
||||
${VST3_SDK}/pluginterfaces/base/conststringtable.cpp
|
||||
${VST3_SDK}/pluginterfaces/base/ustring.cpp
|
||||
# base/source — FObject, strings, buffers, streamer, debug, IIDs, update handler.
|
||||
${VST3_SDK}/base/source/fobject.cpp
|
||||
${VST3_SDK}/base/source/fstring.cpp
|
||||
${VST3_SDK}/base/source/fbuffer.cpp
|
||||
${VST3_SDK}/base/source/fstreamer.cpp
|
||||
${VST3_SDK}/base/source/fdebug.cpp
|
||||
${VST3_SDK}/base/source/baseiids.cpp
|
||||
${VST3_SDK}/base/source/updatehandler.cpp
|
||||
${VST3_SDK}/base/thread/source/flock.cpp
|
||||
# public.sdk/source/vst — the SingleComponentEffect base + its deps. NOTE:
|
||||
# vstsinglecomponenteffect.cpp #includes vsteditcontroller.cpp (unity-style), so
|
||||
# vsteditcontroller.cpp must NOT be listed separately (double definition).
|
||||
${VST3_SDK}/public.sdk/source/vst/vstsinglecomponenteffect.cpp
|
||||
${VST3_SDK}/public.sdk/source/vst/vstcomponentbase.cpp
|
||||
${VST3_SDK}/public.sdk/source/vst/vstbus.cpp
|
||||
${VST3_SDK}/public.sdk/source/vst/vstparameters.cpp
|
||||
${VST3_SDK}/public.sdk/source/vst/vstinitiids.cpp
|
||||
# public.sdk/source/common — CPluginView (IPlugView base) + IIDs.
|
||||
${VST3_SDK}/public.sdk/source/common/pluginview.cpp
|
||||
${VST3_SDK}/public.sdk/source/common/commoniids.cpp
|
||||
# public.sdk/source/main — the class-factory (GetPluginFactory) support. NOTE:
|
||||
# dllmain.cpp + moduleinit.cpp (which carry the InitDll/ExitDll dll exports) are
|
||||
# compiled into the MODULE target directly, NOT here: their SMTG_EXPORT_SYMBOL
|
||||
# functions have no internal referrer, so the linker strips them from a static
|
||||
# lib. Compiling them into the module keeps the exports.
|
||||
${VST3_SDK}/public.sdk/source/main/pluginfactory.cpp
|
||||
)
|
||||
target_include_directories(vst3_sdk PUBLIC ${VST3_SDK})
|
||||
# The SDK requires exactly one of RELEASE / DEVELOPMENT (fdebug.cpp keys off it).
|
||||
target_compile_definitions(vst3_sdk PUBLIC $<IF:$<CONFIG:Debug>,DEVELOPMENT=1,RELEASE=1>)
|
||||
|
||||
# --- 5b) The VST3 module (loadable .vst3 DLL). -------------------------------
|
||||
add_library(reasampler_vst MODULE
|
||||
src/vst/vst_entry.cpp
|
||||
src/vst/reasampler_processor.cpp
|
||||
src/vst/reasampler_editor.cpp
|
||||
src/vst/reaper_bridge.cpp
|
||||
# SDK module entry — compiled into the module (not the static lib) so the
|
||||
# InitDll/ExitDll dll exports survive the link (see vst3_sdk note above).
|
||||
${VST3_SDK}/public.sdk/source/main/dllmain.cpp
|
||||
${VST3_SDK}/public.sdk/source/main/moduleinit.cpp
|
||||
${LICE_SRC}
|
||||
)
|
||||
target_link_libraries(reasampler_vst PRIVATE vst3_sdk editor_geometry bridge_marshal)
|
||||
# SDK_INC gives reaper_vst3_interfaces.h + reaper_plugin_functions.h for the bridge;
|
||||
# WDL_INC gives LICE for the editor. The VST3 SDK headers come from vst3_sdk PUBLIC.
|
||||
target_include_directories(reasampler_vst PRIVATE ${SDK_INC} ${WDL_INC})
|
||||
# A .vst3 is a DLL with a .vst3 extension and no lib-prefix.
|
||||
set_target_properties(reasampler_vst PROPERTIES PREFIX "" SUFFIX ".vst3"
|
||||
OUTPUT_NAME "reasampler_vst")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user