diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5b33da8d3ad..ddbcb709ac6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,7 +28,7 @@ jobs: isWindows: True cmakeArguments: "-A Win32 -DCMAKE_BUILD_TYPE=Debug" cmakeConfig: "Debug" - cmakeTarget: "surge-xt_Standalone" # just a subset for time + cmakeTarget: "surge-xt_CLAP" # just a subset for time macOS-x86: imageName: 'macos-latest' isMac: True diff --git a/src/surge-xt/CMakeLists.txt b/src/surge-xt/CMakeLists.txt index 07faab57a5f..ef18e36fe4d 100644 --- a/src/surge-xt/CMakeLists.txt +++ b/src/surge-xt/CMakeLists.txt @@ -56,7 +56,7 @@ juce_add_plugin(${PROJECT_NAME} if(SURGE_BUILD_CLAP) clap_juce_extensions_plugin(TARGET surge-xt CLAP_ID "org.surge-synth-team.surge-xt" - CLAP_SUPPORTS_CUSTOM_FACTORY 1 + # CLAP_SUPPORTS_CUSTOM_FACTORY 1 CLAP_FEATURES "instrument" "synthesizer" "hybrid" "free and open source") endif() diff --git a/src/surge-xt/SurgeSynthProcessor.cpp b/src/surge-xt/SurgeSynthProcessor.cpp index 0030ec0e151..553f00d3c6e 100644 --- a/src/surge-xt/SurgeSynthProcessor.cpp +++ b/src/surge-xt/SurgeSynthProcessor.cpp @@ -1020,13 +1020,90 @@ juce::AudioProcessorParameter *SurgeSynthProcessor::getBypassParameter() const void SurgeSynthProcessor::reset() { blockPos = 0; } +uint32_t SurgeSynthProcessor::remoteControlsPageCount() noexcept +{ + return 5; // macros + scene a and b mixer and filters +} + +bool SurgeSynthProcessor::remoteControlsPageFill( + uint32_t pageIndex, juce::String §ionName, uint32_t &pageID, juce::String &pageName, + std::array ¶ms) noexcept +{ + if (pageIndex < 0 || pageIndex >= remoteControlsPageCount()) + return false; + + pageID = pageIndex + 2054; + for (auto &p : params) + p = nullptr; + switch (pageIndex) + { + case 0: + { + sectionName = "Global"; + pageName = "Macros"; + for (int i = 0; i < CLAP_REMOTE_CONTROLS_COUNT && i < macrosById.size(); ++i) + params[i] = macrosById[i]; + } + break; + case 1: + case 3: + { + int scene = 0; + sectionName = "Scene A"; + pageName = "Scene A Mixer"; + if (pageIndex == 3) + { + sectionName = "Scene B"; + pageName = "Scene B Mixer"; + scene = 1; + } + auto &sc = surge->storage.getPatch().scene[scene]; + params[0] = paramsByID[surge->idForParameter(&sc.level_o1)]; + params[1] = paramsByID[surge->idForParameter(&sc.level_o2)]; + params[2] = paramsByID[surge->idForParameter(&sc.level_o3)]; + params[3] = nullptr; + params[4] = paramsByID[surge->idForParameter(&sc.level_noise)]; + params[5] = paramsByID[surge->idForParameter(&sc.level_ring_12)]; + params[6] = paramsByID[surge->idForParameter(&sc.level_ring_23)]; + params[7] = paramsByID[surge->idForParameter(&sc.level_pfg)]; + } + break; + case 2: + case 4: + { + int scene = 0; + sectionName = "Scene A"; + pageName = "Scene A Filters"; + if (pageIndex == 4) + { + scene = 1; + sectionName = "Scene B"; + pageName = "Scene B Filters"; + } + auto &sc = surge->storage.getPatch().scene[scene]; + params[0] = paramsByID[surge->idForParameter(&sc.filterunit[0].cutoff)]; + params[1] = paramsByID[surge->idForParameter(&sc.filterunit[0].resonance)]; + params[2] = paramsByID[surge->idForParameter(&sc.filterunit[1].cutoff)]; + params[3] = paramsByID[surge->idForParameter(&sc.filterunit[1].resonance)]; + params[4] = paramsByID[surge->idForParameter(&sc.wsunit.drive)]; + params[5] = nullptr; + params[6] = paramsByID[surge->idForParameter(&sc.filter_balance)]; + params[7] = paramsByID[surge->idForParameter(&sc.feedback)]; + } + break; + } + return true; +} + //============================================================================== // This creates new instances of the plugin.. juce::AudioProcessor *JUCE_CALLTYPE createPluginFilter() { return new SurgeSynthProcessor(); } +#if 0 void *JUCE_CALLTYPE clapJuceExtensionCustomFactory(const char *) { // ToDo: Implement preset discovery here // See #6930 return nullptr; -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/surge-xt/SurgeSynthProcessor.h b/src/surge-xt/SurgeSynthProcessor.h index 232bd32cf00..9e8e6521c14 100644 --- a/src/surge-xt/SurgeSynthProcessor.h +++ b/src/surge-xt/SurgeSynthProcessor.h @@ -161,6 +161,7 @@ struct SurgeParamToJuceParamAdapter : SurgeBaseParam { s->applyParameterMonophonicModulation(p, value); } + #endif }; @@ -393,6 +394,13 @@ class SurgeSynthProcessor : public juce::AudioProcessor, info->flags = CLAP_VOICE_INFO_SUPPORTS_OVERLAPPING_NOTES; return true; } + bool supportsRemoteControls() const noexcept override { return true; } + uint32_t remoteControlsPageCount() noexcept override; + bool + remoteControlsPageFill(uint32_t /*pageIndex*/, juce::String & /*sectionName*/, + uint32_t & /*pageID*/, juce::String & /*pageName*/, + std::array + & /*params*/) noexcept override; #endif private: