diff -Nru carla-2.5.4/data/carla carla-2.5.5/data/carla --- carla-2.5.4/data/carla 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-bridge-lv2-modgui carla-2.5.5/data/carla-bridge-lv2-modgui --- carla-2.5.4/data/carla-bridge-lv2-modgui 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-bridge-lv2-modgui 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-control carla-2.5.5/data/carla-control --- carla-2.5.4/data/carla-control 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-control 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-database carla-2.5.5/data/carla-database --- carla-2.5.4/data/carla-database 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-database 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-jack-multi carla-2.5.5/data/carla-jack-multi --- carla-2.5.4/data/carla-jack-multi 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-jack-multi 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-jack-patchbayplugin carla-2.5.5/data/carla-jack-patchbayplugin --- carla-2.5.4/data/carla-jack-patchbayplugin 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-jack-patchbayplugin 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ -f "$(dirname ${0})/carla-utils.pc" ]; then cd "$(dirname ${0})/.." diff -Nru carla-2.5.4/data/carla-jack-single carla-2.5.5/data/carla-jack-single --- carla-2.5.4/data/carla-jack-single 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-jack-single 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-libdir carla-2.5.5/data/carla-libdir --- carla-2.5.4/data/carla-libdir 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-libdir 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # small script that only prints carla's libdir. # can be used to detect if carla is installed, and where to find its libcarla_standalone2.so file diff -Nru carla-2.5.4/data/carla-osc-gui carla-2.5.5/data/carla-osc-gui --- carla-2.5.4/data/carla-osc-gui 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-osc-gui 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e diff -Nru carla-2.5.4/data/carla-patchbay carla-2.5.5/data/carla-patchbay --- carla-2.5.4/data/carla-patchbay 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-patchbay 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-rack carla-2.5.5/data/carla-rack --- carla-2.5.4/data/carla-rack 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-rack 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/carla-settings carla-2.5.5/data/carla-settings --- carla-2.5.4/data/carla-settings 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/carla-settings 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PYTHON=$(which python3 2>/dev/null) diff -Nru carla-2.5.4/data/copy-zynaddsubfx carla-2.5.5/data/copy-zynaddsubfx --- carla-2.5.4/data/copy-zynaddsubfx 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/copy-zynaddsubfx 2023-06-04 12:40:25.000000000 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e diff -Nru carla-2.5.4/data/pkgconfig/carla-host-plugin.pc carla-2.5.5/data/pkgconfig/carla-host-plugin.pc --- carla-2.5.4/data/pkgconfig/carla-host-plugin.pc 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/pkgconfig/carla-host-plugin.pc 2023-06-04 12:40:25.000000000 +0000 @@ -7,4 +7,4 @@ Version: X-VERSION-X Description: Carla Host as Native Plugin Libs: -Wl,-rpath,${carla_libdir} -L${carla_libdir} -lcarla_host-plugin -Cflags: -DREAL_BUILD -I${includedir}/carla -I${includedir}/carla/includes +Cflags: -I${includedir}/carla -I${includedir}/carla/includes diff -Nru carla-2.5.4/data/pkgconfig/carla-native-plugin.pc carla-2.5.5/data/pkgconfig/carla-native-plugin.pc --- carla-2.5.4/data/pkgconfig/carla-native-plugin.pc 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/pkgconfig/carla-native-plugin.pc 2023-06-04 12:40:25.000000000 +0000 @@ -6,4 +6,4 @@ Version: X-VERSION-X Description: Carla Native Plugin Libs: -Wl,-rpath,${libdir}/carla -L${libdir}/carla -lcarla_native-plugin -Cflags: -DREAL_BUILD -I${includedir}/carla -I${includedir}/carla/includes +Cflags: -I${includedir}/carla -I${includedir}/carla/includes diff -Nru carla-2.5.4/data/pkgconfig/carla-standalone.pc carla-2.5.5/data/pkgconfig/carla-standalone.pc --- carla-2.5.4/data/pkgconfig/carla-standalone.pc 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/pkgconfig/carla-standalone.pc 2023-06-04 12:40:25.000000000 +0000 @@ -6,4 +6,4 @@ Version: X-VERSION-X Description: Carla Host Standalone Libs: -Wl,-rpath,${libdir}/carla -L${libdir}/carla -lcarla_standalone2 -Cflags: -DREAL_BUILD -I${includedir}/carla -I${includedir}/carla/includes +Cflags: -I${includedir}/carla -I${includedir}/carla/includes diff -Nru carla-2.5.4/data/pkgconfig/carla-utils.pc carla-2.5.5/data/pkgconfig/carla-utils.pc --- carla-2.5.4/data/pkgconfig/carla-utils.pc 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/pkgconfig/carla-utils.pc 2023-06-04 12:40:25.000000000 +0000 @@ -6,4 +6,4 @@ Version: X-VERSION-X Description: Carla Host Utilities Libs: -Wl,-rpath,${libdir}/carla -L${libdir}/carla -lcarla_utils -Cflags: -DREAL_BUILD -I${includedir}/carla -I${includedir}/carla/includes -I${includedir}/carla/utils +Cflags: -I${includedir}/carla -I${includedir}/carla/includes -I${includedir}/carla/utils diff -Nru carla-2.5.4/data/windows/unzipfx-carla/unzipfx/appDetails.h carla-2.5.5/data/windows/unzipfx-carla/unzipfx/appDetails.h --- carla-2.5.4/data/windows/unzipfx-carla/unzipfx/appDetails.h 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/windows/unzipfx-carla/unzipfx/appDetails.h 2023-06-04 12:40:25.000000000 +0000 @@ -2,7 +2,6 @@ #ifndef __APP_DETAILS_H__ #define __APP_DETAILS_H__ -#define REAL_BUILD #include "../../../../source/includes/CarlaDefines.h" #define SFX_APP_MININAME_TITLE "Carla" diff -Nru carla-2.5.4/data/windows/unzipfx-carla-control/unzipfx/appDetails.h carla-2.5.5/data/windows/unzipfx-carla-control/unzipfx/appDetails.h --- carla-2.5.4/data/windows/unzipfx-carla-control/unzipfx/appDetails.h 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/data/windows/unzipfx-carla-control/unzipfx/appDetails.h 2023-06-04 12:40:25.000000000 +0000 @@ -2,7 +2,6 @@ #ifndef __APP_DETAILS_H__ #define __APP_DETAILS_H__ -#define REAL_BUILD #include "../../../../source/includes/CarlaDefines.h" #define SFX_APP_MININAME_TITLE "CarlaControl" diff -Nru carla-2.5.4/debian/changelog carla-2.5.5/debian/changelog --- carla-2.5.4/debian/changelog 2023-04-12 18:36:21.000000000 +0000 +++ carla-2.5.5/debian/changelog 2023-06-05 04:13:47.000000000 +0000 @@ -1,8 +1,26 @@ -carla (2.5.4-0ubuntu2~bpo22.04.1) jammy-backports; urgency=medium +carla (2.5.5-0ubuntu1~bpo22.04.1) jammy-backports; urgency=medium - * No-change backport to jammy. (LP: #2016037) + * No-change backport to jammy (LP: #2022875) - -- Erich Eickmeyer Wed, 12 Apr 2023 11:36:21 -0700 + -- Erich Eickmeyer Sun, 04 Jun 2023 21:13:47 -0700 + +carla (2.5.5-0ubuntu1) mantic; urgency=medium + + [ Erich Eickmeyer ] + * New upstream release 2.5.5 + + [ Filipe Coelho ] + * Allow IPC during plugin discovery (controlled by external tools) + * Expose a few extra APIs in carla-utils library + * Install extra carla-utils related headers during make install + * Fix invalid/empty LV2 paths for compatibility with lilv + * Fix LV2 plugin state for plugin bridges + * Fix showing engine device settings on systems without JACK + * Remove use of REAL_BUILD macro, no longer needed + * Tweaks for integration in OBS + * Other minor fixes and cleanup + + -- Erich Eickmeyer Sun, 04 Jun 2023 16:39:48 -0700 carla (2.5.4-0ubuntu2) lunar; urgency=medium diff -Nru carla-2.5.4/.github/workflows/build.yml carla-2.5.5/.github/workflows/build.yml --- carla-2.5.4/.github/workflows/build.yml 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/.github/workflows/build.yml 2023-06-04 12:40:25.000000000 +0000 @@ -13,72 +13,20 @@ WITH_LTO: false jobs: - macos-10_15: - runs-on: macos-10.15 + macos-11: + runs-on: macos-11 steps: - uses: actions/checkout@v3 - name: Set up dependencies run: | - brew install fluid-synth liblo libmagic libsndfile pkg-config pyqt@5 qt@5 sdl2 + brew install fluid-synth liblo libmagic libsndfile pkg-config sdl2 + # FIXME broken under homebrew for now + # pyqt@5 qt@5 - name: make features run: make features - name: make run: make -j $(sysctl -n hw.logicalcpu) - #msys2-i686: - #runs-on: windows-latest - #defaults: - #run: - #shell: msys2 {0} - #steps: - #- uses: actions/checkout@v3 - #- uses: msys2/setup-msys2@v3 - #with: - #msystem: mingw32 - #install: base-devel make mingw-w64-i686-toolchain mingw-w64-i686-fluidsynth mingw-w64-i686-liblo mingw-w64-i686-libsndfile mingw-w64-i686-pkg-config mingw-w64-i686-python-pyqt5 - #- name: make features - #run: make features - #- name: make - #run: make -j $(nproc) - - #msys2-x86_64: - #runs-on: windows-latest - #defaults: - #run: - #shell: msys2 {0} - #steps: - #- uses: actions/checkout@v3 - #- uses: msys2/setup-msys2@v3 - #with: - #msystem: mingw64 - #install: base-devel make mingw-w64-x86_64-toolchain mingw-w64-x86_64-fluidsynth mingw-w64-x86_64-liblo mingw-w64-x86_64-libsndfile mingw-w64-x86_64-pkg-config mingw-w64-x86_64-python-pyqt5 - #- name: make features - #run: make features - #- name: make - #run: make -j $(nproc) - - ubuntu-18_04: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v3 - - name: Set up dependencies - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo apt-get install -yq libasound2-dev libfluidsynth-dev libgl1-mesa-dev liblo-dev libmagic-dev libpulse-dev libqt4-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev pkg-config pyqt5-dev-tools qtbase5-dev - sudo apt-get install -yq g++-multilib libfreetype6:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 - # Fix 32bit bridge build - sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so - sudo ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so - sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib/i386-linux-gnu/libfreetype.so - sudo ln -s /usr/lib/i386-linux-gnu/libfontconfig.so.1 /usr/lib/i386-linux-gnu/libfontconfig.so - - name: make features - run: make features - - name: make - run: make -j $(nproc) - - name: make posix32 - run: make posix32 -j $(nproc) - ubuntu-20_04: runs-on: ubuntu-20.04 steps: @@ -86,14 +34,13 @@ - name: Fix GitHub's mess run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo dpkg --add-architecture i386 sudo apt-get update -qq sudo apt-get install -yqq --allow-downgrades libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal - name: Set up dependencies run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo apt-get install -yq libasound2-dev libfluidsynth-dev libgl1-mesa-dev liblo-dev libmagic-dev libpulse-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev pkg-config pyqt5-dev-tools qtbase5-dev - sudo apt-get install -yq g++-multilib libfreetype6:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 + sudo apt-get install -yqq libasound2-dev libfluidsynth-dev libgl1-mesa-dev liblo-dev libmagic-dev libpulse-dev libsdl2-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev pkg-config pyqt5-dev-tools qtbase5-dev + sudo apt-get install -yqq g++-multilib libfreetype6:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 # Fix 32bit bridge build sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so sudo ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so @@ -106,51 +53,28 @@ - name: make posix32 run: make posix32 -j $(nproc) - ubuntu-mingw-win32: - runs-on: ubuntu-20.04 - env: - CC: i686-w64-mingw32-gcc - CXX: i686-w64-mingw32-g++ - CROSS_COMPILING: "true" - PKG_CONFIG: "false" + ubuntu-22_04: + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Fix GitHub's mess run: | sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list - sudo apt-get update -qq - sudo apt-get install -yqq --allow-downgrades libgd3/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal - sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libpcre2-posix3 libzip4 - - name: Set up dependencies - run: | sudo dpkg --add-architecture i386 sudo apt-get update -qq - sudo apt-get install -yq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 - - name: make features - run: make features - - name: make - run: make -j $(nproc) - - ubuntu-mingw-win64: - runs-on: ubuntu-20.04 - env: - CC: x86_64-w64-mingw32-gcc - CXX: x86_64-w64-mingw32-g++ - CROSS_COMPILING: "true" - PKG_CONFIG: "false" - steps: - - uses: actions/checkout@v3 - - name: Fix GitHub's mess - run: | - sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list - sudo apt-get update -qq - sudo apt-get install -yqq --allow-downgrades libgd3/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal - sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libpcre2-posix3 libzip4 + sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 - name: Set up dependencies run: | - sudo apt-get update -qq - sudo apt-get install -yq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 + sudo apt-get install -yqq libasound2-dev libfluidsynth-dev libgl1-mesa-dev liblo-dev libmagic-dev libpulse-dev libsdl2-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev pkg-config pyqt5-dev-tools qtbase5-dev + sudo apt-get install -yqq g++-multilib libfreetype6:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 + # Fix 32bit bridge build + sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so + sudo ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so + sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so.6 /usr/lib/i386-linux-gnu/libfreetype.so + sudo ln -s /usr/lib/i386-linux-gnu/libfontconfig.so.1 /usr/lib/i386-linux-gnu/libfontconfig.so - name: make features run: make features - name: make run: make -j $(nproc) + - name: make posix32 + run: make posix32 -j $(nproc) diff -Nru carla-2.5.4/.github/workflows/dpf.yml carla-2.5.5/.github/workflows/dpf.yml --- carla-2.5.4/.github/workflows/dpf.yml 1970-01-01 00:00:00.000000000 +0000 +++ carla-2.5.5/.github/workflows/dpf.yml 2023-06-04 12:40:25.000000000 +0000 @@ -0,0 +1,61 @@ +name: dpf + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + linux: + strategy: + matrix: + target: [linux-x86_64] + # linux-arm64, linux-armhf, linux-i686, linux-riscv64 + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: distrho/dpf-makefile-action@v1 + with: + target: ${{ matrix.target }} + pawpaw: true + release: false + + macos: + strategy: + matrix: + target: [macos-intel, macos-universal] + runs-on: macos-11 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: fake dpf script + run: | + mkdir -p dpf/utils + ln -s $(which ls) dpf/utils/package-osx-bundles.sh + touch carla-macOS.pkg + - uses: distrho/dpf-makefile-action@v1 + with: + target: ${{ matrix.target }} + pawpaw: true + release: false + + windows: + strategy: + matrix: + target: [win32, win64] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: distrho/dpf-makefile-action@v1 + with: + target: ${{ matrix.target }} + pawpaw: true + release: false diff -Nru carla-2.5.4/.github/workflows/release.yml carla-2.5.5/.github/workflows/release.yml --- carla-2.5.4/.github/workflows/release.yml 1970-01-01 00:00:00.000000000 +0000 +++ carla-2.5.5/.github/workflows/release.yml 2023-06-04 12:40:25.000000000 +0000 @@ -0,0 +1,189 @@ +name: release + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +env: + CACHE_VERSION: 1 + PAWPAW_SKIP_LTO: 1 + PAWPAW_VERSION: cd7b760d6a32ecad263b112c12be8a306ed1e89c + +jobs: + # macOS native universal build + macos_universal: + runs-on: macos-11 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up cache + uses: actions/cache@v3 + with: + path: | + ~/PawPawBuilds + key: macos-universal-v${{ env.CACHE_VERSION }} + - name: Set up dependencies + run: | + brew install cmake jq meson + - name: Bootstrap macOS universal + shell: bash + run: | + git clone https://github.com/DISTRHO/PawPaw.git + git -C PawPaw checkout ${{ env.PAWPAW_VERSION }} + ./PawPaw/bootstrap-carla.sh macos-universal && ./PawPaw/.cleanup.sh macos-universal + - name: Build macOS universal + shell: bash + run: | + source PawPaw/local.env macos-universal + make features + make EXTERNAL_PLUGINS=false NOOPT=true ${MAKE_ARGS} + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} -j 1 + - uses: actions/upload-artifact@v3 + with: + name: macOS dmg + path: ./*.dmg + - 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: | + path: ./*.dmg + + # linux with win32 cross-compilation + win32: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up cache + uses: actions/cache@v3 + with: + path: | + ~/PawPawBuilds + key: win32-v${{ env.CACHE_VERSION }} + - name: Restore debian packages cache + run: | + if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \ + sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/; \ + fi + - name: Fix GitHub's mess + run: | + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo dpkg --add-architecture i386 + sudo apt-get update -qq + sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 + - name: Set up dependencies + run: | + sudo apt-get install -y build-essential curl cmake jq meson mingw-w64 gperf qttools5-dev qttools5-dev-tools xvfb \ + binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable + - name: Cache debian packages + run: | + mkdir -p ~/PawPawBuilds/debs + sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/ + - name: Bootstrap win32 cross-compiled + shell: bash + run: | + git clone https://github.com/DISTRHO/PawPaw.git + git -C PawPaw checkout ${{ env.PAWPAW_VERSION }} + ./PawPaw/bootstrap-carla.sh win32 && ./PawPaw/.cleanup.sh win32 + - name: Build win32 cross-compiled + shell: bash + run: | + source PawPaw/local.env win32 + make features + make EXTERNAL_PLUGINS=false NOOPT=true ${MAKE_ARGS} + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} -j 1 + - uses: actions/upload-artifact@v3 + with: + name: win32 zip + 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: | + path: ./*.zip + + # linux with win64 cross-compilation + win64: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up cache + uses: actions/cache@v3 + with: + path: | + ~/PawPawBuilds + key: win64-v${{ env.CACHE_VERSION }} + - name: Restore debian packages cache + run: | + if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \ + sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/; \ + fi + - name: Fix GitHub's mess + run: | + sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list + sudo dpkg --add-architecture i386 + sudo apt-get update -qq + sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 + - name: Set up dependencies + run: | + sudo apt-get install -y build-essential curl cmake jq meson mingw-w64 gperf qttools5-dev qttools5-dev-tools xvfb \ + binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable + - name: Cache debian packages + run: | + mkdir -p ~/PawPawBuilds/debs + sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/ + - name: Bootstrap win64 cross-compiled + shell: bash + run: | + git clone https://github.com/DISTRHO/PawPaw.git + git -C PawPaw checkout ${{ env.PAWPAW_VERSION }} + ./PawPaw/bootstrap-carla.sh win64 && ./PawPaw/.cleanup.sh win64 + - name: Build win64 cross-compiled + shell: bash + run: | + source PawPaw/local.env win64 + make features + make EXTERNAL_PLUGINS=false NOOPT=true ${MAKE_ARGS} + make EXTERNAL_PLUGINS=false NOOPT=true ${MAKE_ARGS} win32r + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} TESTING=true -j 1 + make dist ${MAKE_ARGS} -j 1 + - uses: actions/upload-artifact@v3 + with: + name: win64 zip + 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: | + path: ./*.zip diff -Nru carla-2.5.4/.github/workflows/wine.yml carla-2.5.5/.github/workflows/wine.yml --- carla-2.5.4/.github/workflows/wine.yml 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/.github/workflows/wine.yml 2023-06-04 12:40:25.000000000 +0000 @@ -12,34 +12,6 @@ HOMEBREW_NO_AUTO_UPDATE: 1 jobs: - ubuntu-18_04: - runs-on: ubuntu-18.04 - env: - WINECC: winegcc-stable - WINEDEBUG: "-all" - steps: - - uses: actions/checkout@v3 - - name: Set up dependencies - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo apt-get install -yq g++-multilib libfreetype6-dev libgl1-mesa-dev libx11-dev libxcursor-dev libxext-dev pkg-config wine-stable wine64-tools - sudo apt-get install -yq binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 mingw-w64 - - name: make - run: make -j $(nproc) - #- name: make wine32 - #run: make wine32 -j $(nproc) - - name: make wine64 - run: make wine64 -j $(nproc) - - name: make win32 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ - run: make win32 CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ -j $(nproc) - - name: make win64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ - run: make win64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ -j $(nproc) - - name: make plugin-wine - run: make plugin-wine -j $(nproc) - - name: make plugin-wine CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ - run: make plugin-wine CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ -j $(nproc) - ubuntu-20_04: runs-on: ubuntu-20.04 env: diff -Nru carla-2.5.4/Makefile carla-2.5.5/Makefile --- carla-2.5.4/Makefile 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/Makefile 2023-06-04 12:40:25.000000000 +0000 @@ -23,7 +23,7 @@ endif # see also source/frontend/carla_shared.py and source/includes/CarlaDefines.h -VERSION := 2.5.4 +VERSION := 2.5.5 -include Makefile.user.mk @@ -446,6 +446,7 @@ endif install -d $(DESTDIR)$(LIBDIR)/pkgconfig install -d $(DESTDIR)$(INCLUDEDIR)/carla/includes + install -d $(DESTDIR)$(INCLUDEDIR)/carla/utils ifeq ($(LINUX),true) ifeq ($(HAVE_JACK),true) ifeq ($(JACKBRIDGE_DIRECT),true) @@ -550,8 +551,6 @@ source/backend/CarlaEngine.hpp \ source/backend/CarlaPlugin.hpp \ source/backend/CarlaPluginPtr.hpp \ - source/includes/CarlaNative.h \ - source/includes/CarlaNativePlugin.h \ $(DESTDIR)$(INCLUDEDIR)/carla install -m 644 \ @@ -561,6 +560,26 @@ source/includes/CarlaNativePlugin.h \ $(DESTDIR)$(INCLUDEDIR)/carla/includes + install -m 644 \ + source/utils/CarlaBackendUtils.hpp \ + source/utils/CarlaBase64Utils.hpp \ + source/utils/CarlaBinaryUtils.hpp \ + source/utils/CarlaBridgeDefines.hpp \ + source/utils/CarlaBridgeUtils.hpp \ + source/utils/CarlaMacUtils.hpp \ + source/utils/CarlaMathUtils.hpp \ + source/utils/CarlaMutex.hpp \ + source/utils/CarlaRingBuffer.hpp \ + source/utils/CarlaProcessUtils.hpp \ + source/utils/CarlaRunner.hpp \ + source/utils/CarlaScopeUtils.hpp \ + source/utils/CarlaSemUtils.hpp \ + source/utils/CarlaShmUtils.hpp \ + source/utils/CarlaString.hpp \ + source/utils/CarlaThread.hpp \ + source/utils/CarlaUtils.hpp \ + $(DESTDIR)$(INCLUDEDIR)/carla/utils + # ------------------------------------------------------------------------------------------------------------- ifeq ($(HAVE_PYQT),true) @@ -733,6 +752,10 @@ $(foreach l,$(I18N_LANGUAGES),install -m 644 \ source/frontend/translations/carla_$(l).qm \ $(DESTDIR)$(DATADIR)/carla/resources/translations/;) + + # Link resources for internal plugin + rm -rf $(DESTDIR)$(LIBDIR)/carla/resources + $(LINK) ../../share/carla/resources $(DESTDIR)$(LIBDIR)/carla/resources endif # HAVE_PYQT # ------------------------------------------------------------------------------------------------------------- diff -Nru carla-2.5.4/source/backend/CarlaBackend.doxygen carla-2.5.5/source/backend/CarlaBackend.doxygen --- carla-2.5.4/source/backend/CarlaBackend.doxygen 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/CarlaBackend.doxygen 2023-06-04 12:40:25.000000000 +0000 @@ -242,7 +242,7 @@ INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN \ - BUILDING_CARLA REAL_BUILD \ + BUILDING_CARLA \ HAVE_DGL HAVE_LIBLO HAVE_LIBMAGIC HAVE_FLUIDSYNTH HAVE_PROJECTM HAVE_X11 \ HAVE_ZYN_DEPS HAVE_ZYN_UI_DEPS EXPAND_AS_DEFINED = diff -Nru carla-2.5.4/source/backend/CarlaStandalone.cpp carla-2.5.5/source/backend/CarlaStandalone.cpp --- carla-2.5.4/source/backend/CarlaStandalone.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/CarlaStandalone.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -169,9 +169,9 @@ if (const EngineDriverDeviceInfo* const devInfo = CarlaEngine::getDriverDeviceInfo(index, name)) { - retDevInfo.hints = devInfo->hints; - retDevInfo.bufferSizes = (devInfo->bufferSizes != nullptr) ? devInfo->bufferSizes : nullBufferSizes; - retDevInfo.sampleRates = (devInfo->sampleRates != nullptr) ? devInfo->sampleRates : nullSampleRates; + retDevInfo.hints = devInfo->hints; + retDevInfo.bufferSizes = devInfo->bufferSizes != nullptr ? devInfo->bufferSizes : nullBufferSizes; + retDevInfo.sampleRates = devInfo->sampleRates != nullptr ? devInfo->sampleRates : nullSampleRates; } else { diff -Nru carla-2.5.4/source/backend/engine/CarlaEngineBridge.cpp carla-2.5.5/source/backend/engine/CarlaEngineBridge.cpp --- carla-2.5.4/source/backend/engine/CarlaEngineBridge.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngineBridge.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -112,6 +112,7 @@ fClosingDown(false), fIsOffline(false), fFirstIdle(true), + fBridgeVersion(0), fLastPingTime(-1) { carla_debug("CarlaEngineBridge::CarlaEngineBridge(\"%s\", \"%s\", \"%s\", \"%s\")", audioPoolBaseName, rtClientBaseName, nonRtClientBaseName, nonRtServerBaseName); @@ -336,7 +337,7 @@ return; } - const bool wasFirstIdle(fFirstIdle); + const bool wasFirstIdle = fFirstIdle; if (wasFirstIdle) { @@ -396,6 +397,8 @@ fShmNonRtServerControl.commitWrite(); } + fShmNonRtServerControl.waitIfDataIsReachingLimit(); + // kPluginBridgeNonRtServerAudioCount { const uint32_t aIns = plugin->getAudioInCount(); @@ -790,9 +793,9 @@ break; case kPluginBridgeNonRtClientVersion: { - const uint apiVersion = fShmNonRtServerControl.readUInt(); - CARLA_SAFE_ASSERT_UINT2(apiVersion >= CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM, - apiVersion, CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM); + fBridgeVersion = fShmNonRtServerControl.readUInt(); + CARLA_SAFE_ASSERT_UINT2(fBridgeVersion >= CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM, + fBridgeVersion, CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM); } break; case kPluginBridgeNonRtClientPing: { @@ -878,6 +881,8 @@ } case kPluginBridgeNonRtClientSetCustomData: { + const uint32_t maxLocalValueLen = fBridgeVersion >= 10 ? 4096 : 16384; + // type const uint32_t typeSize = fShmNonRtClientControl.readUInt(); char typeStr[typeSize+1]; @@ -895,7 +900,7 @@ if (valueSize > 0) { - if (valueSize > 16384) + if (valueSize > maxLocalValueLen) { const uint32_t bigValueFilePathSize = fShmNonRtClientControl.readUInt(); char bigValueFilePathTry[bigValueFilePathSize+1]; @@ -1059,6 +1064,8 @@ plugin->prepareForSave(false); + const uint32_t maxLocalValueLen = fBridgeVersion >= 10 ? 4096 : 16384; + for (uint32_t i=0, count=plugin->getCustomDataCount(); igetCustomData(i)); @@ -1070,12 +1077,12 @@ const uint32_t keyLen = static_cast(std::strlen(cdata.key)); const uint32_t valueLen = static_cast(std::strlen(cdata.value)); - if (valueLen > 16384) - fShmNonRtServerControl.waitIfDataIsReachingLimit(); - { const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex); + if (valueLen > maxLocalValueLen) + fShmNonRtServerControl.waitIfDataIsReachingLimit(); + fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerSetCustomData); fShmNonRtServerControl.writeUInt(typeLen); @@ -1088,7 +1095,7 @@ if (valueLen > 0) { - if (valueLen > 16384) + if (valueLen > maxLocalValueLen) { String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); @@ -1114,9 +1121,8 @@ } fShmNonRtServerControl.commitWrite(); + fShmNonRtServerControl.waitIfDataIsReachingLimit(); } - - fShmNonRtServerControl.waitIfDataIsReachingLimit(); } if (plugin->getOptionsEnabled() & PLUGIN_OPTION_USE_CHUNKS) @@ -1239,6 +1245,10 @@ signalThreadShouldExit(); callback(true, true, ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); break; + + case kPluginBridgeNonRtClientReload: + fFirstIdle = true; + break; } } } @@ -1648,6 +1658,7 @@ bool fClosingDown; bool fIsOffline; bool fFirstIdle; + uint32_t fBridgeVersion; int64_t fLastPingTime; CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaEngineBridge) diff -Nru carla-2.5.4/source/backend/engine/CarlaEngine.cpp carla-2.5.5/source/backend/engine/CarlaEngine.cpp --- carla-2.5.4/source/backend/engine/CarlaEngine.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngine.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -224,8 +224,8 @@ devInfo.sampleRates = nullptr; return &devInfo; } + --index2; } - --index2; #endif #ifdef USING_JUCE_AUDIO_DEVICES @@ -260,7 +260,7 @@ --index2; #endif - carla_stderr("CarlaEngine::getDriverDeviceInfo(%u, \"%s\") - invalid index %u", index, index2, deviceName); + carla_stderr("CarlaEngine::getDriverDeviceInfo(%u, \"%s\") - invalid index %u", index, deviceName, index2); return nullptr; } @@ -304,7 +304,7 @@ --index2; #endif - carla_stderr("CarlaEngine::showDriverDeviceControlPanel(%u, \"%s\") - invalid index %u", index, index2, deviceName); + carla_stderr("CarlaEngine::showDriverDeviceControlPanel(%u, \"%s\") - invalid index %u", index, deviceName, index2); return false; } diff -Nru carla-2.5.4/source/backend/engine/CarlaEngineGraph.cpp carla-2.5.5/source/backend/engine/CarlaEngineGraph.cpp --- carla-2.5.4/source/backend/engine/CarlaEngineGraph.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngineGraph.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1749,7 +1749,8 @@ PatchbayGraph::PatchbayGraph(CarlaEngine* const engine, const uint32_t audioIns, const uint32_t audioOuts, - const uint32_t cvIns, const uint32_t cvOuts) + const uint32_t cvIns, const uint32_t cvOuts, + const bool withMidiIn, const bool withMidiOut) : CarlaRunner("PatchbayReorderRunner"), connections(), graph(), @@ -1858,6 +1859,7 @@ node->properties.isOSC = false; } + if (withMidiIn) { NamedAudioGraphIOProcessor* const proc( new NamedAudioGraphIOProcessor(NamedAudioGraphIOProcessor::midiInputNode)); @@ -1870,6 +1872,7 @@ node->properties.isOSC = false; } + if (withMidiOut) { NamedAudioGraphIOProcessor* const proc( new NamedAudioGraphIOProcessor(NamedAudioGraphIOProcessor::midiOutputNode)); @@ -2663,7 +2666,8 @@ } void EngineInternalGraph::create(const uint32_t audioIns, const uint32_t audioOuts, - const uint32_t cvIns, const uint32_t cvOuts) + const uint32_t cvIns, const uint32_t cvOuts, + const bool withMidiIn, const bool withMidiOut) { fIsRack = (kEngine->getOptions().processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK); @@ -2675,7 +2679,7 @@ else { CARLA_SAFE_ASSERT_RETURN(fPatchbay == nullptr,); - fPatchbay = new PatchbayGraph(kEngine, audioIns, audioOuts, cvIns, cvOuts); + fPatchbay = new PatchbayGraph(kEngine, audioIns, audioOuts, cvIns, cvOuts, withMidiIn, withMidiOut); } fNumAudioOuts = audioOuts; diff -Nru carla-2.5.4/source/backend/engine/CarlaEngineGraph.hpp carla-2.5.5/source/backend/engine/CarlaEngineGraph.hpp --- carla-2.5.4/source/backend/engine/CarlaEngineGraph.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngineGraph.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -184,7 +184,8 @@ PatchbayGraph(CarlaEngine* engine, uint32_t audioIns, uint32_t audioOuts, - uint32_t cvIns, uint32_t cvOuts); + uint32_t cvIns, uint32_t cvOuts, + bool withMidiIn, bool withMidiOut); ~PatchbayGraph(); void setBufferSize(uint32_t bufferSize); diff -Nru carla-2.5.4/source/backend/engine/CarlaEngineInternal.cpp carla-2.5.5/source/backend/engine/CarlaEngineInternal.cpp --- carla-2.5.4/source/backend/engine/CarlaEngineInternal.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngineInternal.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -782,7 +782,8 @@ #ifndef CARLA_OS_WASM #if defined(DEBUG) || defined(BUILD_BRIDGE) // block wait for unlock on processing side - carla_stdout(ACTION_MSG_PREFIX "ScopedPluginAction(%i) - blocking START", pluginId); + carla_stdout(ACTION_MSG_PREFIX "ScopedPluginAction(%i|%i:%s) - blocking START", + pluginId, action, EnginePostAction2Str(action)); #endif if (! pData->nextAction.postDone) @@ -808,7 +809,8 @@ } #if defined(DEBUG) || defined(BUILD_BRIDGE) - carla_stdout(ACTION_MSG_PREFIX "ScopedPluginAction(%i) - blocking DONE", pluginId); + carla_stdout(ACTION_MSG_PREFIX "ScopedPluginAction(%i|%i:%s) - blocking DONE", + pluginId, action, EnginePostAction2Str(action)); #endif #endif diff -Nru carla-2.5.4/source/backend/engine/CarlaEngineInternal.hpp carla-2.5.5/source/backend/engine/CarlaEngineInternal.hpp --- carla-2.5.4/source/backend/engine/CarlaEngineInternal.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngineInternal.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -80,7 +80,9 @@ EngineInternalGraph(CarlaEngine* engine) noexcept; ~EngineInternalGraph() noexcept; - void create(uint32_t audioIns, uint32_t audioOuts, uint32_t cvIns, uint32_t cvOuts); + void create(uint32_t audioIns, uint32_t audioOuts, + uint32_t cvIns, uint32_t cvOuts, + bool withMidiIn = true, bool withMidiOut = true); void destroy() noexcept; void setBufferSize(uint32_t bufferSize); @@ -203,6 +205,27 @@ #endif }; +static inline +const char* EnginePostAction2Str(const EnginePostAction action) +{ + switch (action) + { + case kEnginePostActionNull: + return "kEnginePostActionNull"; + case kEnginePostActionZeroCount: + return "kEnginePostActionZeroCount"; +#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH + case kEnginePostActionRemovePlugin: + return "kEnginePostActionRemovePlugin"; + case kEnginePostActionSwitchPlugins: + return "kEnginePostActionSwitchPlugins"; +#endif + } + + carla_stderr("CarlaBackend::EnginePostAction2Str(%i) - invalid action", action); + return nullptr; +} + struct EngineNextAction { EnginePostAction opcode; uint pluginId; diff -Nru carla-2.5.4/source/backend/engine/CarlaEngineJuce.cpp carla-2.5.5/source/backend/engine/CarlaEngineJuce.cpp --- carla-2.5.4/source/backend/engine/CarlaEngineJuce.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngineJuce.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1002,8 +1002,7 @@ { initJuceDevicesIfNeeded(); - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); @@ -1016,8 +1015,7 @@ { initJuceDevicesIfNeeded(); - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); @@ -1045,8 +1043,7 @@ { initJuceDevicesIfNeeded(); - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), nullptr); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); @@ -1083,7 +1080,7 @@ devInfo.hints |= ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL; juce::Array juceBufferSizes = device->getAvailableBufferSizes(); - if (int bufferSizesCount = juceBufferSizes.size()) + if (const int bufferSizesCount = juceBufferSizes.size()) { uint32_t* const bufferSizes(new uint32_t[bufferSizesCount+1]); @@ -1099,7 +1096,7 @@ } juce::Array juceSampleRates = device->getAvailableSampleRates(); - if (int sampleRatesCount = juceSampleRates.size()) + if (const int sampleRatesCount = juceSampleRates.size()) { double* const sampleRates(new double[sampleRatesCount+1]); @@ -1119,8 +1116,7 @@ bool showJuceDeviceControlPanel(const uint uindex, const char* const deviceName) { - const int index(static_cast(uindex)); - + const int index = static_cast(uindex); CARLA_SAFE_ASSERT_RETURN(index < gDeviceTypes.size(), false); juce::AudioIODeviceType* const deviceType(gDeviceTypes[index]); diff -Nru carla-2.5.4/source/backend/engine/CarlaEngineNative.cpp carla-2.5.5/source/backend/engine/CarlaEngineNative.cpp --- carla-2.5.4/source/backend/engine/CarlaEngineNative.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/engine/CarlaEngineNative.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -45,6 +45,10 @@ #include "water/xml/XmlDocument.h" #include "water/xml/XmlElement.h" +#ifdef CARLA_OS_WIN +# include +#endif + #ifdef USING_JUCE # include "carla_juce/carla_juce.h" #endif @@ -101,7 +105,8 @@ class CarlaEngineNative : public CarlaEngine { public: - CarlaEngineNative(const NativeHostDescriptor* const host, const bool isPatchbay, const bool withMidiOut, + CarlaEngineNative(const NativeHostDescriptor* const host, const bool isPatchbay, + const bool withMidiIn, const bool withMidiOut, const uint32_t inChan = 2, uint32_t outChan = 2, const uint32_t cvIns = 0, const uint32_t cvOuts = 0) : CarlaEngine(), @@ -114,6 +119,7 @@ fJuceMsgMutex(), #endif kIsPatchbay(isPatchbay), + kHasMidiIn(withMidiIn), kHasMidiOut(withMidiOut), fIsActive(false), fIsRunning(false), @@ -158,7 +164,7 @@ pData->options.preferPluginBridges = false; pData->options.preferUiBridges = false; init("Carla-Patchbay"); - pData->graph.create(inChan, outChan, cvIns, cvOuts); + pData->graph.create(inChan, outChan, cvIns, cvOuts, withMidiIn, withMidiOut); } else { @@ -1154,6 +1160,7 @@ // --------------------------------------------------------------- // events input (before processing) + if (kHasMidiIn) { uint32_t engineEventIndex = 0; @@ -1266,6 +1273,12 @@ fUiServer.setData(path, pData->sampleRate, pHost->uiName); +#ifdef CARLA_OS_WIN + // Fix conflict with other tools using Carla + char* const oldcwd = _getcwd(nullptr, 0); + chdir(pHost->resourceDir); +#endif + if (! fUiServer.startPipeServer(false)) { pHost->dispatcher(pHost->handle, NATIVE_HOST_OPCODE_UI_UNAVAILABLE, 0, 0, nullptr, 0.0f); @@ -1295,6 +1308,11 @@ if (kIsPatchbay) patchbayRefresh(true, false, false); + +#ifdef CARLA_OS_WIN + chdir(oldcwd); + std::free(oldcwd); +#endif } else { @@ -1545,52 +1563,57 @@ static NativePluginHandle _instantiateRack(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, false, true); + return new CarlaEngineNative(host, false, true, true); } static NativePluginHandle _instantiateRackNoMidiOut(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, false, false); + return new CarlaEngineNative(host, false, true, false); } static NativePluginHandle _instantiatePatchbay(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true); + return new CarlaEngineNative(host, true, true, true); } static NativePluginHandle _instantiatePatchbay3s(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true, 3, 2); + return new CarlaEngineNative(host, true, true, true, 3, 2); } static NativePluginHandle _instantiatePatchbay16(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true, 16, 16); + return new CarlaEngineNative(host, true, true, true, 16, 16); } static NativePluginHandle _instantiatePatchbay32(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true, 32, 32); + return new CarlaEngineNative(host, true, true, true, 32, 32); } static NativePluginHandle _instantiatePatchbay64(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true, 64, 64); + return new CarlaEngineNative(host, true, true, true, 64, 64); } static NativePluginHandle _instantiatePatchbayCV(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true, 2, 2, 5, 5); + return new CarlaEngineNative(host, true, true, true, 2, 2, 5, 5); } static NativePluginHandle _instantiatePatchbayCV8(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true, 2, 2, 8, 8); + return new CarlaEngineNative(host, true, true, true, 2, 2, 8, 8); } static NativePluginHandle _instantiatePatchbayCV32(const NativeHostDescriptor* host) { - return new CarlaEngineNative(host, true, true, 64, 64, 32, 32); + return new CarlaEngineNative(host, true, true, true, 64, 64, 32, 32); + } + + static NativePluginHandle _instantiatePatchbayOBS(const NativeHostDescriptor* host) + { + return new CarlaEngineNative(host, true, false, false, 8, 8); } static void _cleanup(NativePluginHandle handle) @@ -1697,6 +1720,9 @@ case NATIVE_PLUGIN_OPCODE_HOST_USES_EMBED: handlePtr->fUsesEmbed = true; return 0; + case NATIVE_PLUGIN_OPCODE_HOST_OPTION: + handlePtr->setOption(static_cast(index), value, static_cast(ptr)); + return 0; } return 0; @@ -1744,6 +1770,7 @@ #endif const bool kIsPatchbay; // rack if false + const bool kHasMidiIn; const bool kHasMidiOut; bool fIsActive, fIsRunning, fUsesEmbed; #ifndef CARLA_ENGINE_WITHOUT_UI @@ -2928,10 +2955,65 @@ /* ui_height */ kUiHeight }; +static const NativePluginDescriptor carlaPatchbayOBS = { + /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, + /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME + |NATIVE_PLUGIN_USES_UI_SIZE), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), + /* audioIns */ 8, + /* audioOuts */ 8, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ kNumInParams, + /* paramOuts */ kNumOutParams, + /* name */ "Carla-Patchbay (OBS)", + /* label */ "carlapatchbayOBS", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + CarlaEngineNative::_instantiatePatchbayOBS, + CarlaEngineNative::_cleanup, + CarlaEngineNative::_get_parameter_count, + CarlaEngineNative::_get_parameter_info, + CarlaEngineNative::_get_parameter_value, + /* _get_midi_program_count */ nullptr, + /* _get_midi_program_info */ nullptr, + CarlaEngineNative::_set_parameter_value, + /* _set_midi_program */ nullptr, + /* _set_custom_data */ nullptr, +#ifndef CARLA_ENGINE_WITHOUT_UI + CarlaEngineNative::_ui_show, +#else + nullptr, +#endif + CarlaEngineNative::_ui_idle, + CarlaEngineNative::_ui_set_parameter_value, + /* _ui_set_midi_program */ nullptr, + /* _ui_set_custom_data */ nullptr, + CarlaEngineNative::_activate, + CarlaEngineNative::_deactivate, + CarlaEngineNative::_process, + CarlaEngineNative::_get_state, + CarlaEngineNative::_set_state, + CarlaEngineNative::_dispatcher, + /* _render_inline_dsplay */ nullptr, + /* cvIns */ 0, + /* cvOuts */ 0, + /* _get_buffer_port_name */ nullptr, + /* _get_buffer_port_range */ nullptr, + /* ui_width */ kUiWidth, + /* ui_height */ kUiHeight +}; + CARLA_BACKEND_END_NAMESPACE // ----------------------------------------------------------------------- +#ifndef STATIC_PLUGIN_TARGET + CARLA_API_EXPORT void carla_register_native_plugin_carla(); @@ -2948,6 +3030,8 @@ carla_register_native_plugin(&carlaPatchbayCVDesc); } +#endif + // ----------------------------------------------------------------------- const NativePluginDescriptor* carla_get_native_rack_plugin() @@ -2998,6 +3082,12 @@ return &carlaPatchbayCV32Desc; } +const NativePluginDescriptor* carla_get_native_patchbay_obs_plugin() +{ + CARLA_BACKEND_USE_NAMESPACE; + return &carlaPatchbayOBS; +} + // ----------------------------------------------------------------------- // Extra stuff for linking purposes diff -Nru carla-2.5.4/source/backend/plugin/CarlaPluginBridge.cpp carla-2.5.5/source/backend/plugin/CarlaPluginBridge.cpp --- carla-2.5.4/source/backend/plugin/CarlaPluginBridge.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/plugin/CarlaPluginBridge.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Plugin Bridge - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -930,18 +930,18 @@ return; } + const uint32_t maxLocalValueLen = fBridgeVersion >= 10 ? 4096 : 16384; + const uint32_t typeLen = static_cast(std::strlen(type)); const uint32_t keyLen = static_cast(std::strlen(key)); const uint32_t valueLen = static_cast(std::strlen(value)); - /* - if (valueLen > 16384) - fShmNonRtClientControl.waitIfDataIsReachingLimit(); - */ - { const CarlaMutexLocker _cml(fShmNonRtClientControl.mutex); + if (valueLen > maxLocalValueLen) + fShmNonRtClientControl.waitIfDataIsReachingLimit(); + fShmNonRtClientControl.writeOpcode(kPluginBridgeNonRtClientSetCustomData); fShmNonRtClientControl.writeUInt(typeLen); @@ -954,7 +954,7 @@ if (valueLen > 0) { - if (valueLen > 16384) + if (valueLen > maxLocalValueLen) { String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); @@ -2508,6 +2508,7 @@ case kPluginBridgeNonRtServerSetCustomData: { // uint/size, str[], uint/size, str[], uint/size, str[] + const uint32_t maxLocalValueLen = fBridgeVersion >= 10 ? 4096 : 16384; // type const uint32_t typeSize = fShmNonRtServerControl.readUInt(); @@ -2525,7 +2526,7 @@ const uint32_t valueSize = fShmNonRtServerControl.readUInt(); // special case for big values - if (valueSize > 16384) + if (valueSize > maxLocalValueLen) { const uint32_t bigValueFilePathSize = fShmNonRtServerControl.readUInt(); char bigValueFilePath[bigValueFilePathSize+1]; diff -Nru carla-2.5.4/source/backend/plugin/CarlaPluginLV2.cpp carla-2.5.5/source/backend/plugin/CarlaPluginLV2.cpp --- carla-2.5.4/source/backend/plugin/CarlaPluginLV2.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/plugin/CarlaPluginLV2.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -7710,22 +7710,30 @@ std::free(path); } - static char* carla_lv2_state_make_path_real(LV2_State_Make_Path_Handle handle, const char* const path) + static char* carla_lv2_state_make_path_real(LV2_State_Make_Path_Handle handle, const char* path) { CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); - CARLA_SAFE_ASSERT_RETURN(path != nullptr && path[0] != '\0', nullptr); + CARLA_SAFE_ASSERT_RETURN(path != nullptr, nullptr); carla_debug("carla_lv2_state_make_path_real(%p, \"%s\")", handle, path); + // allow empty paths to mean "current dir" + if (path[0] == '\0') + path = "."; + const File file(((CarlaPluginLV2*)handle)->handleStateMapToAbsolutePath(true, false, false, path)); return file.isNotNull() ? strdup(file.getFullPathName().toRawUTF8()) : nullptr; } - static char* carla_lv2_state_make_path_tmp(LV2_State_Make_Path_Handle handle, const char* const path) + static char* carla_lv2_state_make_path_tmp(LV2_State_Make_Path_Handle handle, const char* path) { CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); - CARLA_SAFE_ASSERT_RETURN(path != nullptr && path[0] != '\0', nullptr); + CARLA_SAFE_ASSERT_RETURN(path != nullptr, nullptr); carla_debug("carla_lv2_state_make_path_tmp(%p, \"%s\")", handle, path); + // allow empty paths to mean "current dir" + if (path[0] == '\0') + path = "."; + const File file(((CarlaPluginLV2*)handle)->handleStateMapToAbsolutePath(true, false, true, path)); return file.isNotNull() ? strdup(file.getFullPathName().toRawUTF8()) : nullptr; } @@ -7733,37 +7741,53 @@ static char* carla_lv2_state_map_to_abstract_path_real(LV2_State_Map_Path_Handle handle, const char* const absolute_path) { CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); - CARLA_SAFE_ASSERT_RETURN(absolute_path != nullptr && absolute_path[0] != '\0', nullptr); + CARLA_SAFE_ASSERT_RETURN(absolute_path != nullptr, nullptr); carla_debug("carla_lv2_state_map_to_abstract_path_real(%p, \"%s\")", handle, absolute_path); + // handle invalid empty paths the same way as lilv + if (absolute_path[0] != '\0') + return strdup(""); + return ((CarlaPluginLV2*)handle)->handleStateMapToAbstractPath(false, absolute_path); } static char* carla_lv2_state_map_to_abstract_path_tmp(LV2_State_Map_Path_Handle handle, const char* const absolute_path) { CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); - CARLA_SAFE_ASSERT_RETURN(absolute_path != nullptr && absolute_path[0] != '\0', nullptr); + CARLA_SAFE_ASSERT_RETURN(absolute_path != nullptr, nullptr); carla_debug("carla_lv2_state_map_to_abstract_path_tmp(%p, \"%s\")", handle, absolute_path); + // handle invalid empty paths the same way as lilv + if (absolute_path[0] != '\0') + return strdup(""); + return ((CarlaPluginLV2*)handle)->handleStateMapToAbstractPath(true, absolute_path); } - static char* carla_lv2_state_map_to_absolute_path_real(LV2_State_Map_Path_Handle handle, const char* const abstract_path) + static char* carla_lv2_state_map_to_absolute_path_real(LV2_State_Map_Path_Handle handle, const char* abstract_path) { CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); - CARLA_SAFE_ASSERT_RETURN(abstract_path != nullptr && abstract_path[0] != '\0', nullptr); + CARLA_SAFE_ASSERT_RETURN(abstract_path != nullptr, nullptr); carla_debug("carla_lv2_state_map_to_absolute_path_real(%p, \"%s\")", handle, abstract_path); + // allow empty paths to mean "current dir" + if (abstract_path[0] == '\0') + abstract_path = "."; + const File file(((CarlaPluginLV2*)handle)->handleStateMapToAbsolutePath(true, true, false, abstract_path)); return file.isNotNull() ? strdup(file.getFullPathName().toRawUTF8()) : nullptr; } - static char* carla_lv2_state_map_to_absolute_path_tmp(LV2_State_Map_Path_Handle handle, const char* const abstract_path) + static char* carla_lv2_state_map_to_absolute_path_tmp(LV2_State_Map_Path_Handle handle, const char* abstract_path) { CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); - CARLA_SAFE_ASSERT_RETURN(abstract_path != nullptr && abstract_path[0] != '\0', nullptr); + CARLA_SAFE_ASSERT_RETURN(abstract_path != nullptr, nullptr); carla_debug("carla_lv2_state_map_to_absolute_path_tmp(%p, \"%s\")", handle, abstract_path); + // allow empty paths to mean "current dir" + if (abstract_path[0] == '\0') + abstract_path = "."; + const File file(((CarlaPluginLV2*)handle)->handleStateMapToAbsolutePath(true, true, true, abstract_path)); return file.isNotNull() ? strdup(file.getFullPathName().toRawUTF8()) : nullptr; } diff -Nru carla-2.5.4/source/backend/utils/CarlaUtils.cpp carla-2.5.5/source/backend/utils/CarlaUtils.cpp --- carla-2.5.4/source/backend/utils/CarlaUtils.cpp 1970-01-01 00:00:00.000000000 +0000 +++ carla-2.5.5/source/backend/utils/CarlaUtils.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * Carla Plugin Host + * Copyright (C) 2011-2023 Filipe Coelho + * + * 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 2 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 doc/GPL.txt file. + */ + +#include "CarlaUtils.hpp" + +#include "CarlaProcessUtils.cpp" + +#ifndef CARLA_OS_WASM +# include "CarlaBridgeUtils.cpp" +#endif + +#ifdef CARLA_OS_MAC +# include "CarlaMacUtils.cpp" +#endif diff -Nru carla-2.5.4/source/backend/utils/Makefile carla-2.5.5/source/backend/utils/Makefile --- carla-2.5.4/source/backend/utils/Makefile 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/backend/utils/Makefile 2023-06-04 12:40:25.000000000 +0000 @@ -16,6 +16,7 @@ OBJS = \ $(OBJDIR)/CachedPlugins.cpp.o \ + $(OBJDIR)/CarlaUtils.cpp.o \ $(OBJDIR)/Information.cpp.o \ $(OBJDIR)/JUCE.cpp.o \ $(OBJDIR)/PipeClient.cpp.o \ @@ -26,7 +27,8 @@ # --------------------------------------------------------------------------------------------------------------------- -LIBS = $(MODULEDIR)/lilv.a +LIBS = $(MODULEDIR)/jackbridge.a +LIBS += $(MODULEDIR)/lilv.a LIBS += $(MODULEDIR)/water.files.a LIBS += $(MODULEDIR)/ysfx.a @@ -42,6 +44,7 @@ LIBS += $(MODULEDIR)/juce_gui_extra.a endif +LINK_FLAGS += $(JACKBRIDGE_LIBS) LINK_FLAGS += $(LILV_LIBS) LINK_FLAGS += $(WATER_LIBS) LINK_FLAGS += $(YSFX_GRAPHICS_LIBS) @@ -90,16 +93,11 @@ ifeq ($(MACOS),true) ifeq ($(USING_JUCE),true) -$(OBJDIR)/CachedPlugins.cpp.o: CachedPlugins.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling $<" - $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -std=gnu++14 -c -o $@ +$(OBJDIR)/CachedPlugins.cpp.o: BUILD_CXX_FLAGS += -std=gnu++14 endif +$(OBJDIR)/CarlaUtils.cpp.o: BUILD_CXX_FLAGS += -ObjC++ -$(OBJDIR)/Windows.cpp.o: Windows.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling $<" - $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -ObjC++ -c -o $@ +$(OBJDIR)/Windows.cpp.o: BUILD_CXX_FLAGS += -ObjC++ endif $(OBJDIR)/%.cpp.o: %.cpp diff -Nru carla-2.5.4/source/bridges-plugin/CarlaBridgePlugin.cpp carla-2.5.5/source/bridges-plugin/CarlaBridgePlugin.cpp --- carla-2.5.4/source/bridges-plugin/CarlaBridgePlugin.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/bridges-plugin/CarlaBridgePlugin.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -72,13 +72,14 @@ // ------------------------------------------------------------------------- static bool gIsInitiated = false; -static volatile bool gCloseNow = false; +static volatile bool gCloseBridge = false; +static volatile bool gCloseSignal = false; static volatile bool gSaveNow = false; #if defined(CARLA_OS_UNIX) static void closeSignalHandler(int) noexcept { - gCloseNow = true; + gCloseSignal = true; } static void saveSignalHandler(int) noexcept { @@ -89,7 +90,7 @@ { if (dwCtrlType == CTRL_C_EVENT) { - gCloseNow = true; + gCloseSignal = true; return TRUE; } return FALSE; @@ -229,7 +230,7 @@ gIsInitiated = true; #if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) - CarlaJUCE::setupAndUseMainApplication(gIdle, &gCloseNow); + CarlaJUCE::setupAndUseMainApplication(gIdle, &gCloseSignal); #else int64_t timeToEnd = 0; @@ -239,7 +240,7 @@ fEngine->transportPlay(); } - for (; runMainLoopOnce() && ! gCloseNow;) + for (; runMainLoopOnce() && ! gCloseBridge;) { gIdle(); # if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) @@ -250,6 +251,8 @@ # endif if (testing && timeToEnd - water::Time::currentTimeMillis() < 0) break; + if (gCloseSignal && ! fUsingBridge) + break; } #endif @@ -270,12 +273,12 @@ case ENGINE_CALLBACK_ENGINE_STOPPED: case ENGINE_CALLBACK_PLUGIN_REMOVED: case ENGINE_CALLBACK_QUIT: - gCloseNow = true; + gCloseBridge = gCloseSignal = true; break; case ENGINE_CALLBACK_UI_STATE_CHANGED: if (gIsInitiated && value1 != 1 && ! fUsingBridge) - gCloseNow = true; + gCloseBridge = gCloseSignal = true; break; default: diff -Nru carla-2.5.4/source/discovery/carla-discovery.cpp carla-2.5.5/source/discovery/carla-discovery.cpp --- carla-2.5.4/source/discovery/carla-discovery.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/discovery/carla-discovery.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Plugin discovery - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -18,6 +18,7 @@ #include "CarlaBackendUtils.hpp" #include "CarlaLibUtils.hpp" #include "CarlaMathUtils.hpp" +#include "CarlaPipeUtils.cpp" #include "CarlaScopeUtils.hpp" #include "CarlaMIDI.h" @@ -31,7 +32,7 @@ #ifdef CARLA_OS_MAC # include "CarlaMacUtils.cpp" -# if defined(USING_JUCE) && defined(__aarch64__) +# ifdef __aarch64__ # include # endif #endif @@ -50,6 +51,7 @@ #endif #include +#include #include "water/files/File.h" @@ -75,13 +77,15 @@ # pragma GCC diagnostic pop #endif -#define DISCOVERY_OUT(x, y) std::cout << "\ncarla-discovery::" << x << "::" << y << std::endl; +#define DISCOVERY_OUT(x, y) \ + if (gPipe != nullptr) { std::stringstream s; s << y; gPipe->writeDiscoveryMessage(x, s.str().c_str()); } \ + else { std::cout << "\ncarla-discovery::" << x << "::" << y << std::endl; } using water::File; CARLA_BACKEND_USE_NAMESPACE -// ------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // Dummy values to test plugins with static const uint32_t kBufferSize = 512; @@ -89,7 +93,47 @@ static const int32_t kSampleRatei = 44100; static const float kSampleRatef = 44100.0f; -// ------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- +// Dynamic discovery + +class DiscoveryPipe : public CarlaPipeClient +{ +public: + DiscoveryPipe() {} + + ~DiscoveryPipe() + { + writeExitingMessageAndWait(); + } + + bool writeDiscoveryMessage(const char* const key, const char* const value) const noexcept + { + CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0', false); + CARLA_SAFE_ASSERT_RETURN(value != nullptr, false); + + const CarlaMutexLocker cml(pData->writeLock); + + if (! writeAndFixMessage(key)) + return false; + if (! writeAndFixMessage(value)) + return false; + + flushMessages(); + return true; + } + +protected: + bool msgReceived(const char* const msg) noexcept + { + carla_stdout("discovery msgReceived %s", msg); + return true; + } +}; + +CarlaScopedPointer gPipe; + + +// -------------------------------------------------------------------------------------------------------------------- // Don't print ELF/EXE related errors since discovery can find multi-architecture binaries static void print_lib_error(const char* const filename) @@ -107,7 +151,8 @@ } } -// ------------------------------ Plugin Checks ----------------------------- +// -------------------------------------------------------------------------------------------------------------------- +// Plugin Checks #ifndef BUILD_BRIDGE static void print_cached_plugin(const CarlaCachedPluginInfo* const pinfo) @@ -135,19 +180,22 @@ static void do_cached_check(const PluginType type) { - const char* plugPath; + const char* plugPath = std::getenv("CARLA_DISCOVERY_PATH"); - switch (type) + if (plugPath == nullptr) { - case PLUGIN_LV2: - plugPath = std::getenv("LV2_PATH"); - break; - case PLUGIN_SFZ: - plugPath = std::getenv("SFZ_PATH"); - break; - default: - plugPath = nullptr; - break; + switch (type) + { + case PLUGIN_LV2: + plugPath = std::getenv("LV2_PATH"); + break; + case PLUGIN_SFZ: + plugPath = std::getenv("SFZ_PATH"); + break; + default: + plugPath = nullptr; + break; + } } # ifdef USING_JUCE @@ -251,7 +299,6 @@ uint hints = 0x0; uint audioIns = 0; uint audioOuts = 0; - uint audioTotal = 0; uint parametersIns = 0; uint parametersOuts = 0; uint parametersTotal = 0; @@ -270,8 +317,6 @@ audioIns += 1; else if (LADSPA_IS_PORT_OUTPUT(portDescriptor)) audioOuts += 1; - - audioTotal += 1; } else if (LADSPA_IS_PORT_CONTROL(portDescriptor)) { @@ -308,7 +353,7 @@ continue; } - LADSPA_Data bufferAudio[kBufferSize][audioTotal]; + LADSPA_Data bufferAudio[kBufferSize][std::max(1u, audioIns + audioOuts)]; LADSPA_Data bufferParams[parametersTotal]; LADSPA_Data min, max, def; @@ -510,7 +555,6 @@ uint hints = 0x0; uint audioIns = 0; uint audioOuts = 0; - uint audioTotal = 0; uint midiIns = 0; uint parametersIns = 0; uint parametersOuts = 0; @@ -530,8 +574,6 @@ audioIns += 1; else if (LADSPA_IS_PORT_OUTPUT(portDescriptor)) audioOuts += 1; - - audioTotal += 1; } else if (LADSPA_IS_PORT_CONTROL(portDescriptor)) { @@ -582,7 +624,7 @@ continue; } - LADSPA_Data bufferAudio[kBufferSize][audioTotal]; + LADSPA_Data bufferAudio[kBufferSize][std::max(1u, audioIns + audioOuts)]; LADSPA_Data bufferParams[parametersTotal]; LADSPA_Data min, max, def; @@ -797,7 +839,7 @@ #endif #ifndef USING_JUCE_FOR_VST2 -// ------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // VST stuff // Check if plugin is currently processing @@ -991,7 +1033,7 @@ return ret; } -static void do_vst2_check(lib_t& libHandle, const char* const filename, const bool doInit) +static bool do_vst2_check(lib_t& libHandle, const char* const filename, const bool doInit) { VST_Function vstFn = nullptr; @@ -1002,8 +1044,12 @@ { if (! bundleLoader.load(filename)) { + #ifdef __aarch64__ + return true; + #else DISCOVERY_OUT("error", "Failed to load VST2 bundle executable"); - return; + return false; + #endif } vstFn = (VST_Function)CFBundleGetFunctionPointerForName(bundleLoader.getRef(), CFSTR("main_macho")); @@ -1014,7 +1060,7 @@ if (vstFn == nullptr) { DISCOVERY_OUT("error", "Not a VST2 plugin"); - return; + return false; } } else @@ -1029,7 +1075,7 @@ if (vstFn == nullptr) { DISCOVERY_OUT("error", "Not a VST plugin"); - return; + return false; } } } @@ -1039,7 +1085,7 @@ if (effect == nullptr || effect->magic != kEffectMagic) { DISCOVERY_OUT("error", "Failed to init VST plugin, or VST magic failed"); - return; + return false; } if (effect->uniqueID == 0) @@ -1064,7 +1110,7 @@ { DISCOVERY_OUT("error", "Plugin doesn't have an Unique ID after being open"); effect->dispatcher(effect, effClose, 0, 0, nullptr, 0.0f); - return; + return false; } gVstCurrentUniqueId = effect->uniqueID; @@ -1340,9 +1386,9 @@ effect->dispatcher(effect, effClose, 0, 0, nullptr, 0.0f); } -#ifndef CARLA_OS_MAC - return; + return false; +#ifndef CARLA_OS_MAC // unused (void)filename; #endif @@ -1447,7 +1493,13 @@ static v3_result V3_API carla_add_event(void*, v3_event*) { return V3_NOT_IMPLEMENTED; } }; -static void do_vst3_check(lib_t& libHandle, const char* const filename, const bool doInit) +static bool v3_exit_false(const V3_EXITFN v3_exit) +{ + v3_exit(); + return false; +} + +static bool do_vst3_check(lib_t& libHandle, const char* const filename, const bool doInit) { V3_ENTRYFN v3_entry = nullptr; V3_EXITFN v3_exit = nullptr; @@ -1463,8 +1515,12 @@ #ifdef CARLA_OS_MAC if (! bundleLoader.load(filename)) { + #ifdef __aarch64__ + return true; + #else DISCOVERY_OUT("error", "Failed to load VST3 bundle executable"); - return; + return false; + #endif } v3_entry = (V3_ENTRYFN)CFBundleGetFunctionPointerForName(bundleLoader.getRef(), CFSTR(V3_ENTRYFNNAME)); @@ -1487,7 +1543,7 @@ if (! water::File(binaryfilename).existsAsFile()) { DISCOVERY_OUT("error", "Failed to find a suitable VST3 bundle binary"); - return; + return false; } libHandle = lib_open(binaryfilename.toRawUTF8()); @@ -1495,7 +1551,7 @@ if (libHandle == nullptr) { print_lib_error(filename); - return; + return false; } #endif } @@ -1510,7 +1566,7 @@ if (v3_entry == nullptr || v3_exit == nullptr || v3_get == nullptr) { DISCOVERY_OUT("error", "Not a VST3 plugin"); - return; + return false; } // call entry point @@ -1528,21 +1584,21 @@ // fetch initial factory v3_plugin_factory** factory1 = v3_get(); - CARLA_SAFE_ASSERT_RETURN(factory1 != nullptr, v3_exit()); + CARLA_SAFE_ASSERT_RETURN(factory1 != nullptr, v3_exit_false(v3_exit)); // get factory info v3_factory_info factoryInfo = {}; - CARLA_SAFE_ASSERT_RETURN(v3_cpp_obj(factory1)->get_factory_info(factory1, &factoryInfo) == V3_OK, v3_exit()); + CARLA_SAFE_ASSERT_RETURN(v3_cpp_obj(factory1)->get_factory_info(factory1, &factoryInfo) == V3_OK, v3_exit_false(v3_exit)); // get num classes const int32_t numClasses = v3_cpp_obj(factory1)->num_classes(factory1); - CARLA_SAFE_ASSERT_RETURN(numClasses > 0, v3_exit()); + CARLA_SAFE_ASSERT_RETURN(numClasses > 0, v3_exit_false(v3_exit)); // query 2nd factory v3_plugin_factory_2** factory2 = nullptr; if (v3_cpp_obj_query_interface(factory1, v3_plugin_factory_2_iid, &factory2) == V3_OK) { - CARLA_SAFE_ASSERT_RETURN(factory2 != nullptr, v3_exit()); + CARLA_SAFE_ASSERT_RETURN(factory2 != nullptr, v3_exit_false(v3_exit)); } else { @@ -1554,7 +1610,7 @@ v3_plugin_factory_3** factory3 = nullptr; if (factory2 != nullptr && v3_cpp_obj_query_interface(factory2, v3_plugin_factory_3_iid, &factory3) == V3_OK) { - CARLA_SAFE_ASSERT_RETURN(factory3 != nullptr, v3_exit()); + CARLA_SAFE_ASSERT_RETURN(factory3 != nullptr, v3_exit_false(v3_exit)); } else { @@ -1842,11 +1898,12 @@ v3_cpp_obj_unref(factory1); v3_exit(); + return false; } #endif // ! USING_JUCE_FOR_VST3 #ifdef USING_JUCE -// ------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // find all available plugin audio ports static void findMaxTotalChannels(juce::AudioProcessor* const filter, int& maxTotalIns, int& maxTotalOuts) @@ -1873,7 +1930,7 @@ } } -// ------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- static bool do_juce_check(const char* const filename_, const char* const stype, const bool doInit) { @@ -1942,10 +1999,10 @@ if (results.size() == 0) { -#if defined(CARLA_OS_MAC) && defined(__aarch64__) + #if defined(CARLA_OS_MAC) && defined(__aarch64__) if (std::strcmp(stype, "VST2") == 0 || std::strcmp(stype, "VST3") == 0) return true; -#endif + #endif DISCOVERY_OUT("error", "No plugins found"); return false; } @@ -2114,7 +2171,7 @@ #endif } -// ------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- #ifndef BUILD_BRIDGE static void do_jsfx_check(const char* const filename, bool doInit) @@ -2177,9 +2234,9 @@ // ------------------------------ main entry point ------------------------------ -int main(int argc, char* argv[]) +int main(int argc, const char* argv[]) { - if (argc != 3) + if (argc != 3 && argc != 7) { carla_stdout("usage: %s ", argv[0]); return 1; @@ -2192,20 +2249,38 @@ CarlaString filenameCheck(filename); filenameCheck.toLower(); - bool openLib = false; + bool openLib; lib_t handle = nullptr; switch (type) { case PLUGIN_LADSPA: case PLUGIN_DSSI: + // only available as single binary + openLib = true; + break; + case PLUGIN_VST2: + #ifdef CARLA_OS_MAC + // bundle on macOS + openLib = false; + #else + // single binary on all else openLib = true; + #endif break; case PLUGIN_VST3: + #ifdef CARLA_OS_WIN + // either file or bundle on Windows openLib = water::File(filename).existsAsFile(); + #else + // bundle on all else + openLib = false; + #endif break; + default: + openLib = false; break; } @@ -2240,6 +2315,18 @@ #endif // --------------------------------------------------------------------------------------------------------------- + // Initialize pipe + + if (argc == 7) + { + gPipe = new DiscoveryPipe; + + if (! gPipe->initPipeClient(argv)) + return 1; + } + + + // --------------------------------------------------------------------------------------------------------------- if (openLib) { @@ -2282,6 +2369,7 @@ if (std::strcmp(filename, ":all") == 0) { do_cached_check(type); + gPipe = nullptr; return 0; } #endif @@ -2300,10 +2388,9 @@ break; } #endif -#ifdef USING_JUCE + // some macOS plugins have not been yet ported to arm64, re-run them in x86_64 mode if discovery fails - bool retryJucePlugin = false; -#endif + bool retryAsX64lugin = false; switch (type) { @@ -2323,17 +2410,17 @@ case PLUGIN_VST2: #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST - retryJucePlugin = do_juce_check(filename, "VST2", doInit); + retryAsX64lugin = do_juce_check(filename, "VST2", doInit); #else - do_vst2_check(handle, filename, doInit); + retryAsX64lugin = do_vst2_check(handle, filename, doInit); #endif break; case PLUGIN_VST3: #if defined(USING_JUCE) && JUCE_PLUGINHOST_VST3 - retryJucePlugin = do_juce_check(filename, "VST3", doInit); + retryAsX64lugin = do_juce_check(filename, "VST3", doInit); #else - do_vst3_check(handle, filename, doInit); + retryAsX64lugin = do_vst3_check(handle, filename, doInit); #endif break; @@ -2361,9 +2448,12 @@ break; } -#if defined(CARLA_OS_MAC) && defined(USING_JUCE) && defined(__aarch64__) - if (retryJucePlugin) + if (openLib && handle != nullptr) + lib_close(handle); + + if (retryAsX64lugin) { + #if defined(CARLA_OS_MAC) && defined(__aarch64__) DISCOVERY_OUT("warning", "No plugins found while scanning in arm64 mode, will try x86_64 now"); cpu_type_t pref = CPU_TYPE_X86_64; @@ -2372,7 +2462,7 @@ posix_spawnattr_t attr; posix_spawnattr_init(&attr); CARLA_SAFE_ASSERT_RETURN(posix_spawnattr_setbinpref_np(&attr, 1, &pref, nullptr) == 0, 1); - CARLA_SAFE_ASSERT_RETURN(posix_spawn(&pid, argv[0], nullptr, &attr, argv, nullptr) == 0, 1); + CARLA_SAFE_ASSERT_RETURN(posix_spawn(&pid, argv[0], nullptr, &attr, (char* const*)argv, nullptr) == 0, 1); posix_spawnattr_destroy(&attr); if (pid > 0) @@ -2380,11 +2470,10 @@ int status; waitpid(pid, &status, 0); } + #endif } -#endif - if (openLib && handle != nullptr) - lib_close(handle); + gPipe = nullptr; // --------------------------------------------------------------------------------------------------------------- @@ -2398,11 +2487,6 @@ #endif return 0; - -#ifdef USING_JUCE - // might be unused - (void)retryJucePlugin; -#endif } -// ------------------------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- diff -Nru carla-2.5.4/source/discovery/Makefile carla-2.5.5/source/discovery/Makefile --- carla-2.5.4/source/discovery/Makefile 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/discovery/Makefile 2023-06-04 12:40:25.000000000 +0000 @@ -36,7 +36,14 @@ endif ifeq ($(WINDOWS),true) -LINK_FLAGS += -lole32 -lssp -mwindows +LINK_FLAGS += -lole32 -lws2_32 -mwindows +endif + +ifeq ($(HAIKU),true) +LINK_FLAGS += -lpthread +else +BUILD_CXX_FLAGS += -pthread +LINK_FLAGS += -pthread endif ifeq ($(USING_JUCE),true) diff -Nru carla-2.5.4/source/frontend/carla_app.py carla-2.5.5/source/frontend/carla_app.py --- carla-2.5.4/source/frontend/carla_app.py 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/frontend/carla_app.py 2023-06-04 12:40:25.000000000 +0000 @@ -68,8 +68,13 @@ path = "H:\\PawPawBuilds\\targets\\win32\\lib\\qt5\\plugins" QApplication.addLibraryPath(path) + # Try resource dir as library path first + if os.path.exists(os.path.join(pathResources, "styles", "carlastyle.json")): + QApplication.addLibraryPath(pathResources) + stylesDir = pathResources + # Use binary dir as library path - if os.path.exists(pathBinaries): + elif os.path.exists(pathBinaries): QApplication.addLibraryPath(pathBinaries) stylesDir = pathBinaries diff -Nru carla-2.5.4/source/frontend/carla_shared.py carla-2.5.5/source/frontend/carla_shared.py --- carla-2.5.4/source/frontend/carla_shared.py 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/frontend/carla_shared.py 2023-06-04 12:40:25.000000000 +0000 @@ -76,7 +76,7 @@ # ------------------------------------------------------------------------------------------------------------ # Set Version -VERSION = "2.5.4" +VERSION = "2.5.5" # ------------------------------------------------------------------------------------------------------------ # Set TMP diff -Nru carla-2.5.4/source/includes/CarlaDefines.h carla-2.5.5/source/includes/CarlaDefines.h --- carla-2.5.4/source/includes/CarlaDefines.h 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/includes/CarlaDefines.h 2023-06-04 12:40:25.000000000 +0000 @@ -18,11 +18,6 @@ #ifndef CARLA_DEFINES_H_INCLUDED #define CARLA_DEFINES_H_INCLUDED -/* IDE Helper */ -#ifndef REAL_BUILD -# include "config.h" -#endif - /* Compatibility with non-clang compilers */ #ifndef __has_feature # define __has_feature(x) 0 @@ -32,8 +27,8 @@ #endif /* Set Version */ -#define CARLA_VERSION_HEX 0x020504 -#define CARLA_VERSION_STRING "2.5.4" +#define CARLA_VERSION_HEX 0x020505 +#define CARLA_VERSION_STRING "2.5.5" #define CARLA_VERSION_STRMIN "2.5" /* Check OS */ diff -Nru carla-2.5.4/source/includes/CarlaNative.h carla-2.5.5/source/includes/CarlaNative.h --- carla-2.5.4/source/includes/CarlaNative.h 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/includes/CarlaNative.h 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Native Plugin API - * Copyright (C) 2012-2019 Filipe Coelho + * Copyright (C) 2012-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -100,15 +100,16 @@ } NativeParameterHints; typedef enum { - NATIVE_PLUGIN_OPCODE_NULL = 0, /** nothing */ - NATIVE_PLUGIN_OPCODE_BUFFER_SIZE_CHANGED = 1, /** uses value */ - NATIVE_PLUGIN_OPCODE_SAMPLE_RATE_CHANGED = 2, /** uses opt */ - NATIVE_PLUGIN_OPCODE_OFFLINE_CHANGED = 3, /** uses value (0=off, 1=on) */ - NATIVE_PLUGIN_OPCODE_UI_NAME_CHANGED = 4, /** uses ptr */ - NATIVE_PLUGIN_OPCODE_GET_INTERNAL_HANDLE = 5, /** nothing */ - NATIVE_PLUGIN_OPCODE_IDLE = 6, /** nothing */ - NATIVE_PLUGIN_OPCODE_UI_MIDI_EVENT = 7, /** uses ptr */ - NATIVE_PLUGIN_OPCODE_HOST_USES_EMBED = 8 /** nothing */ + NATIVE_PLUGIN_OPCODE_NULL = 0, /** nothing */ + NATIVE_PLUGIN_OPCODE_BUFFER_SIZE_CHANGED = 1, /** uses value */ + NATIVE_PLUGIN_OPCODE_SAMPLE_RATE_CHANGED = 2, /** uses opt */ + NATIVE_PLUGIN_OPCODE_OFFLINE_CHANGED = 3, /** uses value (0=off, 1=on) */ + NATIVE_PLUGIN_OPCODE_UI_NAME_CHANGED = 4, /** uses ptr */ + NATIVE_PLUGIN_OPCODE_GET_INTERNAL_HANDLE = 5, /** nothing */ + NATIVE_PLUGIN_OPCODE_IDLE = 6, /** nothing */ + NATIVE_PLUGIN_OPCODE_UI_MIDI_EVENT = 7, /** uses ptr */ + NATIVE_PLUGIN_OPCODE_HOST_USES_EMBED = 8, /** nothing */ + NATIVE_PLUGIN_OPCODE_HOST_OPTION = 9 /** uses index, value and ptr */ } NativePluginDispatcherOpcode; typedef enum { diff -Nru carla-2.5.4/source/includes/CarlaNative.hpp carla-2.5.5/source/includes/CarlaNative.hpp --- carla-2.5.4/source/includes/CarlaNative.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/includes/CarlaNative.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Native Plugin API (C++) - * Copyright (C) 2012-2019 Filipe Coelho + * Copyright (C) 2012-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -567,6 +567,7 @@ return handlePtr->uiMIDIEvent(static_cast(index), static_cast(ptr)); case NATIVE_PLUGIN_OPCODE_HOST_USES_EMBED: + case NATIVE_PLUGIN_OPCODE_HOST_OPTION: return 0; } diff -Nru carla-2.5.4/source/includes/CarlaNativePlugin.h carla-2.5.5/source/includes/CarlaNativePlugin.h --- carla-2.5.4/source/includes/CarlaNativePlugin.h 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/includes/CarlaNativePlugin.h 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2022 Filipe Coelho + * Copyright (C) 2011-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -70,6 +70,11 @@ CARLA_API_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_cv32_plugin(void); /*! + * Get the native plugin descriptor for the carla-patchbay OBS plugin. + */ +CARLA_API_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_obs_plugin(void); + +/*! * Create a CarlaHostHandle suitable for CarlaHost API calls. * Returned value must be freed by the caller when no longer needed. */ diff -Nru carla-2.5.4/source/libjack/libjack.cpp carla-2.5.5/source/libjack/libjack.cpp --- carla-2.5.4/source/libjack/libjack.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/libjack/libjack.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1282,6 +1282,9 @@ case kPluginBridgeNonRtClientQuit: ret = true; break; + + case kPluginBridgeNonRtClientReload: + break; } #ifdef DEBUG diff -Nru carla-2.5.4/source/Makefile.mk carla-2.5.5/source/Makefile.mk --- carla-2.5.4/source/Makefile.mk 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/Makefile.mk 2023-06-04 12:40:25.000000000 +0000 @@ -22,7 +22,7 @@ # --------------------------------------------------------------------------------------------------------------------- # Set build and link flags -BASE_FLAGS = -Wall -Wextra -pipe -DBUILDING_CARLA -DREAL_BUILD -MD -MP -fno-common +BASE_FLAGS = -Wall -Wextra -pipe -DBUILDING_CARLA -MD -MP -fno-common BASE_OPTS = -O3 -ffast-math -fdata-sections -ffunction-sections ifeq ($(WASM),true) diff -Nru carla-2.5.4/source/modules/lilv/config/lilv_config.h carla-2.5.5/source/modules/lilv/config/lilv_config.h --- carla-2.5.4/source/modules/lilv/config/lilv_config.h 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/modules/lilv/config/lilv_config.h 2023-06-04 12:40:25.000000000 +0000 @@ -13,7 +13,7 @@ #define HAVE_FILENO 1 #define HAVE_CLOCK_GETTIME 1 -#ifdef __WIN32__ +#ifdef _WIN32 #define LILV_PATH_SEP ";" #define LILV_DIR_SEP "\\" #else @@ -28,7 +28,7 @@ #define LILV_DEFAULT_LV2_PATH "~/.lv2:/lv2" #elif defined(__HAIKU__) #define LILV_DEFAULT_LV2_PATH "~/.lv2:/system/add-ons/media/lv2plugins" -#elif defined(__WIN32__) +#elif defined(_WIN32) #define LILV_DEFAULT_LV2_PATH "%APPDATA%\\LV2;%COMMONPROGRAMFILES%\\LV2" #else #define LILV_DEFAULT_LV2_PATH "~/.lv2:/usr/lib/lv2:/usr/local/lib/lv2" diff -Nru carla-2.5.4/source/modules/lilv/config/serd_config.h carla-2.5.5/source/modules/lilv/config/serd_config.h --- carla-2.5.4/source/modules/lilv/config/serd_config.h 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/modules/lilv/config/serd_config.h 2023-06-04 12:40:25.000000000 +0000 @@ -7,7 +7,7 @@ #define HAVE_FILENO 1 -#if defined(__APPLE__) || defined(__WIN32__) +#if defined(__APPLE__) || defined(_WIN32) // nothing #elif defined(__HAIKU__) #define HAVE_POSIX_MEMALIGN 1 diff -Nru carla-2.5.4/source/modules/lilv/Makefile carla-2.5.5/source/modules/lilv/Makefile --- carla-2.5.4/source/modules/lilv/Makefile 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/modules/lilv/Makefile 2023-06-04 12:40:25.000000000 +0000 @@ -110,22 +110,22 @@ $(OBJDIR)/sord.c.o: sord.c -@mkdir -p $(OBJDIR) @echo "Compiling $<" - $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src -c -o $@ + $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src -fno-strict-aliasing -c -o $@ $(OBJDIR)/sord.c.%32.o: sord.c -@mkdir -p $(OBJDIR) @echo "Compiling $< (32bit)" - $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src $(32BIT_FLAGS) -c -o $@ + $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src -fno-strict-aliasing $(32BIT_FLAGS) -c -o $@ $(OBJDIR)/sord.c.%64.o: sord.c -@mkdir -p $(OBJDIR) @echo "Compiling $< (64bit)" - $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src $(64BIT_FLAGS) -c -o $@ + $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src -fno-strict-aliasing $(64BIT_FLAGS) -c -o $@ $(OBJDIR)/sord.c.arm32.o: sord.c -@mkdir -p $(OBJDIR) @echo "Compiling $< (ARM32)" - $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src $(ARM32_FLAGS) -c -o $@ + $(SILENT)$(CC) $< $(BUILD_C_FLAGS) -Isord-$(SORD_VERSION) -Isord-$(SORD_VERSION)/src -fno-strict-aliasing $(ARM32_FLAGS) -c -o $@ # --------------------------------------------------------------------------------------------------------------------- diff -Nru carla-2.5.4/source/plugin/Makefile carla-2.5.5/source/plugin/Makefile --- carla-2.5.4/source/plugin/Makefile 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/plugin/Makefile 2023-06-04 12:40:25.000000000 +0000 @@ -137,6 +137,7 @@ SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_create_native_plugin_host_handle SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_host_handle_free SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_plugin_engine +SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_folder SYMBOLS_LV2 = -Wl,-exported_symbol,_lv2_descriptor ifeq ($(HAVE_PYQT),true) SYMBOLS_LV2 += -Wl,-exported_symbol,_lv2ui_descriptor diff -Nru carla-2.5.4/source/tests/Makefile carla-2.5.5/source/tests/Makefile --- carla-2.5.4/source/tests/Makefile 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/tests/Makefile 2023-06-04 12:40:25.000000000 +0000 @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------------------------------------------------- -BASE_FLAGS += -DBUILDING_CARLA -DREAL_BUILD +BASE_FLAGS += -DBUILDING_CARLA BASE_FLAGS += -I. -I.. -I../backend -I../includes -I../modules -I../utils BUILD_CXX_FLAGS += -I$(CWD)/modules diff -Nru carla-2.5.4/source/utils/CarlaBackendUtils.hpp carla-2.5.5/source/utils/CarlaBackendUtils.hpp --- carla-2.5.4/source/utils/CarlaBackendUtils.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaBackendUtils.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Backend utils - * Copyright (C) 2011-2021 Filipe Coelho + * Copyright (C) 2011-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -51,7 +51,7 @@ } carla_stderr("CarlaBackend::PluginOption2Str(%i) - invalid option", option); - return nullptr; + return ""; } // ----------------------------------------------------------------------- @@ -76,7 +76,7 @@ } carla_stderr("CarlaBackend::BinaryType2Str(%i) - invalid type", type); - return nullptr; + return ""; } static inline @@ -93,7 +93,7 @@ } carla_stderr("CarlaBackend::FileType2Str(%i) - invalid type", type); - return nullptr; + return ""; } static inline @@ -132,7 +132,7 @@ } carla_stderr("CarlaBackend::PluginType2Str(%i) - invalid type", type); - return nullptr; + return ""; } static inline @@ -163,7 +163,7 @@ } carla_stderr("CarlaBackend::PluginCategory2Str(%i) - invalid category", category); - return nullptr; + return ""; } static inline @@ -180,7 +180,7 @@ } carla_stderr("CarlaBackend::ParameterType2Str(%i) - invalid type", type); - return nullptr; + return ""; } static inline @@ -211,7 +211,7 @@ } carla_stderr("CarlaBackend::InternalParameterIndex2Str(%i) - invalid index", index); - return nullptr; + return ""; } static inline @@ -324,7 +324,7 @@ } carla_stderr("CarlaBackend::EngineCallbackOpcode2Str(%i) - invalid opcode", opcode); - return nullptr; + return ""; } static inline @@ -413,7 +413,7 @@ } carla_stderr("CarlaBackend::EngineOption2Str(%i) - invalid option", option); - return nullptr; + return ""; } static inline @@ -434,7 +434,7 @@ } carla_stderr("CarlaBackend::EngineProcessMode2Str(%i) - invalid mode", mode); - return nullptr; + return ""; } static inline @@ -455,7 +455,7 @@ } carla_stderr("CarlaBackend::EngineTransportMode2Str(%i) - invalid mode", mode); - return nullptr; + return ""; } static inline @@ -472,7 +472,7 @@ } carla_stderr("CarlaBackend::FileCallbackOpcode2Str(%i) - invalid opcode", opcode); - return nullptr; + return ""; } static inline @@ -495,12 +495,40 @@ } carla_stderr("CarlaBackend::PatchbayIcon2Str(%i) - invalid icon", icon); - return nullptr; + return ""; } // ----------------------------------------------------------------------- static inline +const char* getBinaryTypeAsString(const BinaryType type) noexcept +{ + carla_debug("CarlaBackend::getBinaryTypeAsString(%i:%s)", type, BinaryType2Str(type)); + + if (type == BINARY_NATIVE) + return "native"; + + switch (type) + { + case BINARY_NONE: + return "none"; + case BINARY_POSIX32: + return "posix32"; + case BINARY_POSIX64: + return "posix64"; + case BINARY_WIN32: + return "win32"; + case BINARY_WIN64: + return "win64"; + case BINARY_OTHER: + return "other"; + } + + carla_stderr("CarlaBackend::getBinaryTypeAsString(%i) - invalid type", type); + return "NONE"; +} + +static inline BinaryType getBinaryTypeFromString(const char* const ctype) noexcept { CARLA_SAFE_ASSERT_RETURN(ctype != nullptr && ctype[0] != '\0', BINARY_NONE); @@ -525,6 +553,8 @@ return BINARY_WIN32; if (stype == "win64") return BINARY_WIN64; + if (stype == "other") + return BINARY_OTHER; carla_stderr("CarlaBackend::getBinaryTypeFromString(\"%s\") - invalid string type", ctype); return BINARY_NONE; @@ -566,6 +596,39 @@ } static inline +PluginCategory getPluginCategoryFromString(const char* const category) noexcept +{ + CARLA_SAFE_ASSERT_RETURN(category != nullptr && category[0] != '\0', PLUGIN_CATEGORY_NONE); + carla_debug("CarlaBackend::getPluginCategoryFromString(\"%s\")", category); + + if (std::strcmp(category, "none") == 0) + return PLUGIN_CATEGORY_NONE; + if (std::strcmp(category, "synth") == 0) + return PLUGIN_CATEGORY_SYNTH; + if (std::strcmp(category, "delay") == 0) + return PLUGIN_CATEGORY_DELAY; + if (std::strcmp(category, "eq") == 0) + return PLUGIN_CATEGORY_EQ; + if (std::strcmp(category, "filter") == 0) + return PLUGIN_CATEGORY_FILTER; + if (std::strcmp(category, "distortion") == 0) + return PLUGIN_CATEGORY_DISTORTION; + if (std::strcmp(category, "dynamics") == 0) + return PLUGIN_CATEGORY_DYNAMICS; + if (std::strcmp(category, "modulator") == 0) + return PLUGIN_CATEGORY_MODULATOR; + if (std::strcmp(category, "utility") == 0) + return PLUGIN_CATEGORY_UTILITY; + if (std::strcmp(category, "other") == 0) + return PLUGIN_CATEGORY_OTHER; + + carla_stderr("CarlaBackend::getPluginCategoryFromString(\"%s\") - invalid category", category); + return PLUGIN_CATEGORY_NONE; +} + +// ----------------------------------------------------------------------- + +static inline const char* getPluginTypeAsString(const PluginType type) noexcept { carla_debug("CarlaBackend::getPluginTypeAsString(%i:%s)", type, PluginType2Str(type)); diff -Nru carla-2.5.4/source/utils/CarlaBinaryUtils.hpp carla-2.5.5/source/utils/CarlaBinaryUtils.hpp --- carla-2.5.4/source/utils/CarlaBinaryUtils.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaBinaryUtils.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla binary utils - * Copyright (C) 2014-2022 Filipe Coelho + * Copyright (C) 2014-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -21,7 +21,12 @@ #include "CarlaBackend.h" #include "CarlaScopeUtils.hpp" -#include "water/files/FileInputStream.h" +#if defined(BUILDING_CARLA) +# include "water/files/FileInputStream.h" +#elif defined(CARLA_UTILS_USE_QT) +# include +# include +#endif #if defined(HAVE_LIBMAGIC) && ! defined(BUILD_BRIDGE_ALTERNATIVE_ARCH) # include @@ -80,7 +85,7 @@ if (filename == nullptr || filename[0] == '\0') return BINARY_NATIVE; -#if defined(HAVE_LIBMAGIC) && ! defined(BUILD_BRIDGE_ALTERNATIVE_ARCH) + #if defined(HAVE_LIBMAGIC) && ! defined(BUILD_BRIDGE_ALTERNATIVE_ARCH) static const CarlaMagic magic; const char* const output(magic.getFileDescription(filename)); @@ -101,7 +106,7 @@ ? BINARY_POSIX64 : BINARY_POSIX32; -# ifdef CARLA_OS_MAC + #ifdef CARLA_OS_MAC if (std::strcmp(output, "directory") == 0) if (const char* const binary = findBinaryInBundle(filename)) return getBinaryTypeFromFile(binary); @@ -121,26 +126,36 @@ } carla_debug("getBinaryTypeFromFile(\"%s\") - have output:\n%s", filename, output); -# endif + #endif return BINARY_NATIVE; } -#endif + #endif + #if defined(BUILDING_CARLA) || defined(CARLA_UTILS_USE_QT) + #if defined(CARLA_UTILS_USE_QT) + QFile file(QString::fromUtf8(filename)); + CARLA_SAFE_ASSERT_RETURN(file.open(QIODevice::ReadOnly), BINARY_NATIVE); + #else using water::File; using water::FileInputStream; CarlaScopedPointer stream(File(filename).createInputStream()); CARLA_SAFE_ASSERT_RETURN(stream != nullptr && ! stream->failedToOpen(), BINARY_NATIVE); + #endif // ---------------------------------------------------------------------------------------------------------------- // binary type code based on Ardour's dll_info function // See https://github.com/Ardour/ardour/blob/master/libs/ardour/plugin_manager.cc#L867,L925 // Copyright (C) 2000-2006 Paul Davis + #if defined(CARLA_UTILS_USE_QT) + char buf[68]; + if (file.read(buf, 68) != 68) + #else uint8_t buf[68]; - if (stream->read(buf, 68) != 68) + #endif return BINARY_NATIVE; if (buf[0] != 'M' && buf[1] != 'Z') @@ -149,10 +164,18 @@ const int32_t* const pe_hdr_off_ptr = (int32_t*)&buf[60]; const int32_t pe_hdr_off = *pe_hdr_off_ptr; + #if defined(CARLA_UTILS_USE_QT) + if (! file.seek(pe_hdr_off)) + #else if (! stream->setPosition(pe_hdr_off)) + #endif return BINARY_NATIVE; + #if defined(CARLA_UTILS_USE_QT) + if (file.read(buf, 6) != 6) + #else if (stream->read(buf, 6) != 6) + #endif return BINARY_NATIVE; if (buf[0] != 'P' && buf[1] != 'E') @@ -170,6 +193,9 @@ default: return BINARY_NATIVE; } + #else + return BINARY_NATIVE; + #endif } // -------------------------------------------------------------------------------------------------------------------- diff -Nru carla-2.5.4/source/utils/CarlaBridgeDefines.hpp carla-2.5.5/source/utils/CarlaBridgeDefines.hpp --- carla-2.5.4/source/utils/CarlaBridgeDefines.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaBridgeDefines.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Bridge definitions - * Copyright (C) 2013-2022 Filipe Coelho + * Copyright (C) 2013-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -24,7 +24,15 @@ #define CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM 6 // current API version, bumped when something is added -#define CARLA_PLUGIN_BRIDGE_API_VERSION_CURRENT 9 +#define CARLA_PLUGIN_BRIDGE_API_VERSION_CURRENT 10 + +// ------------------------------------------------------------------------------------------------------------------- + +#ifdef CARLA_PROPER_CPP11_SUPPORT +# include +#else +# include +#endif // ------------------------------------------------------------------------------------------------------------------- @@ -81,6 +89,8 @@ kPluginBridgeNonRtClientSetWindowTitle, // uint/size, str[] // stuff added in API 9 kPluginBridgeNonRtClientEmbedUI, // ulong + // stuff added in API 10 + kPluginBridgeNonRtClientReload, }; // Client sends these to server during non-RT @@ -109,16 +119,16 @@ kPluginBridgeNonRtServerMidiProgramData, // uint/index, uint/bank, uint/program, uint/size, str[] (name) kPluginBridgeNonRtServerSetCustomData, // uint/size, str[], uint/size, str[], uint/size, str[] kPluginBridgeNonRtServerSetChunkDataFile, // uint/size, str[] (filename, base64 content) - kPluginBridgeNonRtServerSetLatency, // uint + kPluginBridgeNonRtServerSetLatency, // uint/latency kPluginBridgeNonRtServerSetParameterText, // uint/index, uint/size, str[] (name) kPluginBridgeNonRtServerReady, kPluginBridgeNonRtServerSaved, kPluginBridgeNonRtServerUiClosed, kPluginBridgeNonRtServerError, // uint/size, str[] // stuff added in API 7 - kPluginBridgeNonRtServerVersion, // uint + kPluginBridgeNonRtServerVersion, // uint/version // stuff added in API 9 - kPluginBridgeNonRtServerRespEmbedUI, // ulong + kPluginBridgeNonRtServerRespEmbedUI, // ulong/window-id kPluginBridgeNonRtServerResizeEmbedUI, // uint/width, uint/height }; diff -Nru carla-2.5.4/source/utils/CarlaBridgeUtils.cpp carla-2.5.5/source/utils/CarlaBridgeUtils.cpp --- carla-2.5.4/source/utils/CarlaBridgeUtils.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaBridgeUtils.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -64,8 +64,8 @@ bool BridgeAudioPool::initializeServer() noexcept { - char tmpFileBase[64]; - std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_AUDIO_POOL "XXXXXX"); + char tmpFileBase[64] = {}; + std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_AUDIO_POOL "XXXXXX"); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); @@ -167,8 +167,8 @@ bool BridgeRtClientControl::initializeServer() noexcept { - char tmpFileBase[64]; - std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_RT_CLIENT "XXXXXX"); + char tmpFileBase[64] = {}; + std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_RT_CLIENT "XXXXXX"); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); @@ -337,8 +337,8 @@ bool BridgeNonRtClientControl::initializeServer() noexcept { - char tmpFileBase[64]; - std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_CLIENT "XXXXXX"); + char tmpFileBase[64] = {}; + std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_CLIENT "XXXXXX"); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); @@ -477,8 +477,8 @@ bool BridgeNonRtServerControl::initializeServer() noexcept { - char tmpFileBase[64]; - std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_SERVER "XXXXXX"); + char tmpFileBase[64] = {}; + std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_SERVER "XXXXXX"); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); diff -Nru carla-2.5.4/source/utils/CarlaBridgeUtils.hpp carla-2.5.5/source/utils/CarlaBridgeUtils.hpp --- carla-2.5.4/source/utils/CarlaBridgeUtils.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaBridgeUtils.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -59,7 +59,7 @@ } carla_stderr("CarlaBackend::PluginBridgeRtClientOpcode2str(%i) - invalid opcode", opcode); - return nullptr; + return ""; } static inline @@ -129,10 +129,12 @@ return "kPluginBridgeNonRtClientSetWindowTitle"; case kPluginBridgeNonRtClientEmbedUI: return "kPluginBridgeNonRtClientEmbedUI"; + case kPluginBridgeNonRtClientReload: + return "kPluginBridgeNonRtClientReload"; } carla_stderr("CarlaBackend::PluginBridgeNonRtClientOpcode2str(%i) - invalid opcode", opcode); - return nullptr; + return ""; } static inline @@ -209,7 +211,7 @@ } carla_stderr("CarlaBackend::PluginBridgeNonRtServerOpcode2str%i) - invalid opcode", opcode); - return nullptr; + return ""; } // ------------------------------------------------------------------------------------------------------------------- @@ -238,7 +240,7 @@ // ------------------------------------------------------------------------------------------------------------------- -struct BridgeAudioPool { +struct CARLA_API BridgeAudioPool { float* data; std::size_t dataSize; CarlaString filename; @@ -261,7 +263,7 @@ // ------------------------------------------------------------------------------------------------------------------- -struct BridgeRtClientControl : public CarlaRingBufferControl { +struct CARLA_API BridgeRtClientControl : public CarlaRingBufferControl { BridgeRtClientData* data; CarlaString filename; bool needsSemDestroy; // client only @@ -301,7 +303,7 @@ // ------------------------------------------------------------------------------------------------------------------- -struct BridgeNonRtClientControl : public CarlaRingBufferControl { +struct CARLA_API BridgeNonRtClientControl : public CarlaRingBufferControl { BridgeNonRtClientData* data; CarlaString filename; CarlaMutex mutex; @@ -330,7 +332,7 @@ // ------------------------------------------------------------------------------------------------------------------- -struct BridgeNonRtServerControl : public CarlaRingBufferControl { +struct CARLA_API BridgeNonRtServerControl : public CarlaRingBufferControl { BridgeNonRtServerData* data; CarlaString filename; CarlaMutex mutex; diff -Nru carla-2.5.4/source/utils/CarlaLv2Utils.hpp carla-2.5.5/source/utils/CarlaLv2Utils.hpp --- carla-2.5.4/source/utils/CarlaLv2Utils.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaLv2Utils.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -83,7 +83,7 @@ #include "lv2_rdf.hpp" -#ifdef USE_QT +#ifdef CARLA_UTILS_USE_QT # include #else # include "water/text/StringArray.h" @@ -1822,7 +1822,7 @@ if (replaceNode.is_uri()) { -#ifdef USE_QT + #ifdef CARLA_UTILS_USE_QT const QString replaceURI(replaceNode.as_uri()); if (replaceURI.startsWith("urn:")) @@ -1835,7 +1835,7 @@ if (ok && uniqueId != 0) rdfDescriptor->UniqueID = uniqueId; } -#else + #else const water::String replaceURI(replaceNode.as_uri()); if (replaceURI.startsWith("urn:")) @@ -1845,7 +1845,7 @@ if (uniqueId > 0) rdfDescriptor->UniqueID = static_cast(uniqueId); } -#endif + #endif } } @@ -2752,7 +2752,7 @@ if (presetNodes.size() > 0) { // create a list of preset URIs (for sorting and unique-ness) -#ifdef USE_QT + #ifdef CARLA_UTILS_USE_QT QStringList presetListURIs; LILV_FOREACH(nodes, it, presetNodes) @@ -2768,7 +2768,7 @@ presetListURIs.sort(); rdfDescriptor->PresetCount = static_cast(presetListURIs.count()); -#else + #else water::StringArray presetListURIs; LILV_FOREACH(nodes, it, presetNodes) @@ -2784,7 +2784,7 @@ presetListURIs.sortNatural(); rdfDescriptor->PresetCount = static_cast(presetListURIs.size()); -#endif + #endif // create presets with unique URIs rdfDescriptor->Presets = new LV2_RDF_Preset[rdfDescriptor->PresetCount]; @@ -2813,11 +2813,11 @@ if (presetLabelNodes.size() > 0) { -#ifdef USE_QT - const int index(presetListURIs.indexOf(QString(presetURI))); -#else - const int index(presetListURIs.indexOf(water::String(presetURI))); -#endif + #ifdef CARLA_UTILS_USE_QT + const int index = presetListURIs.indexOf(QString(presetURI)); + #else + const int index = presetListURIs.indexOf(water::String(presetURI)); + #endif CARLA_SAFE_ASSERT_CONTINUE(index >= 0 && index < static_cast(rdfDescriptor->PresetCount)); LV2_RDF_Preset* const rdfPreset(&rdfDescriptor->Presets[index]); diff -Nru carla-2.5.4/source/utils/CarlaMacUtils.cpp carla-2.5.5/source/utils/CarlaMacUtils.cpp --- carla-2.5.4/source/utils/CarlaMacUtils.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaMacUtils.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla macOS utils - * Copyright (C) 2018-2022 Filipe Coelho + * Copyright (C) 2018-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -15,6 +15,8 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ +#include "CarlaDefines.h" + #ifdef CARLA_OS_MAC #include "CarlaMacUtils.hpp" diff -Nru carla-2.5.4/source/utils/CarlaMacUtils.hpp carla-2.5.5/source/utils/CarlaMacUtils.hpp --- carla-2.5.4/source/utils/CarlaMacUtils.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaMacUtils.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla macOS utils - * Copyright (C) 2018-2022 Filipe Coelho + * Copyright (C) 2018-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -34,17 +34,17 @@ /* * ... */ -void initStandaloneApplication(); +CARLA_API void initStandaloneApplication(); /* * ... */ -const char* findBinaryInBundle(const char* const bundleDir); +CARLA_API const char* findBinaryInBundle(const char* const bundleDir); /* * ... */ -bool removeFileFromQuarantine(const char* const filename); +CARLA_API bool removeFileFromQuarantine(const char* const filename); // -------------------------------------------------------------------------------------------------------------------- diff -Nru carla-2.5.4/source/utils/CarlaMainLoop.hpp carla-2.5.5/source/utils/CarlaMainLoop.hpp --- carla-2.5.4/source/utils/CarlaMainLoop.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaMainLoop.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -40,7 +40,11 @@ for (;;) { event = [NSApp + #ifdef __MAC_10_12 + nextEventMatchingMask:NSEventMaskAny + #else nextEventMatchingMask:NSAnyEventMask + #endif untilDate:date inMode:NSDefaultRunLoopMode dequeue:YES]; diff -Nru carla-2.5.4/source/utils/CarlaMutex.hpp carla-2.5.5/source/utils/CarlaMutex.hpp --- carla-2.5.4/source/utils/CarlaMutex.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaMutex.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -27,7 +27,7 @@ // ----------------------------------------------------------------------- // CarlaMutex class -class CarlaMutex +class CARLA_API CarlaMutex { public: /* diff -Nru carla-2.5.4/source/utils/CarlaPipeUtils.cpp carla-2.5.5/source/utils/CarlaPipeUtils.cpp --- carla-2.5.4/source/utils/CarlaPipeUtils.cpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaPipeUtils.cpp 2023-06-04 12:40:25.000000000 +0000 @@ -1703,7 +1703,7 @@ pData->pipeRecv = pipeRecvClient; pData->pipeSend = pipeSendClient; pData->pipeClosed = false; - carla_stdout("ALL OK!"); + carla_debug("ALL OK!"); return true; } diff -Nru carla-2.5.4/source/utils/CarlaRingBuffer.hpp carla-2.5.5/source/utils/CarlaRingBuffer.hpp --- carla-2.5.4/source/utils/CarlaRingBuffer.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaRingBuffer.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -1,6 +1,6 @@ /* * Carla Ring Buffer - * Copyright (C) 2013-2022 Filipe Coelho + * Copyright (C) 2013-2023 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -62,21 +62,21 @@ }; struct SmallStackBuffer { - static const uint32_t size = 4096; + static constexpr const uint32_t size = 4096; uint32_t head, tail, wrtn; bool invalidateCommit; uint8_t buf[size]; }; struct BigStackBuffer { - static const uint32_t size = 16384; + static constexpr const uint32_t size = 16384; uint32_t head, tail, wrtn; bool invalidateCommit; uint8_t buf[size]; }; struct HugeStackBuffer { - static const uint32_t size = 65536; + static constexpr const uint32_t size = 65536; uint32_t head, tail, wrtn; bool invalidateCommit; uint8_t buf[size]; @@ -238,6 +238,42 @@ // ------------------------------------------------------------------- + void skipRead(const uint32_t size) noexcept + { + CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr,); + CARLA_SAFE_ASSERT_RETURN(size > 0,); + CARLA_SAFE_ASSERT_RETURN(size < fBuffer->size,); + + // empty + if (fBuffer->head == fBuffer->tail) + return; + + const uint32_t head = fBuffer->head; + const uint32_t tail = fBuffer->tail; + const uint32_t wrap = head > tail ? 0 : fBuffer->size; + + if (size > wrap + head - tail) + { + if (! fErrorReading) + { + fErrorReading = true; + carla_stderr2("CarlaRingBuffer::skipRead(%u): failed, not enough space", size); + } + return; + } + + uint32_t readto = tail + size; + + if (readto >= fBuffer->size) + readto -= fBuffer->size; + + fBuffer->tail = readto; + fErrorReading = false; + return; + } + + // ------------------------------------------------------------------- + bool writeBool(const bool value) noexcept { return tryWrite(&value, sizeof(bool)); @@ -320,14 +356,14 @@ bool tryRead(void* const buf, const uint32_t size) noexcept { CARLA_SAFE_ASSERT_RETURN(fBuffer != nullptr, false); - #if defined(__clang__) - # pragma clang diagnostic push - # pragma clang diagnostic ignored "-Wtautological-pointer-compare" - #endif + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-pointer-compare" + #endif CARLA_SAFE_ASSERT_RETURN(fBuffer->buf != nullptr, false); - #if defined(__clang__) - # pragma clang diagnostic pop - #endif + #if defined(__clang__) + #pragma clang diagnostic pop + #endif CARLA_SAFE_ASSERT_RETURN(buf != nullptr, false); CARLA_SAFE_ASSERT_RETURN(size > 0, false); CARLA_SAFE_ASSERT_RETURN(size < fBuffer->size, false); @@ -336,23 +372,23 @@ if (fBuffer->head == fBuffer->tail) return false; - uint8_t* const bytebuf(static_cast(buf)); + uint8_t* const bytebuf = static_cast(buf); - const uint32_t head(fBuffer->head); - const uint32_t tail(fBuffer->tail); - const uint32_t wrap((head > tail) ? 0 : fBuffer->size); + const uint32_t head = fBuffer->head; + const uint32_t tail = fBuffer->tail; + const uint32_t wrap = head > tail ? 0 : fBuffer->size; if (size > wrap + head - tail) { if (! fErrorReading) { fErrorReading = true; - carla_stderr2("CarlaRingBuffer::tryRead(%p, " P_SIZE "): failed, not enough space", buf, size); + carla_stderr2("CarlaRingBuffer::tryRead(%p, %u): failed, not enough space", buf, size); } return false; } - uint32_t readto(tail + size); + uint32_t readto = tail + size; if (readto > fBuffer->size) { @@ -364,7 +400,7 @@ } else { - const uint32_t firstpart(fBuffer->size - tail); + const uint32_t firstpart = fBuffer->size - tail; std::memcpy(bytebuf, fBuffer->buf + tail, firstpart); std::memcpy(bytebuf + firstpart, fBuffer->buf, readto); } @@ -389,24 +425,24 @@ CARLA_SAFE_ASSERT_RETURN(size > 0, false); CARLA_SAFE_ASSERT_UINT2_RETURN(size < fBuffer->size, size, fBuffer->size, false); - const uint8_t* const bytebuf(static_cast(buf)); + const uint8_t* const bytebuf = static_cast(buf); - const uint32_t tail(fBuffer->tail); - const uint32_t wrtn(fBuffer->wrtn); - const uint32_t wrap((tail > wrtn) ? 0 : fBuffer->size); + const uint32_t tail = fBuffer->tail; + const uint32_t wrtn = fBuffer->wrtn; + const uint32_t wrap = tail > wrtn ? 0 : fBuffer->size; if (size >= wrap + tail - wrtn) { if (! fErrorWriting) { fErrorWriting = true; - carla_stderr2("CarlaRingBuffer::tryWrite(%p, " P_SIZE "): failed, not enough space", buf, size); + carla_stderr2("CarlaRingBuffer::tryWrite(%p, %u): failed, not enough space", buf, size); } fBuffer->invalidateCommit = true; return false; } - uint32_t writeto(wrtn + size); + uint32_t writeto = wrtn + size; if (writeto > fBuffer->size) { @@ -418,7 +454,7 @@ } else { - const uint32_t firstpart(fBuffer->size - wrtn); + const uint32_t firstpart = fBuffer->size - wrtn; std::memcpy(fBuffer->buf + wrtn, bytebuf, firstpart); std::memcpy(fBuffer->buf, bytebuf + firstpart, writeto); } @@ -484,7 +520,7 @@ CARLA_SAFE_ASSERT_RETURN(fHeapBuffer.buf == nullptr,); CARLA_SAFE_ASSERT_RETURN(size > 0,); - const uint32_t p2size(carla_nextPowerOf2(size)); + const uint32_t p2size = carla_nextPowerOf2(size); try { fHeapBuffer.buf = new uint8_t[p2size]; diff -Nru carla-2.5.4/source/utils/CarlaString.hpp carla-2.5.5/source/utils/CarlaString.hpp --- carla-2.5.4/source/utils/CarlaString.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaString.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -26,7 +26,7 @@ // ----------------------------------------------------------------------- // CarlaString class -class CarlaString +class CARLA_API CarlaString { public: // ------------------------------------------------------------------- diff -Nru carla-2.5.4/source/utils/CarlaUtils.hpp carla-2.5.5/source/utils/CarlaUtils.hpp --- carla-2.5.4/source/utils/CarlaUtils.hpp 2023-03-08 19:26:24.000000000 +0000 +++ carla-2.5.5/source/utils/CarlaUtils.hpp 2023-06-04 12:40:25.000000000 +0000 @@ -34,6 +34,9 @@ #endif #ifdef CARLA_OS_WIN +# ifndef NOMINMAX +# define NOMINMAX +# endif # define WIN32_LEAN_AND_MEAN 1 # include # include