Skip to content

Commit

Permalink
Implement optional sample-accurate event processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Jun 24, 2022
1 parent 00960ac commit 23f932f
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 151 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ are available
* `CLAP_MANUAL_URL` and `CLAP_SUPPORT_URL` generate the urls in your description
* `CLAP_MISBHEAVIOUR_HANDLER_LEVEL` can be set to `Terminate` or `Ignore` (default
is `Ignore`) to choose your behaviour for a misbehaving host.
* `CLAP_CHECKING_LEVEL` can be set to `None`, `Minimal`, or `Maximal` (default is
`Minimal`) to choose the error checking level for the plugin.
* `CLAP_SMALLEST_ALLOWED_BLOCK_SIZE` can be set to any integer value to choose the
smallest allowed block size for doing sample-accurate event processing. Setting the
value to `0` (the default value) will turn off sample-accurate event processing.

## Risks of using this library

Expand Down
9 changes: 8 additions & 1 deletion cmake/ClapTargetHelpers.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function(clap_juce_extensions_plugin_internal)
set(oneValueArgs TARGET TARGET_PATH PLUGIN_NAME IS_JUCER DO_COPY CLAP_MANUAL_URL CLAP_SUPPORT_URL CLAP_MISBEHAVIOUR_HANDLER_LEVEL CLAP_CHECKING_LEVEL)
set(oneValueArgs TARGET TARGET_PATH PLUGIN_NAME IS_JUCER DO_COPY CLAP_MANUAL_URL CLAP_SUPPORT_URL CLAP_MISBEHAVIOUR_HANDLER_LEVEL CLAP_CHECKING_LEVEL CLAP_SMALLEST_ALLOWED_BLOCK_SIZE)
set(multiValueArgs CLAP_ID CLAP_FEATURES)

cmake_parse_arguments(CJA "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand Down Expand Up @@ -31,6 +31,13 @@ function(clap_juce_extensions_plugin_internal)
message( STATUS "Setting Checking handler level to '${CJA_CLAP_CHECKING_LEVEL}'")
endif()

if ("${CJA_CLAP_SMALLEST_ALLOWED_BLOCK_SIZE}" STREQUAL "")
message( STATUS "Setting smallest allowed block size to 0 (no sample-accurate automation)")
set(CJA_CLAP_SMALLEST_ALLOWED_BLOCK_SIZE 0)
else()
message( STATUS "Setting smallest allowed block size to ${CJA_CLAP_SMALLEST_ALLOWED_BLOCK_SIZE}")
endif()

# we need the list of features as comma separated quoted strings
foreach(feature IN LISTS CJA_CLAP_FEATURES)
list (APPEND CJA_CLAP_FEATURES_PARSED "\"${feature}\"")
Expand Down
13 changes: 3 additions & 10 deletions cmake/JucerClap.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# use this function to create a CLAP from a jucer project
function(create_jucer_clap_target)
set(oneValueArgs TARGET PLUGIN_NAME MANUFACTURER_NAME MANUFACTURER_URL VERSION_STRING MANUFACTURER_CODE PLUGIN_CODE EDITOR_NEEDS_KEYBOARD_FOCUS MISBEHAVIOUR_HANDLER_LEVEL CHECKING_LEVEL)
set(multiValueArgs CLAP_ID CLAP_FEATURES CLAP_MANUAL_URL CLAP_SUPPORT_URL)
set(oneValueArgs TARGET PLUGIN_NAME MANUFACTURER_NAME MANUFACTURER_URL VERSION_STRING MANUFACTURER_CODE PLUGIN_CODE EDITOR_NEEDS_KEYBOARD_FOCUS)
set(multiValueArgs CLAP_FEATURES)

cmake_parse_arguments(CJA "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

Expand Down Expand Up @@ -37,15 +37,8 @@ function(create_jucer_clap_target)
endif()

clap_juce_extensions_plugin_jucer(
TARGET ${CJA_TARGET}
TARGET_PATH "${PLUGIN_LIBRARY_PATH}"
PLUGIN_NAME "${CJA_PLUGIN_NAME}"
CLAP_ID "${CJA_CLAP_ID}"
CLAP_FEATURES "${CJA_CLAP_FEATURES}"
CLAP_MANUAL_URL "${CJA_CLAP_MANUAL_URL}"
CLAP_SUPPORT_URL "${CJA_CLAP_SUPPORT_URL}"
CLAP_MISBEHAVIOUR_HANDLER_LEVEL "${CJA_MISBEHAVIOUR_HANDLER_LEVEL}"
CLAP_CHECKING_LEVEL "${CJA_CHECKING_LEVEL}"
${ARGV}
)

string(REPLACE " " "_" clap_target "${CJA_TARGET}_CLAP")
Expand Down
Loading

0 comments on commit 23f932f

Please sign in to comment.