Browse Source

Tweak mini variant build to allow standalone

Signed-off-by: falkTX <falktx@falktx.com>
tags/23.02
falkTX 2 years ago
parent
commit
ca5bfd6270
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
26 changed files with 171 additions and 168 deletions
  1. +4
    -76
      .github/workflows/build.yml
  2. +0
    -19
      src/CardinalMini/CardinalCommon.cpp
  3. +1
    -0
      src/CardinalMini/CardinalCommon.cpp
  4. +1
    -5
      src/CardinalMini/DistrhoPluginInfo.h
  5. +0
    -1
      src/CardinalMini/Makefile
  6. +0
    -0
      src/CardinalMiniSep/CardinalCommon-UI.cpp
  7. +19
    -0
      src/CardinalMiniSep/CardinalCommon.cpp
  8. +1
    -0
      src/CardinalMiniSep/CardinalPlugin.cpp
  9. +1
    -0
      src/CardinalMiniSep/CardinalRemote.cpp
  10. +1
    -0
      src/CardinalMiniSep/CardinalUI.cpp
  11. +56
    -0
      src/CardinalMiniSep/DistrhoPluginInfo.h
  12. +11
    -0
      src/CardinalMiniSep/Makefile
  13. +1
    -0
      src/CardinalMiniSep/MenuBar.cpp
  14. +1
    -0
      src/CardinalMiniSep/RemoteNanoVG.cpp
  15. +1
    -0
      src/CardinalMiniSep/RemoteWindow.cpp
  16. +1
    -0
      src/CardinalMiniSep/Window.cpp
  17. +1
    -0
      src/CardinalMiniSep/common.cpp
  18. +1
    -0
      src/CardinalMiniSep/glfw.cpp
  19. +30
    -30
      src/CardinalPlugin.cpp
  20. +6
    -6
      src/CardinalRemote.cpp
  21. +7
    -7
      src/CardinalUI.cpp
  22. +4
    -2
      src/Makefile
  23. +13
    -16
      src/Makefile.cardinal.mk
  24. +2
    -0
      src/PluginContext.hpp
  25. +5
    -5
      src/override/MenuBar.cpp
  26. +3
    -1
      src/override/Scene.cpp

+ 4
- 76
.github/workflows/build.yml View File

@@ -814,7 +814,11 @@ jobs:
run: | run: |
VERSION=$(cat Makefile | awk 'sub("VERSION = ","")') VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
cd bin cd bin
sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
mv CardinalMini.data CardinalMini-v${VERSION}.data
mv CardinalMini.js CardinalMini-v${VERSION}.js
mv CardinalMini.wasm CardinalMini-v${VERSION}.wasm
mv CardinalNative.data CardinalNative-v${VERSION}.data mv CardinalNative.data CardinalNative-v${VERSION}.data
mv CardinalNative.js CardinalNative-v${VERSION}.js mv CardinalNative.js CardinalNative-v${VERSION}.js
mv CardinalNative.wasm CardinalNative-v${VERSION}.wasm mv CardinalNative.wasm CardinalNative-v${VERSION}.wasm
@@ -844,82 +848,6 @@ jobs:
files: | files: |
*.zip *.zip


wasm-mini:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up cache
id: cache
uses: actions/cache@v3
with:
path: |
~/emsdk
src/Rack/dep/bin
src/Rack/dep/include
src/Rack/dep/lib
src/Rack/dep/share
src/Rack/dep/jansson-2.12
src/Rack/dep/libarchive-3.4.3
src/Rack/dep/libsamplerate-0.1.9
src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
src/Rack/dep/zstd-1.4.5
key: wasm-mini-v${{ env.CACHE_VERSION }}
- name: Set up dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -yqq brotli
sudo apt-get clean
[ -e ~/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
cd ~/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }}
- name: Build wasm-mini cross-compiled
env:
AR: emar
CC: emcc
CXX: em++
NM: emnm
RANLIB: emranlib
STRIP: emstrip
WITH_LTO: false
run: |
source ~/emsdk/emsdk_env.sh
make features
make CIBUILD=true NOPLUGINS=true NOOPT=true NOSIMD=true STATIC_BUILD=true USE_GLES2=true -j $(nproc)
- name: Make wasm versioned and compress
run: |
VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
cd bin
rm -r *.lv2
sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
mv CardinalNative.data CardinalNative-v${VERSION}.data
mv CardinalNative.js CardinalNative-v${VERSION}.js
mv CardinalNative.wasm CardinalNative-v${VERSION}.wasm
brotli -k -q 11 *.data *.html *.js *.wasm
- name: Set sha8 (non-release)
if: startsWith(github.ref, 'refs/tags/') != true
run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
- name: Set sha8 (release)
if: startsWith(github.ref, 'refs/tags/')
run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
- name: Pack binaries
run: |
cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-mini-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls *.br *.html *.data *.js *.wasm)
- uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-wasm-mini-${{ github.event.pull_request.number || env.SHA8 }}
path: |
*.zip
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: false
prerelease: false
files: |
*.zip

win32: win32:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:


+ 0
- 19
src/CardinalMini/CardinalCommon.cpp View File

@@ -1,19 +0,0 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/

#define CARDINAL_COMMON_DSP_ONLY
#include "../CardinalCommon.cpp"

+ 1
- 0
src/CardinalMini/CardinalCommon.cpp View File

@@ -0,0 +1 @@
../CardinalCommon.cpp

+ 1
- 5
src/CardinalMini/DistrhoPluginInfo.h View File

@@ -35,7 +35,7 @@
#define DISTRHO_PLUGIN_LABEL "CardinalMini" #define DISTRHO_PLUGIN_LABEL "CardinalMini"


#define DISTRHO_PLUGIN_HAS_UI 1 #define DISTRHO_PLUGIN_HAS_UI 1
#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 1
#define DISTRHO_UI_FILE_BROWSER 1 #define DISTRHO_UI_FILE_BROWSER 1
#define DISTRHO_UI_USE_NANOVG 1 #define DISTRHO_UI_USE_NANOVG 1
#define DISTRHO_UI_USER_RESIZABLE 1 #define DISTRHO_UI_USER_RESIZABLE 1
@@ -52,8 +52,4 @@
#define DISTRHO_PLUGIN_LV2_CATEGORY "mod:ControlVoltagePlugin, lv2:UtilityPlugin" #define DISTRHO_PLUGIN_LV2_CATEGORY "mod:ControlVoltagePlugin, lv2:UtilityPlugin"
#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Generator" #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Generator"


// #ifdef __MOD_DEVICES__
# define DISTRHO_PLUGIN_USES_MODGUI 1
// #endif

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

+ 0
- 1
src/CardinalMini/Makefile View File

@@ -5,5 +5,4 @@
# #


NAME = CardinalMini NAME = CardinalMini
MODGUI_CLASS_NAME = distrho_cardinal_mini
include ../Makefile.cardinal.mk include ../Makefile.cardinal.mk

src/CardinalMini/CardinalCommon-UI.cpp → src/CardinalMiniSep/CardinalCommon-UI.cpp View File


+ 19
- 0
src/CardinalMiniSep/CardinalCommon.cpp View File

@@ -0,0 +1,19 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/

#define CARDINAL_COMMON_DSP_ONLY
#include "../CardinalCommon.cpp"

+ 1
- 0
src/CardinalMiniSep/CardinalPlugin.cpp View File

@@ -0,0 +1 @@
../CardinalPlugin.cpp

+ 1
- 0
src/CardinalMiniSep/CardinalRemote.cpp View File

@@ -0,0 +1 @@
../CardinalRemote.cpp

+ 1
- 0
src/CardinalMiniSep/CardinalUI.cpp View File

@@ -0,0 +1 @@
../CardinalUI.cpp

+ 56
- 0
src/CardinalMiniSep/DistrhoPluginInfo.h View File

@@ -0,0 +1,56 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/

#ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED
#define DISTRHO_PLUGIN_INFO_H_INCLUDED

#define CARDINAL_VARIANT_MAIN 0
#define CARDINAL_VARIANT_MINI 1
#define CARDINAL_VARIANT_FX 0
#define CARDINAL_VARIANT_NATIVE 0
#define CARDINAL_VARIANT_SYNTH 0

#define CARDINAL_NUM_AUDIO_INPUTS 2
#define CARDINAL_NUM_AUDIO_OUTPUTS 2

#define DISTRHO_PLUGIN_BRAND "DISTRHO"
#define DISTRHO_PLUGIN_URI "https://distrho.kx.studio/plugins/cardinal#mini"

#define DISTRHO_PLUGIN_NAME "Cardinal Mini"
#define DISTRHO_PLUGIN_LABEL "CardinalMini"

#define DISTRHO_PLUGIN_HAS_UI 1
#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
#define DISTRHO_UI_FILE_BROWSER 1
#define DISTRHO_UI_USE_NANOVG 1
#define DISTRHO_UI_USER_RESIZABLE 1
#define DISTRHO_UI_DEFAULT_WIDTH 1000
#define DISTRHO_UI_DEFAULT_HEIGHT 600
#define DISTRHO_PLUGIN_IS_SYNTH 0
#define DISTRHO_PLUGIN_NUM_INPUTS CARDINAL_NUM_AUDIO_INPUTS + 5
#define DISTRHO_PLUGIN_NUM_OUTPUTS CARDINAL_NUM_AUDIO_OUTPUTS + 5
#define DISTRHO_PLUGIN_WANT_MIDI_INPUT 1
#define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1
#define DISTRHO_PLUGIN_WANT_FULL_STATE 1
#define DISTRHO_PLUGIN_WANT_STATE 1
#define DISTRHO_PLUGIN_WANT_TIMEPOS 1
#define DISTRHO_PLUGIN_LV2_CATEGORY "mod:ControlVoltagePlugin, lv2:UtilityPlugin"

#define DISTRHO_PLUGIN_USES_MODGUI 1
#define DISTRHO_PLUGIN_USES_CUSTOM_MODGUI 1

#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

+ 11
- 0
src/CardinalMiniSep/Makefile View File

@@ -0,0 +1,11 @@
#!/usr/bin/make -f
# Makefile for DISTRHO Plugins #
# ---------------------------- #
# Created by falkTX
#

NAME = CardinalMini
DPF_BUILD_DIR = ../../build/$(NAME)-sep
DSP_UI_SPLIT = true
MODGUI_CLASS_NAME = distrho_cardinal_mini
include ../Makefile.cardinal.mk

+ 1
- 0
src/CardinalMiniSep/MenuBar.cpp View File

@@ -0,0 +1 @@
../override/MenuBar.cpp

+ 1
- 0
src/CardinalMiniSep/RemoteNanoVG.cpp View File

@@ -0,0 +1 @@
../custom/RemoteNanoVG.cpp

+ 1
- 0
src/CardinalMiniSep/RemoteWindow.cpp View File

@@ -0,0 +1 @@
../custom/RemoteWindow.cpp

+ 1
- 0
src/CardinalMiniSep/Window.cpp View File

@@ -0,0 +1 @@
../override/Window.cpp

+ 1
- 0
src/CardinalMiniSep/common.cpp View File

@@ -0,0 +1 @@
../override/common.cpp

+ 1
- 0
src/CardinalMiniSep/glfw.cpp View File

@@ -0,0 +1 @@
../custom/glfw.cpp

+ 30
- 30
src/CardinalPlugin.cpp View File

@@ -61,7 +61,7 @@
extern const std::string CARDINAL_VERSION; extern const std::string CARDINAL_VERSION;
namespace rack { namespace rack {
#if CARDINAL_VARIANT_MINI || defined(HEADLESS)
#if (CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS) || defined(HEADLESS)
namespace app { namespace app {
rack::widget::Widget* createMenuBar() { return new rack::widget::Widget; } rack::widget::Widget* createMenuBar() { return new rack::widget::Widget; }
} }
@@ -179,7 +179,7 @@ class CardinalPlugin : public CardinalBasePlugin
// real values, not VCV interpreted ones // real values, not VCV interpreted ones
float fWindowParameters[kWindowParameterCount]; float fWindowParameters[kWindowParameterCount];
#endif #endif
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
float fMiniReportValues[kCardinalParameterCountAtMini - kCardinalParameterStartMini]; float fMiniReportValues[kCardinalParameterCountAtMini - kCardinalParameterStartMini];
#endif #endif
@@ -213,7 +213,7 @@ public:
fWindowParameters[kWindowParameterInvertZoom] = 0.0f; fWindowParameters[kWindowParameterInvertZoom] = 0.0f;
fWindowParameters[kWindowParameterSqueezeModulePositions] = 1.0f; fWindowParameters[kWindowParameterSqueezeModulePositions] = 1.0f;
#endif #endif
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
std::memset(fMiniReportValues, 0, sizeof(fMiniReportValues)); std::memset(fMiniReportValues, 0, sizeof(fMiniReportValues));
fMiniReportValues[kCardinalParameterMiniTimeBar - kCardinalParameterStartMini] = 1; fMiniReportValues[kCardinalParameterMiniTimeBar - kCardinalParameterStartMini] = 1;
fMiniReportValues[kCardinalParameterMiniTimeBeat - kCardinalParameterStartMini] = 1; fMiniReportValues[kCardinalParameterMiniTimeBeat - kCardinalParameterStartMini] = 1;
@@ -460,7 +460,7 @@ protected:
parameter.name = "Show tooltips"; parameter.name = "Show tooltips";
parameter.symbol = "tooltips"; parameter.symbol = "tooltips";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean; parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 1.0f; parameter.ranges.def = 1.0f;
@@ -472,7 +472,7 @@ protected:
parameter.symbol = "cableOpacity"; parameter.symbol = "cableOpacity";
parameter.unit = "%"; parameter.unit = "%";
parameter.hints = kParameterIsAutomatable; parameter.hints = kParameterIsAutomatable;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 50.0f; parameter.ranges.def = 50.0f;
@@ -484,7 +484,7 @@ protected:
parameter.symbol = "cableTension"; parameter.symbol = "cableTension";
parameter.unit = "%"; parameter.unit = "%";
parameter.hints = kParameterIsAutomatable; parameter.hints = kParameterIsAutomatable;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 75.0f; parameter.ranges.def = 75.0f;
@@ -496,7 +496,7 @@ protected:
parameter.symbol = "rackBrightness"; parameter.symbol = "rackBrightness";
parameter.unit = "%"; parameter.unit = "%";
parameter.hints = kParameterIsAutomatable; parameter.hints = kParameterIsAutomatable;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 100.0f; parameter.ranges.def = 100.0f;
@@ -508,7 +508,7 @@ protected:
parameter.symbol = "haloBrightness"; parameter.symbol = "haloBrightness";
parameter.unit = "%"; parameter.unit = "%";
parameter.hints = kParameterIsAutomatable; parameter.hints = kParameterIsAutomatable;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 25.0f; parameter.ranges.def = 25.0f;
@@ -519,7 +519,7 @@ protected:
parameter.name = "Knob mode"; parameter.name = "Knob mode";
parameter.symbol = "knobMode"; parameter.symbol = "knobMode";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger; parameter.hints = kParameterIsAutomatable|kParameterIsInteger;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 0.0f; parameter.ranges.def = 0.0f;
@@ -539,7 +539,7 @@ protected:
parameter.name = "Scroll wheel knob control"; parameter.name = "Scroll wheel knob control";
parameter.symbol = "knobScroll"; parameter.symbol = "knobScroll";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean; parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 0.0f; parameter.ranges.def = 0.0f;
@@ -550,7 +550,7 @@ protected:
parameter.name = "Scroll wheel knob sensitivity"; parameter.name = "Scroll wheel knob sensitivity";
parameter.symbol = "knobScrollSensitivity"; parameter.symbol = "knobScrollSensitivity";
parameter.hints = kParameterIsAutomatable|kParameterIsLogarithmic; parameter.hints = kParameterIsAutomatable|kParameterIsLogarithmic;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 1.0f; parameter.ranges.def = 1.0f;
@@ -561,7 +561,7 @@ protected:
parameter.name = "Lock module positions"; parameter.name = "Lock module positions";
parameter.symbol = "lockModules"; parameter.symbol = "lockModules";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean; parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 0.0f; parameter.ranges.def = 0.0f;
@@ -572,7 +572,7 @@ protected:
parameter.name = "Update rate limit"; parameter.name = "Update rate limit";
parameter.symbol = "rateLimit"; parameter.symbol = "rateLimit";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger; parameter.hints = kParameterIsAutomatable|kParameterIsInteger;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 0.0f; parameter.ranges.def = 0.0f;
@@ -592,7 +592,7 @@ protected:
parameter.name = "Browser sort"; parameter.name = "Browser sort";
parameter.symbol = "browserSort"; parameter.symbol = "browserSort";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger; parameter.hints = kParameterIsAutomatable|kParameterIsInteger;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 3.0f; parameter.ranges.def = 3.0f;
@@ -618,7 +618,7 @@ protected:
parameter.name = "Browser zoom"; parameter.name = "Browser zoom";
parameter.symbol = "browserZoom"; parameter.symbol = "browserZoom";
parameter.hints = kParameterIsAutomatable; parameter.hints = kParameterIsAutomatable;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.unit = "%"; parameter.unit = "%";
@@ -647,7 +647,7 @@ protected:
parameter.name = "Invert zoom"; parameter.name = "Invert zoom";
parameter.symbol = "invertZoom"; parameter.symbol = "invertZoom";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean; parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 0.0f; parameter.ranges.def = 0.0f;
@@ -658,7 +658,7 @@ protected:
parameter.name = "Auto-squeeze module positions"; parameter.name = "Auto-squeeze module positions";
parameter.symbol = "squeezeModules"; parameter.symbol = "squeezeModules";
parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean; parameter.hints = kParameterIsAutomatable|kParameterIsInteger|kParameterIsBoolean;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
parameter.hints |= kParameterIsHidden; parameter.hints |= kParameterIsHidden;
#endif #endif
parameter.ranges.def = 1.0f; parameter.ranges.def = 1.0f;
@@ -669,7 +669,7 @@ protected:
} }
#endif #endif
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
switch (index) switch (index)
{ {
case kCardinalParameterMiniAudioIn1: case kCardinalParameterMiniAudioIn1:
@@ -817,7 +817,7 @@ protected:
switch (index) switch (index)
{ {
case kCardinalStatePatch: case kCardinalStatePatch:
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
state.hints = kStateIsHostReadable; state.hints = kStateIsHostReadable;
#else #else
state.hints = kStateIsOnlyForDSP | kStateIsBase64Blob; state.hints = kStateIsOnlyForDSP | kStateIsBase64Blob;
@@ -833,7 +833,7 @@ protected:
if (std::fread(fileContent, fileSize, 1, f) == 1) if (std::fread(fileContent, fileSize, 1, f) == 1)
{ {
fileContent[fileSize] = '\0'; fileContent[fileSize] = '\0';
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
state.defaultValue = fileContent; state.defaultValue = fileContent;
#else #else
state.defaultValue = String::asBase64(fileContent, fileSize); state.defaultValue = String::asBase64(fileContent, fileSize);
@@ -859,7 +859,7 @@ protected:
break; break;
#if CARDINAL_VARIANT_MINI || !defined(HEADLESS) #if CARDINAL_VARIANT_MINI || !defined(HEADLESS)
case kCardinalStateModuleInfos: case kCardinalStateModuleInfos:
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
state.hints = kStateIsHostReadable; state.hints = kStateIsHostReadable;
#else #else
state.hints = kStateIsOnlyForDSP; state.hints = kStateIsOnlyForDSP;
@@ -875,7 +875,7 @@ protected:
state.label = "Window size"; state.label = "Window size";
break; break;
#endif #endif
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
case kCardinalStateParamChange: case kCardinalStateParamChange:
state.hints = kStateIsHostReadable | kStateIsOnlyForDSP; state.hints = kStateIsHostReadable | kStateIsOnlyForDSP;
state.key = "param"; state.key = "param";
@@ -903,7 +903,7 @@ protected:
return fWindowParameters[index - kCardinalParameterStartWindow]; return fWindowParameters[index - kCardinalParameterStartWindow];
#endif #endif
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
if (index < kCardinalParameterCountAtMini) if (index < kCardinalParameterCountAtMini)
return fMiniReportValues[index - kCardinalParameterStartMini]; return fMiniReportValues[index - kCardinalParameterStartMini];
#endif #endif
@@ -1006,7 +1006,7 @@ protected:
context->patch->cleanAutosave(); context->patch->cleanAutosave();
// context->history->setSaved(); // context->history->setSaved();
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
FILE* const f = std::fopen(rack::system::join(context->patch->autosavePath, "patch.json").c_str(), "r"); FILE* const f = std::fopen(rack::system::join(context->patch->autosavePath, "patch.json").c_str(), "r");
DISTRHO_SAFE_ASSERT_RETURN(f != nullptr, String()); DISTRHO_SAFE_ASSERT_RETURN(f != nullptr, String());
@@ -1037,7 +1037,7 @@ protected:
void setState(const char* const key, const char* const value) override void setState(const char* const key, const char* const value) override
{ {
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
if (std::strcmp(key, "param") == 0) if (std::strcmp(key, "param") == 0)
{ {
long long moduleId = 0; long long moduleId = 0;
@@ -1115,7 +1115,7 @@ protected:
if (fAutosavePath.empty()) if (fAutosavePath.empty())
return; return;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
rack::system::removeRecursively(fAutosavePath); rack::system::removeRecursively(fAutosavePath);
rack::system::createDirectories(fAutosavePath); rack::system::createDirectories(fAutosavePath);
@@ -1228,7 +1228,7 @@ protected:
context->ticksPerClock = timePos.bbt.ticksPerBeat / timePos.bbt.beatType; context->ticksPerClock = timePos.bbt.ticksPerBeat / timePos.bbt.beatType;
context->ticksPerFrame = 1.0 / samplesPerTick; context->ticksPerFrame = 1.0 / samplesPerTick;
context->tickClock = std::fmod(timePos.bbt.tick, context->ticksPerClock); context->tickClock = std::fmod(timePos.bbt.tick, context->ticksPerClock);
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
fMiniReportValues[kCardinalParameterMiniTimeBar - kCardinalParameterStartMini] = timePos.bbt.bar; fMiniReportValues[kCardinalParameterMiniTimeBar - kCardinalParameterStartMini] = timePos.bbt.bar;
fMiniReportValues[kCardinalParameterMiniTimeBeat - kCardinalParameterStartMini] = timePos.bbt.beat; fMiniReportValues[kCardinalParameterMiniTimeBeat - kCardinalParameterStartMini] = timePos.bbt.beat;
fMiniReportValues[kCardinalParameterMiniTimeBeatsPerBar - kCardinalParameterStartMini] = timePos.bbt.beatsPerBar; fMiniReportValues[kCardinalParameterMiniTimeBeatsPerBar - kCardinalParameterStartMini] = timePos.bbt.beatsPerBar;
@@ -1243,7 +1243,7 @@ protected:
context->reset = reset; context->reset = reset;
fNextExpectedFrame = timePos.playing ? timePos.frame + frames : 0; fNextExpectedFrame = timePos.playing ? timePos.frame + frames : 0;
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
const int flags = (timePos.playing ? 0x1 : 0x0) const int flags = (timePos.playing ? 0x1 : 0x0)
| (timePos.bbt.valid ? 0x2 : 0x0) | (timePos.bbt.valid ? 0x2 : 0x0)
| (reset ? 0x4 : 0x0); | (reset ? 0x4 : 0x0);
@@ -1286,10 +1286,10 @@ protected:
std::memset(outputs[i], 0, sizeof(float)*frames); std::memset(outputs[i], 0, sizeof(float)*frames);
} }
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
for (int i=0; i<DISTRHO_PLUGIN_NUM_INPUTS; ++i) for (int i=0; i<DISTRHO_PLUGIN_NUM_INPUTS; ++i)
fMiniReportValues[i] = context->dataIns[i][0]; fMiniReportValues[i] = context->dataIns[i][0];
#endif
#endif
if (bypassed) if (bypassed)
{ {


+ 6
- 6
src/CardinalRemote.cpp View File

@@ -28,11 +28,11 @@
#include "extra/Base64.hpp" #include "extra/Base64.hpp"
#include "extra/ScopedSafeLocale.hpp" #include "extra/ScopedSafeLocale.hpp"


#if defined(STATIC_BUILD) || CARDINAL_VARIANT_MINI
#if defined(STATIC_BUILD) || ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
# undef HAVE_LIBLO # undef HAVE_LIBLO
#endif #endif


#if (CARDINAL_VARIANT_MINI || defined(HAVE_LIBLO)) && !defined(HEADLESS)
#if (defined(HAVE_LIBLO) || ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS) && !defined(HEADLESS)
# define CARDINAL_REMOTE_ENABLED # define CARDINAL_REMOTE_ENABLED
#endif #endif


@@ -88,7 +88,7 @@ bool connectToRemote()


RemoteDetails* remoteDetails = ui->remoteDetails; RemoteDetails* remoteDetails = ui->remoteDetails;


#if CARDINAL_VARIANT_MINI
#if ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
if (remoteDetails == nullptr) if (remoteDetails == nullptr)
{ {
ui->remoteDetails = remoteDetails = new RemoteDetails; ui->remoteDetails = remoteDetails = new RemoteDetails;
@@ -148,7 +148,7 @@ void idleRemote(RemoteDetails* const remote)
void sendParamChangeToRemote(RemoteDetails* const remote, int64_t moduleId, int paramId, float value) void sendParamChangeToRemote(RemoteDetails* const remote, int64_t moduleId, int paramId, float value)
{ {
#ifdef CARDINAL_REMOTE_ENABLED #ifdef CARDINAL_REMOTE_ENABLED
#if CARDINAL_VARIANT_MINI
#if ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
char paramBuf[512] = {}; char paramBuf[512] = {};
{ {
const ScopedSafeLocale cssl; const ScopedSafeLocale cssl;
@@ -179,7 +179,7 @@ void sendFullPatchToRemote(RemoteDetails* const remote)
std::vector<uint8_t> data; std::vector<uint8_t> data;
using namespace rack::system; using namespace rack::system;


#if CARDINAL_VARIANT_MINI
#if ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
FILE* const f = std::fopen(join(context->patch->autosavePath, "patch.json").c_str(), "r"); FILE* const f = std::fopen(join(context->patch->autosavePath, "patch.json").c_str(), "r");
DISTRHO_SAFE_ASSERT_RETURN(f != nullptr,); DISTRHO_SAFE_ASSERT_RETURN(f != nullptr,);


@@ -221,7 +221,7 @@ void sendFullPatchToRemote(RemoteDetails* const remote)


void sendScreenshotToRemote(RemoteDetails*, const char* const screenshot) void sendScreenshotToRemote(RemoteDetails*, const char* const screenshot)
{ {
#if defined(HAVE_LIBLO) && ! CARDINAL_VARIANT_MINI
#if defined(HAVE_LIBLO) && DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, CARDINAL_DEFAULT_REMOTE_HOST_PORT); const lo_address addr = lo_address_new_with_proto(LO_UDP, REMOTE_HOST, CARDINAL_DEFAULT_REMOTE_HOST_PORT);
DISTRHO_SAFE_ASSERT_RETURN(addr != nullptr,); DISTRHO_SAFE_ASSERT_RETURN(addr != nullptr,);




+ 7
- 7
src/CardinalUI.cpp View File

@@ -346,7 +346,7 @@ public:
{ {
rack::contextSet(context); rack::contextSet(context);


#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
// create unique temporary path for this instance // create unique temporary path for this instance
try { try {
char uidBuf[24]; char uidBuf[24];
@@ -490,7 +490,7 @@ public:
context->tlw = nullptr; context->tlw = nullptr;
context->ui = nullptr; context->ui = nullptr;


#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
{ {
const ScopedContext sc(this); const ScopedContext sc(this);
context->patch->clear(); context->patch->clear();
@@ -620,7 +620,7 @@ public:
filebrowserhandle = nullptr; filebrowserhandle = nullptr;
} }


#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
{ {
const ScopedContext sc(this); const ScopedContext sc(this);
for (uint32_t i=0; i<DISTRHO_PLUGIN_NUM_OUTPUTS;++i) for (uint32_t i=0; i<DISTRHO_PLUGIN_NUM_OUTPUTS;++i)
@@ -726,7 +726,7 @@ protected:
// host mapped parameters // host mapped parameters
if (index < kCardinalParameterCountAtModules) if (index < kCardinalParameterCountAtModules)
{ {
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
context->parameters[index] = value; context->parameters[index] = value;
#endif #endif
return; return;
@@ -735,7 +735,7 @@ protected:
// bypass // bypass
if (index == kCardinalParameterBypass) if (index == kCardinalParameterBypass)
{ {
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
context->bypassed = value > 0.5f; context->bypassed = value > 0.5f;
#endif #endif
return; return;
@@ -829,7 +829,7 @@ protected:
return; return;
} }


#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
if (index < kCardinalParameterCountAtMiniBuffers) if (index < kCardinalParameterCountAtMiniBuffers)
{ {
float* const buffer = *const_cast<float**>(&context->dataIns[index - kCardinalParameterStartMiniBuffers]); float* const buffer = *const_cast<float**>(&context->dataIns[index - kCardinalParameterStartMiniBuffers]);
@@ -886,7 +886,7 @@ protected:


void stateChanged(const char* const key, const char* const value) override void stateChanged(const char* const key, const char* const value) override
{ {
#if CARDINAL_VARIANT_MINI
#if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
if (std::strcmp(key, "patch") == 0) if (std::strcmp(key, "patch") == 0)
{ {
if (fAutosavePath.empty()) if (fAutosavePath.empty())


+ 4
- 2
src/Makefile View File

@@ -244,12 +244,14 @@ all: $(TARGETS)
ifeq ($(MOD_BUILD),true) ifeq ($(MOD_BUILD),true)
$(MAKE) -C Cardinal lv2 $(MAKE) -C Cardinal lv2
$(MAKE) -C CardinalFX lv2 $(MAKE) -C CardinalFX lv2
$(MAKE) -C CardinalMini lv2_sep
$(MAKE) -C CardinalMiniSep lv2_sep
else ifeq ($(WASM),true) else ifeq ($(WASM),true)
$(MAKE) -C CardinalNative $(MAKE) -C CardinalNative
$(MAKE) -C CardinalMini
else else
$(MAKE) -C Cardinal $(MAKE) -C Cardinal
$(MAKE) -C CardinalMini $(MAKE) -C CardinalMini
$(MAKE) -C CardinalMiniSep
$(MAKE) -C CardinalNative $(MAKE) -C CardinalNative
$(MAKE) -C CardinalFX $(CARDINAL_FX_ARGS) $(MAKE) -C CardinalFX $(CARDINAL_FX_ARGS)
$(MAKE) -C CardinalSynth $(CARDINAL_SYNTH_ARGS) $(MAKE) -C CardinalSynth $(CARDINAL_SYNTH_ARGS)
@@ -265,7 +267,7 @@ lv2: $(TARGETS)
$(MAKE) lv2 -C Cardinal $(MAKE) lv2 -C Cardinal
$(MAKE) lv2 -C CardinalFX $(CARDINAL_FX_ARGS) $(MAKE) lv2 -C CardinalFX $(CARDINAL_FX_ARGS)
$(MAKE) lv2 -C CardinalSynth $(CARDINAL_SYNTH_ARGS) $(MAKE) lv2 -C CardinalSynth $(CARDINAL_SYNTH_ARGS)
$(MAKE) lv2_sep -C CardinalMini
$(MAKE) lv2_sep -C CardinalMiniSep


vst2: $(TARGETS) vst2: $(TARGETS)
$(MAKE) vst2 -C CardinalFX $(CARDINAL_FX_ARGS) $(MAKE) vst2 -C CardinalFX $(CARDINAL_FX_ARGS)


+ 13
- 16
src/Makefile.cardinal.mk View File

@@ -67,7 +67,7 @@ WASM_EXCEPTIONS = true
ifeq ($(CARDINAL_VARIANT),main) ifeq ($(CARDINAL_VARIANT),main)
# main variant should not use rtaudio/sdl2 fallback (it has CV ports) # main variant should not use rtaudio/sdl2 fallback (it has CV ports)
SKIP_NATIVE_AUDIO_FALLBACK = true SKIP_NATIVE_AUDIO_FALLBACK = true
else
else ifneq ($(CARDINAL_VARIANT),mini)
# other variants should only use rtaudio/sdl2 fallbacks # other variants should only use rtaudio/sdl2 fallbacks
FORCE_NATIVE_AUDIO_FALLBACK = true FORCE_NATIVE_AUDIO_FALLBACK = true
endif endif
@@ -99,7 +99,7 @@ FILES_DSP += CardinalCommon.cpp
FILES_DSP += CardinalRemote.cpp FILES_DSP += CardinalRemote.cpp
FILES_DSP += common.cpp FILES_DSP += common.cpp


ifeq ($(CARDINAL_VARIANT),mini)
ifeq ($(DSP_UI_SPLIT),true)
FILES_DSP += RemoteNanoVG.cpp FILES_DSP += RemoteNanoVG.cpp
FILES_DSP += RemoteWindow.cpp FILES_DSP += RemoteWindow.cpp
else ifeq ($(HEADLESS),true) else ifeq ($(HEADLESS),true)
@@ -119,18 +119,20 @@ endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# Rack and plugin libs # Rack and plugin libs


ifeq ($(HEADLESS),true)
ifeq ($(DSP_UI_SPLIT),true)
TARGET_SUFFIX = -headless
else ifeq ($(HEADLESS),true)
TARGET_SUFFIX = -headless TARGET_SUFFIX = -headless
endif endif


ifeq ($(CARDINAL_VARIANT),mini) ifeq ($(CARDINAL_VARIANT),mini)
RACK_EXTRA_LIBS = ../../plugins/plugins-mini-headless.a
RACK_EXTRA_LIBS = ../../plugins/plugins-mini$(TARGET_SUFFIX).a
else else
RACK_EXTRA_LIBS = ../../plugins/plugins$(TARGET_SUFFIX).a RACK_EXTRA_LIBS = ../../plugins/plugins$(TARGET_SUFFIX).a
endif endif


ifeq ($(CARDINAL_VARIANT),mini) ifeq ($(CARDINAL_VARIANT),mini)
RACK_EXTRA_LIBS += ../rack-headless.a
RACK_EXTRA_LIBS += ../rack$(TARGET_SUFFIX).a
else else
RACK_EXTRA_LIBS += ../rack$(TARGET_SUFFIX).a RACK_EXTRA_LIBS += ../rack$(TARGET_SUFFIX).a
endif endif
@@ -255,7 +257,7 @@ endif
# -------------------------------------------------------------- # --------------------------------------------------------------
# mini variant UI # mini variant UI


ifeq ($(CARDINAL_VARIANT),mini)
ifeq ($(DSP_UI_SPLIT),true)
ifneq ($(HEADLESS),true) ifneq ($(HEADLESS),true)
FILES_UI = CardinalUI.cpp FILES_UI = CardinalUI.cpp
FILES_UI += CardinalCommon-UI.cpp FILES_UI += CardinalCommon-UI.cpp
@@ -324,13 +326,10 @@ endif
ifeq ($(MOD_BUILD),true) ifeq ($(MOD_BUILD),true)
BASE_FLAGS += -DDISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE=0xffff BASE_FLAGS += -DDISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE=0xffff
BASE_FLAGS += -DDISTRHO_PLUGIN_USES_MODGUI=1 BASE_FLAGS += -DDISTRHO_PLUGIN_USES_MODGUI=1
ifeq ($(CARDINAL_VARIANT),mini)
BASE_FLAGS += -DDISTRHO_PLUGIN_USES_CUSTOM_MODGUI=0
else
BASE_FLAGS += -DDISTRHO_PLUGIN_USES_CUSTOM_MODGUI=1
endif
BASE_FLAGS += -DSIMDE_ENABLE_OPENMP -fopenmp BASE_FLAGS += -DSIMDE_ENABLE_OPENMP -fopenmp
LINK_FLAGS += -fopenmp LINK_FLAGS += -fopenmp
else ifeq ($(CARDINAL_VARIANT),mini)
BUILD_CXX_FLAGS += -DDISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE=0xffff
endif endif


ifneq ($(WASM),true) ifneq ($(WASM),true)
@@ -362,10 +361,6 @@ BUILD_CXX_FLAGS += -std=gnu++17
endif endif
endif endif


ifeq ($(CARDINAL_VARIANT),mini)
BUILD_CXX_FLAGS += -DDISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE=0xffff
endif

# Rack code is not tested for this flag, unset it # Rack code is not tested for this flag, unset it
BUILD_CXX_FLAGS += -U_GLIBCXX_ASSERTIONS -Wp,-U_GLIBCXX_ASSERTIONS BUILD_CXX_FLAGS += -U_GLIBCXX_ASSERTIONS -Wp,-U_GLIBCXX_ASSERTIONS


@@ -504,8 +499,10 @@ BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_PREFIX='"$(PREFIX)"'


ifeq ($(CARDINAL_VARIANT),main) ifeq ($(CARDINAL_VARIANT),main)
TARGETS = jack lv2 vst3 clap TARGETS = jack lv2 vst3 clap
else ifeq ($(CARDINAL_VARIANT),mini)
else ifeq ($(DSP_UI_SPLIT),true)
TARGETS = lv2_sep TARGETS = lv2_sep
else ifeq ($(CARDINAL_VARIANT),mini)
TARGETS = jack
else ifeq ($(CARDINAL_VARIANT),native) else ifeq ($(CARDINAL_VARIANT),native)
TARGETS = jack TARGETS = jack
else else


+ 2
- 0
src/PluginContext.hpp View File

@@ -205,7 +205,9 @@ struct CardinalPluginContext : rack::Context {


// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------


#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
CardinalPluginContext* getRackContextFromPlugin(void* ptr); CardinalPluginContext* getRackContextFromPlugin(void* ptr);
#endif


class CardinalBasePlugin : public Plugin { class CardinalBasePlugin : public Plugin {
public: public:


+ 5
- 5
src/override/MenuBar.cpp View File

@@ -135,7 +135,7 @@ struct FileButton : MenuButton {
patchUtils::loadTemplateDialog(); patchUtils::loadTemplateDialog();
})); }));


#if ! CARDINAL_VARIANT_MINI
#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
#ifndef DISTRHO_OS_WASM #ifndef DISTRHO_OS_WASM
menu->addChild(createMenuItem("Open / Import...", RACK_MOD_CTRL_NAME "+O", []() { menu->addChild(createMenuItem("Open / Import...", RACK_MOD_CTRL_NAME "+O", []() {
patchUtils::loadDialog(); patchUtils::loadDialog();
@@ -172,7 +172,7 @@ struct FileButton : MenuButton {
patchUtils::revertDialog(); patchUtils::revertDialog();
}, APP->patch->path.empty())); }, APP->patch->path.empty()));


#if defined(HAVE_LIBLO) || CARDINAL_VARIANT_MINI
#if defined(HAVE_LIBLO) || ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
#ifdef __MOD_DEVICES__ #ifdef __MOD_DEVICES__
#define REMOTE_NAME "MOD" #define REMOTE_NAME "MOD"
#else #else
@@ -201,7 +201,7 @@ struct FileButton : MenuButton {
} }
#endif #endif


#if ! CARDINAL_VARIANT_MINI
#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
#ifndef DISTRHO_OS_WASM #ifndef DISTRHO_OS_WASM
menu->addChild(new ui::MenuSeparator); menu->addChild(new ui::MenuSeparator);


@@ -768,7 +768,7 @@ struct MeterLabel : ui::Label {
// uiLastTime = time; // uiLastTime = time;
// } // }


#if CARDINAL_VARIANT_MINI
#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
text = string::f("%.1f fps", 1.0 / frameDurationAvg); text = string::f("%.1f fps", 1.0 / frameDurationAvg);
#else #else
double meterAverage = APP->engine->getMeterAverage(); double meterAverage = APP->engine->getMeterAverage();
@@ -807,7 +807,7 @@ struct MenuBar : widget::OpaqueWidget {
viewButton->text = "View"; viewButton->text = "View";
layout->addChild(viewButton); layout->addChild(viewButton);


#if ! CARDINAL_VARIANT_MINI
#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
EngineButton* engineButton = new EngineButton; EngineButton* engineButton = new EngineButton;
engineButton->text = "Engine"; engineButton->text = "Engine";
layout->addChild(engineButton); layout->addChild(engineButton);


+ 3
- 1
src/override/Scene.cpp View File

@@ -330,8 +330,10 @@ void Scene::onHoverKey(const HoverKeyEvent& e) {
} }
if (e.key == GLFW_KEY_F7 && (e.mods & RACK_MOD_MASK) == 0) { if (e.key == GLFW_KEY_F7 && (e.mods & RACK_MOD_MASK) == 0) {
if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote()) if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
{
remoteUtils::sendFullPatchToRemote(remoteDetails); remoteUtils::sendFullPatchToRemote(remoteDetails);
window::generateScreenshot();
window::generateScreenshot();
}
e.consume(this); e.consume(this);
} }
if (e.key == GLFW_KEY_F9 && (e.mods & RACK_MOD_MASK) == 0) { if (e.key == GLFW_KEY_F9 && (e.mods & RACK_MOD_MASK) == 0) {


Loading…
Cancel
Save