Skip to content

Commit

Permalink
Clap First Migration (#1081)
Browse files Browse the repository at this point in the history
* Clap First Migration

Turn on the clap-first / clap-wrapper plugin format and standalone
by default. Set up the various ids and names so this should (gulp)
be a seamless transition for all users.
  • Loading branch information
baconpaul authored Aug 10, 2024
1 parent bf74633 commit b4e4f91
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 25 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,37 @@ jobs:
include:
- name: "windows msvc"
os: windows-latest
target: scxt_plugin_Standalone
target: scxt_clapfirst_Standalone
cmakeConfig: -A x64
runTests: false
- name: "windows clang"
os: windows-latest
target: scxt_plugin_Standalone
target: scxt_clapfirst_Standalone
cmakeConfig: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
runTests: false
- name: "mac standalone"
os: macos-latest
target: scxt_plugin_Standalone
target: scxt_clapfirst_Standalone
runTests: true
- name: "ubuntu standalone"
os: ubuntu-latest
target: scxt_plugin_Standalone
target: shortcircuit-installer
runTests: true

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


Expand Down Expand Up @@ -87,5 +87,5 @@ jobs:
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
cmakeArgs: -DCMAKE_BUILD_TYPE=Debug -GNinja
target: scxt_plugin_Standalone
target: shortcircuit-products

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ math(EXPR PART1 "${DAY_OF_YEAR} + 1")
project(ShortcircuitXT VERSION 0.${PART0}.${PART1}.0 LANGUAGES C CXX ASM)
set(ShortcircuitXT_VERSION ${PROJECT_VERSION})

option(SCXT_JUCE_CLASSIC_STYLE "Use juse classic vs clap-first style" ON)
option(SCXT_JUCE_CLASSIC_STYLE "Use juse classic vs clap-first style" OFF)

if (APPLE)
enable_language(OBJC)
Expand Down
2 changes: 2 additions & 0 deletions clients/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ project(scxt-clients LANGUAGES CXX)


if (${SCXT_JUCE_CLASSIC_STYLE})
message(STATUS "Building JUCE_CLASSIC style plugins")
add_subdirectory(juce-plugin)

if(DEFINED ENV{ASIOSDK_DIR} OR BUILD_USING_MY_ASIO_LICENSE)
Expand Down Expand Up @@ -30,6 +31,7 @@ if (${SCXT_JUCE_CLASSIC_STYLE})
set(JUCE_ASIO_SUPPORT TRUE)
endif()
else()
message(STATUS "Building clap-first / wrapper plugins")
add_subdirectory(clap-first)
endif()

Expand Down
21 changes: 16 additions & 5 deletions clients/clap-first/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ 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 ${name}
CLAP_MACOS_BUNDLE_IDENTIFIER "org.surge-synth-team.scxt.clap_first.clap"
CLAP_MACOS_BUNDLE_VERSION "0.0.1"
CLAP_MACOS_BUNDLE_IDENTIFIER "org.surge-synth-team.shortcircuit-xt.clap"
CLAP_MACOS_BUNDLE_VERSION "${ShortcircuitXT_VERSION}"
COPY_AFTER_BUILD ${SCXT_COPY_PLUGIN_AFTER_BUILD}
)

Expand All @@ -36,7 +36,11 @@ target_add_vst3_wrapper(TARGET ${VST3_TARGET}
OUTPUT_NAME ${name}
SUPPORTS_ALL_NOTE_EXPRESSIONS TRUE
WINDOWS_FOLDER_VST3 TRUE
)
# Re-use the JUCE tuid
SINGLE_PLUGIN_TUID ABCDEF019182FAEB566D624153635854
BUNDLE_IDENTIFIER "org.surge-synth-team.shortcircuit-xt.vst3"
BUNDLE_VERSION "${ShortcircuitXT_VERSION}"
)
if (${SCXT_COPY_PLUGIN_AFTER_BUILD})
target_vst3_copy_after_build(TARGET ${VST3_TARGET})
endif()
Expand All @@ -49,10 +53,17 @@ if (APPLE)
target_add_auv2_wrapper(
TARGET ${AUV2_TARGET}
OUTPUT_NAME ${name}
BUNDLE_IDENTIFIER "org.surge-synth-team.scxt.clap_first.auv2"
BUNDLE_VERSION 0.0.1

CLAP_TARGET_FOR_CONFIG ${CLAP_TARGET}

MANUFACTURER_NAME "Surge Synth Team"
MANUFACTURER_CODE VmbA
SUBTYPE_CODE ScXT

DICTIONARY_STREAM_FORMAT "JUCE"

BUNDLE_IDENTIFIER "org.surge-synth-team.shortcircuit-xt.component"
BUNDLE_VERSION "${ShortcircuitXT_VERSION}"
)
if (${SCXT_COPY_PLUGIN_AFTER_BUILD})
target_auv2_copy_after_build(TARGET ${AUV2_TARGET})
Expand Down
2 changes: 1 addition & 1 deletion clients/clap-first/scxt-clap-entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static bool clap_get_auv2_info(const clap_plugin_factory_as_auv2 *factory, uint3

if (strcmp(plugin_id, scxt::clap_first::scxt_plugin::getDescription()->id) == 0)
{
strncpy(info->au_subt, "scCF", 5);
strncpy(info->au_subt, "ScXT", 5);
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions clients/clap-first/scxt-plugin/scxt-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const clap_plugin_descriptor *getDescription()
static const char *features[] = {CLAP_PLUGIN_FEATURE_INSTRUMENT, CLAP_PLUGIN_FEATURE_SAMPLER,
CLAP_PLUGIN_FEATURE_SYNTHESIZER, nullptr};
static clap_plugin_descriptor desc = {CLAP_VERSION,
"org.surge-synth-team.scxt.clap-first.scxt-plugin",
"Shortcircuit XT (Clap First Version)",
"org.surge-synth-team.shortcircuit-xt",
"Shortcircuit XT",
"Surge Synth Team",
"https://surge-synth-team.org",
"",
Expand Down Expand Up @@ -93,7 +93,7 @@ bool SCXTPlugin::stateSave(const clap_ostream *ostream) noexcept
auto xml = scxt::json::streamEngineState(*engine);

auto c = xml.c_str();
auto s = xml.length(); // write the null terminator
auto s = xml.length() + 1; // write the null terminator
while (s > 0)
{
auto r = ostream->write(ostream, c, s);
Expand Down

0 comments on commit b4e4f91

Please sign in to comment.