Skip to content

Commit

Permalink
Path cleanup, set NSDocumentsFolderUsageDescription
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Feb 3, 2024
1 parent 5ba6deb commit 8d4e246
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/mod-ui
3 changes: 2 additions & 1 deletion src/systray/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions utils/cxfreeze/mod-ui-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
25 changes: 15 additions & 10 deletions utils/debug/jackd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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/")"
Expand Down
10 changes: 5 additions & 5 deletions utils/debug/mod-ui
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions utils/macos/app.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<false/>
<key>NSDocumentsFolderUsageDescription</key>
<string>MOD Desktop stores pedalboards and user files in the Documents folder.</string>
<key>NSMicrophoneUsageDescription</key>
<string>MOD Desktop requires microphone permissions for audio input.</string>
<key>CFBundleSupportedPlatforms</key>
Expand Down

0 comments on commit 8d4e246

Please sign in to comment.