From 8d4e2463a1fa1edd4c7b637dcd5b043e019ba33e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 3 Feb 2024 21:16:49 +0100 Subject: [PATCH] Path cleanup, set NSDocumentsFolderUsageDescription Signed-off-by: falkTX --- src/mod-ui | 2 +- src/systray/utils.cpp | 3 ++- utils/cxfreeze/mod-ui-setup.py | 2 -- utils/debug/jackd | 25 +++++++++++++++---------- utils/debug/mod-ui | 10 +++++----- utils/macos/app.plist.in | 2 ++ 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/mod-ui b/src/mod-ui index 8905ca6..99d9aa2 160000 --- a/src/mod-ui +++ b/src/mod-ui @@ -1 +1 @@ -Subproject commit 8905ca6e8bc043bdeaaa0ed03b569e1c1ee0157a +Subproject commit 99d9aa25083568c56cf584c8ee40d467268296c5 diff --git a/src/systray/utils.cpp b/src/systray/utils.cpp index 8b163f2..facf7a6 100644 --- a/src/systray/utils.cpp +++ b/src/systray/utils.cpp @@ -163,7 +163,8 @@ void initEvironment() std::strncpy(path + dataDirLen, "/lv2:", PATH_MAX - dataDirLen - 1); std::strncat(path, appDir, PATH_MAX - 1); #ifdef __APPLE__ - std::strncat(path, "/../PlugIns/LV2", PATH_MAX - 1); + path[dataDirLen + 5 + appDirLen - 5] = '\0'; // remove "MacOS" + std::strncat(path, "PlugIns/LV2", PATH_MAX - 1); #else std::strncat(path, "/plugins", PATH_MAX - 1); #endif diff --git a/utils/cxfreeze/mod-ui-setup.py b/utils/cxfreeze/mod-ui-setup.py index 8616efb..15fd8dc 100644 --- a/utils/cxfreeze/mod-ui-setup.py +++ b/utils/cxfreeze/mod-ui-setup.py @@ -22,10 +22,8 @@ sys.path = [ROOT] + sys.path if sys.platform == 'darwin': - lv2dir = os.path.join(ROOT, '..', 'PlugIns', 'LV2') resdir = os.path.join(ROOT, '..', 'Resources') else: - lv2dir = os.path.join(ROOT, 'plugins') resdir = ROOT os.environ['MOD_APP'] = '1' diff --git a/utils/debug/jackd b/utils/debug/jackd index 18e8a63..c655525 100755 --- a/utils/debug/jackd +++ b/utils/debug/jackd @@ -15,16 +15,21 @@ function convert_path() { } if [ -e mod-desktop.app ]; then - DOCS_DIR=~/Documents + DOCS_DIR="${HOME}/Documents" else - DOCS_DIR=$(xdg-user-dir DOCUMENTS) + DOCS_DIR="$(xdg-user-dir DOCUMENTS)" fi if [ -e jackd.exe ]; then source ../src/PawPaw/local.env win64 JACKD="wine jackd.exe" - JACK_DRIVER="portaudio" - JACK_DRIVER_OPTS="-d \"ASIO::WineASIO Driver\"" + if ! jack_wait -c | grep -q "not running"; then + JACK_DRIVER="portaudio" + JACK_DRIVER_OPTS="-d \"ASIO::WineASIO Driver\"" + else + JACK_DRIVER="dummy" + JACK_DRIVER_OPTS="" + fi JACK_SESSION="-C ./jack/jack-session.conf -X winmme" PATH_SEP=';' elif [ -e mod-desktop.app ]; then @@ -33,16 +38,16 @@ elif [ -e mod-desktop.app ]; then else source ../src/PawPaw/local.env macos-universal-10.15 fi - JACKD="./mod-desktop.app/Contents/MacOS/jackd" + JACKD="$(pwd)/mod-desktop.app/Contents/MacOS/jackd" JACK_DRIVER="coreaudio" - JACK_DRIVER_OPTS="-P BuiltInSpeakerDevice" + JACK_DRIVER_OPTS="-P default" JACK_SESSION="-C ./mod-desktop.app/Contents/MacOS/jack/jack-session.conf -X coremidi" PATH_SEP=':' export DYLD_LIBRARY_PATH="${PAWPAW_PREFIX}/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}" export JACK_DRIVER_DIR="$(pwd)/mod-desktop.app/Contents/MacOS/jack" else source ../src/PawPaw/local.env linux - JACKD="./jackd" + JACKD="$(pwd)/jackd" if ! jack_wait -c | grep -q "not running"; then JACK_DRIVER="portaudio" JACK_DRIVER_OPTS="-d JACK::system" @@ -57,12 +62,12 @@ else export JACK_DRIVER_DIR="$(pwd)/jack" fi +LV2_PATH="$(convert_path "${DOCS_DIR}/MOD Desktop/lv2")" if [ -e mod-desktop.app ]; then - LV2_PATH="$(convert_path $(pwd)/mod-desktop.app/Contents/PlugIns/LV2)" + LV2_PATH+=":$(convert_path $(pwd)/mod-desktop.app/Contents/PlugIns/LV2)" else - LV2_PATH="$(convert_path $(pwd)/plugins)" + LV2_PATH="${PATH_SEP}$(convert_path $(pwd)/plugins)" fi -LV2_PATH+="${PATH_SEP}$(convert_path "${DOCS_DIR}/MOD Desktop/lv2")" export LV2_PATH export MOD_KEYS_PATH="$(convert_path "${DOCS_DIR}/MOD Desktop/keys/")" diff --git a/utils/debug/mod-ui b/utils/debug/mod-ui index 29a6c86..b3bcc55 100755 --- a/utils/debug/mod-ui +++ b/utils/debug/mod-ui @@ -32,19 +32,19 @@ else fi if [ -e mod-desktop.app ]; then - DOCS_DIR=~/Documents + DOCS_DIR="${HOME}/Documents" else - DOCS_DIR=$(xdg-user-dir DOCUMENTS) + DOCS_DIR="$(xdg-user-dir DOCUMENTS)" fi PYTHON="${EXE_WRAPPER} ${PAWPAW_PREFIX}/bin/python3${APP_EXT}" +LV2_PATH="$(convert_path "${DOCS_DIR}/MOD Desktop/lv2")" if [ -e mod-desktop.app ]; then - LV2_PATH="$(convert_path $(pwd)/mod-desktop.app/Contents/PlugIns/LV2)" + LV2_PATH+=":$(convert_path $(pwd)/mod-desktop.app/Contents/PlugIns/LV2)" else - LV2_PATH="$(convert_path $(pwd)/plugins)" + LV2_PATH="${PATH_SEP}$(convert_path $(pwd)/plugins)" fi -LV2_PATH+="${PATH_SEP}$(convert_path "${DOCS_DIR}/MOD Desktop/lv2")" export LV2_PATH export MOD_APP=1 diff --git a/utils/macos/app.plist.in b/utils/macos/app.plist.in index a3b3d7c..eb4d454 100644 --- a/utils/macos/app.plist.in +++ b/utils/macos/app.plist.in @@ -18,6 +18,8 @@ NSRequiresAquaSystemAppearance + NSDocumentsFolderUsageDescription + MOD Desktop stores pedalboards and user files in the Documents folder. NSMicrophoneUsageDescription MOD Desktop requires microphone permissions for audio input. CFBundleSupportedPlatforms