c068279aac
Reads I_FOLDERDEPTH into a FolderTree (pure view_tree helper, unit-tested), snapshots to-be-parked tracks before parking, runs the D1 planner, and applies park/restore flag + per-FX-offline writes under an undo block. Master and mute/solo untouched; acts only on tagged tracks.
119 lines
6.1 KiB
CMake
119 lines
6.1 KiB
CMake
cmake_minimum_required(VERSION 3.19)
|
|
project(reaper_reasampler LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Vendored dependencies — add as git submodules (see README):
|
|
# git submodule add https://github.com/justinfrankel/reaper-sdk vendor/reaper-sdk
|
|
# git submodule add https://github.com/justinfrankel/WDL vendor/WDL
|
|
# ---------------------------------------------------------------------------
|
|
set(SDK_INC ${CMAKE_CURRENT_SOURCE_DIR}/vendor/reaper-sdk/sdk)
|
|
set(WDL_INC ${CMAKE_CURRENT_SOURCE_DIR}/vendor/WDL/WDL)
|
|
set(SWELL ${WDL_INC}/swell)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 1) Pure model library — NO REAPER, NO SWELL. Builds & tests anywhere.
|
|
# The sampler's heart: Sample metadata + BankIndex (Milestone 1).
|
|
# ---------------------------------------------------------------------------
|
|
add_library(bank_model STATIC src/bank_model.cpp)
|
|
target_include_directories(bank_model PUBLIC src)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 2) Pure peaks library — NO REAPER, NO SWELL. Waveform min/max thumbnails from
|
|
# raw PCM (Milestone 2). A sibling pure lib, kept distinct from bank_model.
|
|
# ---------------------------------------------------------------------------
|
|
add_library(peaks STATIC src/peaks.cpp)
|
|
target_include_directories(peaks PUBLIC src)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 2b) Pure capture-path arithmetic — NO REAPER, NO SWELL. Bank-folder / unique
|
|
# file-name / project-relative path derivation for the capture shell (M3).
|
|
# Split out so the fiddly path logic is unit-tested outside the DAW.
|
|
# ---------------------------------------------------------------------------
|
|
add_library(capture_paths STATIC src/capture_paths.cpp)
|
|
target_include_directories(capture_paths PUBLIC src)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 2c) Pure view_mode_model library — NO REAPER, NO SWELL. The Design View heart
|
|
# (Phase D1): mode registry + GUID-keyed membership index + folder-tree-aware
|
|
# visibility derivation + parking/restore planner + JSON round-trip. Mirror of
|
|
# bank_model; the folder tree is an INPUT supplied by the D2 shell.
|
|
# ---------------------------------------------------------------------------
|
|
add_library(view_mode_model STATIC src/view_mode_model.cpp)
|
|
target_include_directories(view_mode_model PUBLIC src)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 2d) Pure view_tree library — NO REAPER, NO SWELL. The one testable-outside-DAW
|
|
# piece of the D2 view shell: turning REAPER's linear I_FOLDERDEPTH stream into
|
|
# the parent<->child FolderTree the model consumes. The REAPER reads stay in
|
|
# view.cpp; this fiddly folder-depth walk is unit-tested here (mirrors
|
|
# capture_paths splitting the path math out of the capture shell).
|
|
# ---------------------------------------------------------------------------
|
|
add_library(view_tree STATIC src/view_tree.cpp)
|
|
target_include_directories(view_tree PUBLIC src)
|
|
target_link_libraries(view_tree PUBLIC view_mode_model)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 3) Standalone tests for the pure modules (run without launching REAPER).
|
|
# ---------------------------------------------------------------------------
|
|
enable_testing()
|
|
add_executable(bank_model_tests tests/test_bank_model.cpp)
|
|
target_link_libraries(bank_model_tests PRIVATE bank_model)
|
|
add_test(NAME bank_model_tests COMMAND bank_model_tests)
|
|
|
|
add_executable(peaks_tests tests/test_peaks.cpp)
|
|
target_link_libraries(peaks_tests PRIVATE peaks)
|
|
add_test(NAME peaks_tests COMMAND peaks_tests)
|
|
|
|
add_executable(capture_paths_tests tests/test_capture_paths.cpp)
|
|
target_link_libraries(capture_paths_tests PRIVATE capture_paths)
|
|
add_test(NAME capture_paths_tests COMMAND capture_paths_tests)
|
|
|
|
add_executable(view_mode_model_tests tests/test_view_mode_model.cpp)
|
|
target_link_libraries(view_mode_model_tests PRIVATE view_mode_model)
|
|
add_test(NAME view_mode_model_tests COMMAND view_mode_model_tests)
|
|
|
|
add_executable(view_tree_tests tests/test_view_tree.cpp)
|
|
target_link_libraries(view_tree_tests PRIVATE view_tree)
|
|
add_test(NAME view_tree_tests COMMAND view_tree_tests)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# 4) The REAPER extension — a loadable module (dlopen'd by REAPER, not linked).
|
|
# ---------------------------------------------------------------------------
|
|
add_library(reaper_reasampler MODULE
|
|
src/main.cpp
|
|
src/capture.cpp
|
|
src/persist.cpp
|
|
src/view_mode_model.cpp
|
|
src/view_tree.cpp
|
|
src/view.cpp
|
|
)
|
|
target_link_libraries(reaper_reasampler PRIVATE bank_model capture_paths)
|
|
target_include_directories(reaper_reasampler PRIVATE ${SDK_INC} ${WDL_INC})
|
|
set_target_properties(reaper_reasampler PROPERTIES PREFIX "" OUTPUT_NAME "reaper_reasampler")
|
|
|
|
if(WIN32)
|
|
# Native Win32. REAPER provides nothing extra to link.
|
|
# Dialog resources return with the docked bank_panel (Milestone 5).
|
|
|
|
elseif(APPLE)
|
|
# macOS: use REAPER's OWN SWELL at runtime via the modstub.
|
|
# Do NOT build full SWELL. SWELL_PROVIDED_BY_APP routes calls to the host.
|
|
target_sources(reaper_reasampler PRIVATE ${SWELL}/swell-modstub.mm)
|
|
target_compile_definitions(reaper_reasampler PRIVATE SWELL_PROVIDED_BY_APP)
|
|
target_link_libraries(reaper_reasampler PRIVATE "-framework AppKit")
|
|
set_target_properties(reaper_reasampler PROPERTIES SUFFIX ".dylib")
|
|
# Dialog: run SWELL resgen once (see README) and add the generated source.
|
|
|
|
else()
|
|
# Linux: REAPER's libSwell.so is used at runtime via the generic modstub.
|
|
# With SWELL_PROVIDED_BY_APP you can drop pkg-config / -lX11 entirely.
|
|
target_sources(reaper_reasampler PRIVATE ${SWELL}/swell-modstub-generic.cpp)
|
|
target_compile_definitions(reaper_reasampler PRIVATE SWELL_PROVIDED_BY_APP)
|
|
set_target_properties(reaper_reasampler PROPERTIES SUFFIX ".so")
|
|
# Dialog: run SWELL resgen once (see README) and add the generated source.
|
|
endif()
|