Skip to content

Commit

Permalink
Clap First Ready Branch (#1080)
Browse files Browse the repository at this point in the history
Clap first can make the installer now. Almost ready to flip

Also fix an empty zone creation bug
  • Loading branch information
baconpaul authored Aug 10, 2024
1 parent b6b98bb commit bf74633
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ jobs:

- name: "windows clap first"
os: windows-latest
target: scxt_clapfirst_all
target: shortcircuit-installer
cmakeConfig: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DSCXT_JUCE_CLASSIC_STYLE=FALSE
runTests: false
- name: "mac clap first"
os: macos-latest
target: scxt_clapfirst_all
target: shortcircuit-installer
cmakeConfig: -DSCXT_JUCE_CLASSIC_STYLE=FALSE
runTests: false
- name: "ubuntu clap first"
os: ubuntu-latest
target: scxt_clapfirst_all
target: shortcircuit-installer
cmakeConfig: -DSCXT_JUCE_CLASSIC_STYLE=FALSE
runTests: false

Expand Down
24 changes: 15 additions & 9 deletions clients/clap-first/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project(scxt_clapfirst)

set(name "Shortcircuit XT")
set(IMPL_TARGET ${PROJECT_NAME}_impl)
add_library(${IMPL_TARGET} STATIC clap-config.cpp
scxt-plugin/scxt-plugin.cpp)
Expand All @@ -17,36 +18,37 @@ target_link_libraries(${IMPL_TARGET} PUBLIC

target_include_directories(${IMPL_TARGET} PUBLIC .)

set(CLAP_TARGET ${PROJECT_NAME}_clap)
set(CLAP_TARGET ${PROJECT_NAME}_CLAP)
add_library(${CLAP_TARGET} MODULE scxt-clap-entry.cpp)
target_link_libraries(${CLAP_TARGET} PUBLIC ${IMPL_TARGET})
target_library_make_clap(TARGET ${CLAP_TARGET}
CLAP_NAME "Shortcircuit XT Clap First"
CLAP_NAME ${name}
CLAP_MACOS_BUNDLE_IDENTIFIER "org.surge-synth-team.scxt.clap_first.clap"
CLAP_MACOS_BUNDLE_VERSION "0.0.1"
COPY_AFTER_BUILD ${SCXT_COPY_PLUGIN_AFTER_BUILD}
)


set(VST3_TARGET ${PROJECT_NAME}_vst3)
set(VST3_TARGET ${PROJECT_NAME}_VST3)
add_library(${VST3_TARGET} MODULE scxt-clap-entry.cpp)
target_link_libraries(${VST3_TARGET} PUBLIC ${IMPL_TARGET})
target_add_vst3_wrapper(TARGET ${VST3_TARGET}
OUTPUT_NAME "Shortcircuit XT Clap First"
OUTPUT_NAME ${name}
SUPPORTS_ALL_NOTE_EXPRESSIONS TRUE
WINDOWS_FOLDER_VST3 TRUE
)
if (${SCXT_COPY_PLUGIN_AFTER_BUILD})
target_vst3_copy_after_build(TARGET ${VST3_TARGET})
endif()

if (APPLE)
set(AUV2_TARGET ${PROJECT_NAME}_auv2)
set(AUV2_TARGET ${PROJECT_NAME}_AU)
add_library(${AUV2_TARGET} MODULE)
target_sources(${AUV2_TARGET} PRIVATE scxt-clap-entry.cpp)
target_link_libraries(${AUV2_TARGET} PRIVATE ${IMPL_TARGET})
target_add_auv2_wrapper(
TARGET ${AUV2_TARGET}
OUTPUT_NAME "Shortcircuit XT Clap First"
OUTPUT_NAME ${name}
BUNDLE_IDENTIFIER "org.surge-synth-team.scxt.clap_first.auv2"
BUNDLE_VERSION 0.0.1

Expand All @@ -57,16 +59,18 @@ if (APPLE)
endif()
endif()

set(SA_TARGET ${PROJECT_NAME}_standalone)
set(SA_TARGET ${PROJECT_NAME}_Standalone)
add_executable(${SA_TARGET} MACOSX_BUNDLE WIN32)
set_target_properties(${SA_TARGET} PROPERTIES
OUTPUT_NAME ${name})
target_sources(${SA_TARGET} PRIVATE scxt-juce-standalone/scxt-juce-standalone.cpp)
target_link_libraries(${SA_TARGET} PRIVATE ${IMPL_TARGET} juce::juce_audio_devices juce::juce_audio_utils)
target_compile_definitions(${SA_TARGET} PRIVATE JUCE_USE_FLAC=0)

#add_executable(${SA_TARGET} scxt-clap-entry.cpp)
#target_link_libraries(${SA_TARGET} PRIVATE ${IMPL_TARGET})
#target_add_standalone_wrapper(TARGET ${SA_TARGET}
# OUTPUT_NAME "Shortcircuit XT Clap First"
# OUTPUT_NAME ${name}
# STATICALLY_LINKED_CLAP_ENTRY True
# PLUGIN_ID "org.surge-synth-team.scxt.clap-first.scxt-plugin")

Expand All @@ -75,4 +79,6 @@ add_custom_target(${ALL_TARGET})
add_dependencies(${ALL_TARGET} ${CLAP_TARGET} ${SA_TARGET} ${VST3_TARGET})
if (APPLE)
add_dependencies(${ALL_TARGET} ${AUV2_TARGET})
endif()
endif()

set_target_properties(${ALL_TARGET} PROPERTIES ARTEFACT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
72 changes: 63 additions & 9 deletions cmake/basic-installer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ file(MAKE_DIRECTORY ${SCXT_PRODUCT_DIR})
add_custom_target(shortcircuit-products ALL)
add_custom_target(shortcircuit-installer)

function(shortcircuit_package format)
function(shortcircuit_package format suffix)
if (TARGET scxt_plugin)
get_target_property(output_dir scxt_plugin RUNTIME_OUTPUT_DIRECTORY)

Expand All @@ -29,18 +29,71 @@ function(shortcircuit_package format)
)
endif ()
endif()

if (TARGET scxt_clapfirst_all)
get_target_property(output_dir scxt_clapfirst_all ARTEFACT_DIRECTORY)

if (TARGET scxt_clapfirst_${format})
get_target_property(output_name scxt_clapfirst_${format} LIBRARY_OUTPUT_NAME)
if( ${output_name} STREQUAL "output_name-NOTFOUND")
get_target_property(output_name scxt_clapfirst_${format} OUTPUT_NAME)
endif()

add_dependencies(shortcircuit-products scxt_clapfirst_${format})

set(isdir 0)
if (APPLE)
set(isdir 1)
set(target_to_root "../../..")
else()
if ("${suffix}" STREQUAL ".vst3")
set(isdir 1)
set(target_to_root "../../..")
endif()
endif()

message(STATUS "Adding scxt_clapfirst_${format} to installer from '${output_name}${suffix}'")

if (${isdir} EQUAL 1)
add_custom_command(
TARGET shortcircuit-products
POST_BUILD
USES_TERMINAL
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND echo "Installing directory '${output_name}${suffix}' to ${SCXT_PRODUCT_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "$<TARGET_FILE_DIR:scxt_clapfirst_${format}>/${target_to_root}/${output_name}${suffix}" "${SCXT_PRODUCT_DIR}/${output_name}${suffix}"
)
else()
add_custom_command(
TARGET shortcircuit-products
POST_BUILD
USES_TERMINAL
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND echo "Installing file '${output_dir}/${output_name}${suffix}' to ${SCXT_PRODUCT_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:scxt_clapfirst_${format}>" "${SCXT_PRODUCT_DIR}/"

)
endif()
endif()
endif()
endfunction()

shortcircuit_package(VST3)
shortcircuit_package(VST)
shortcircuit_package(LV2)
shortcircuit_package(AU)
shortcircuit_package(CLAP)
shortcircuit_package(Standalone)
shortcircuit_package(VST3 ".vst3")
shortcircuit_package(AU ".component")
shortcircuit_package(CLAP ".clap")
if (APPLE)
shortcircuit_package(Standalone ".app")
elseif (UNIX)
shortcircuit_package(Standalone "")
else()
shortcircuit_package(Standalone ".exe")
endif()

if (WIN32)
message(STATUS "Including special Windows cleanup installer stage")
add_custom_command(TARGET shortcircuit-products
if (TARGET scxt_plugin)

message(STATUS "Including special Windows cleanup installer stage")
add_custom_command(TARGET shortcircuit-products
POST_BUILD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "Cleaning up Windows goobits"
Expand All @@ -49,6 +102,7 @@ if (WIN32)
COMMAND ${CMAKE_COMMAND} -E rm -f "${SCXT_PRODUCT_DIR}/Shortcircuit XT.lib"
COMMAND ${CMAKE_COMMAND} -E rm -f "${SCXT_PRODUCT_DIR}/Shortcircuit XT.pdb"
)
endif()
endif ()

add_dependencies(shortcircuit-installer shortcircuit-products)
Expand Down
1 change: 0 additions & 1 deletion cmake/compiler-and-git.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ else ()

if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(OS_COMPILE_OPTIONS
/arch:SSE42
/wd4244 # convert float from double
/wd4305 # truncate from double to float
/wd4018 # signed unsigned compare
Expand Down
9 changes: 8 additions & 1 deletion src-ui/components/multi/MappingPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,14 @@ void MappingZones::mouseUp(const juce::MouseEvent &e)
namespace cmsg = scxt::messaging::client;
auto za{editor->currentLeadZoneSelection};

sendToSerialization(cmsg::AddBlankZone({za->part, za->group, ks, ke, vs, ve}));
if (!za.has_value())
{
sendToSerialization(cmsg::AddBlankZone({0, 0, ks, ke, vs, ve}));
}
else
{
sendToSerialization(cmsg::AddBlankZone({za->part, za->group, ks, ke, vs, ve}));
}
}
mouseState = NONE;
repaint();
Expand Down

0 comments on commit bf74633

Please sign in to comment.