30 lines
1.2 KiB
Bash
30 lines
1.2 KiB
Bash
#!/bin/zsh
|
|||
|
|
# Adds the status panel's commands to AbletonOSC on this Mac (the Tracks Mac) and reloads AbletonOSC.
|
||
|
|
# Run from NA Ingest: ssh tracks 'zsh -s' < install.sh (statuspanel.py copied next to AbletonOSC first)
|
||
|
|
# Reloading clears AbletonOSC's listeners: reconnect Companion's AbletonOSC connection afterwards.
|
||
|
|
set -e
|
||
|
|
D="$HOME/Music/Ableton/User Library/Remote Scripts/AbletonOSC/abletonosc"
|
||
|
|
cp /tmp/statuspanel.py "$D/statuspanel.py"
|
||
|
|
if ! grep -q "statuspanel" "$D/__init__.py"; then
|
||
|
|
cat >> "$D/__init__.py" <<'PY'
|
||
|
|
|
||
|
|
# The status panel's commands (status-indicators tools/abletonosc): registered with the track handler.
|
||
|
|
try:
|
||
|
|
import importlib as _importlib
|
||
|
|
from . import statuspanel as _statuspanel
|
||
|
|
_importlib.reload(_statuspanel)
|
||
|
|
|
||
|
|
class TrackHandler(TrackHandler):
|
||
|
|
def init_api(self):
|
||
|
|
super().init_api()
|
||
|
|
try:
|
||
|
|
_statuspanel.register(self)
|
||
|
|
except Exception:
|
||
|
|
logger.exception("statuspanel: not registered")
|
||
|
|
except Exception:
|
||
|
|
logger.exception("statuspanel: not loaded")
|
||
|
|
PY
|
||
|
|
fi
|
||
|
|
/usr/bin/python3 -c 'import socket; s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM); s.sendto(b"/live/api/reload\0\0\0\0,\0\0\0", ("127.0.0.1", 11000))'
|
||
|
|
echo "installed and reloaded"
|