Skip to content

Commit

Permalink
Setup file manager and user-files
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Jun 15, 2023
1 parent 2a9a5bc commit a2d7883
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "source/mod-sdk"]
path = source/mod-sdk
url = https://github.com/moddevices/mod-sdk.git
[submodule "source/browsepy"]
path = source/browsepy
url = https://github.com/moddevices/browsepy.git
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Simply clone this repository recursively (either with `git clone --recursive` or

```sh
make
./source/mod-panel
make run
```

Afterwards simply click on "Start" for MOD Host + UI or SDK, and then its ">" button to open a browser on the predefined location.
Expand Down
1 change: 1 addition & 0 deletions data/release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.14.0.0
1 change: 1 addition & 0 deletions source/browsepy
Submodule browsepy added at c22458
53 changes: 53 additions & 0 deletions source/browsepy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -e

cd $(dirname "${0}")/browsepy

# setup environment variables
WORKDIR=${WORKDIR:=~/mod-workdir}

export MOD_USER_FILES_DIR="${WORKDIR}/user-files"

# if coming through PawPaw, reset PATH
if [ -n "${OLD_PATH}" ]; then
export PATH="${OLD_PATH}"
else
export PATH="~/.local/bin:${PATH}"
fi

# check for pip3 tool
if ! command -v pip3 >/dev/null; then
echo "pip3 tool not available, cannot continue"
exit 1
fi

# install virtualenv as needed
if ! virtualenv --version 2>/dev/null; then
pip3 install virtualenv
fi

# activate virtualenv
virtualenv browsepy-env
source browsepy-env/bin/activate

# install required mod-ui dependencies in virtualenv
pip3 install -r requirements.txt

# create initial directories
mkdir -p "${MOD_USER_FILES_DIR}/Audio Loops"
mkdir -p "${MOD_USER_FILES_DIR}/Audio Recordings"
mkdir -p "${MOD_USER_FILES_DIR}/Audio Samples"
mkdir -p "${MOD_USER_FILES_DIR}/Audio Tracks"
mkdir -p "${MOD_USER_FILES_DIR}/MIDI Clips"
mkdir -p "${MOD_USER_FILES_DIR}/MIDI Songs"
mkdir -p "${MOD_USER_FILES_DIR}/Reverb IRs"
mkdir -p "${MOD_USER_FILES_DIR}/Speaker Cabinets IRs"
mkdir -p "${MOD_USER_FILES_DIR}/Hydrogen Drumkits"
mkdir -p "${MOD_USER_FILES_DIR}/SF2 Instruments"
mkdir -p "${MOD_USER_FILES_DIR}/SFZ Instruments"
mkdir -p "${MOD_USER_FILES_DIR}/Aida DSP Models"
mkdir -p "${MOD_USER_FILES_DIR}/NAM Models"

# start browsepy inside virtualenv
exec python3 -c "from browsepy.__main__ import main; main()" --directory "${MOD_USER_FILES_DIR}" --upload "${MOD_USER_FILES_DIR}" --removable "${MOD_USER_FILES_DIR}" 127.0.0.1 8081
2 changes: 1 addition & 1 deletion source/mod-host
2 changes: 1 addition & 1 deletion source/mod-sdk
3 changes: 1 addition & 2 deletions source/mod-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cd $(dirname "${0}")/mod-sdk

# TODO setup MOD_DEVICE_MODE
# TODO setup MOD_DATA_DIR
# TODO setup LV2_PATH

# if coming through PawPaw, reset PATH
if [ -n "${OLD_PATH}" ]; then
Expand All @@ -16,7 +15,7 @@ else
fi

# check for pip3 tool
if ! which pip3 1>/dev/null 2>/dev/null; then
if ! command -v pip3 >/dev/null; then
echo "pip3 tool not available, cannot continue"
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion source/mod-ui
10 changes: 7 additions & 3 deletions source/mod-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ set -e

cd $(dirname "${0}")/mod-ui

# setup environment variables
WORKDIR=${WORKDIR:=~/mod-workdir}

export MOD_DEV_ENVIRONMENT=0
export MOD_LOG=1

export MOD_IMAGE_VERSION_PATH="${PWD}/../../data/release"
export MOD_USER_FILES_DIR="${WORKDIR}/user-files"

# TODO setup MOD_DATA_DIR
# TODO setup LV2_PATH
# TODO setup MOD_LOG

# if coming through PawPaw, reset PATH
if [ -n "${OLD_PATH}" ]; then
Expand All @@ -19,7 +23,7 @@ else
fi

# check for pip3 tool
if ! which pip3 1>/dev/null 2>/dev/null; then
if ! command -v pip3 >/dev/null; then
echo "pip3 tool not available, cannot continue"
exit 1
fi
Expand Down

0 comments on commit a2d7883

Please sign in to comment.