1 |
nagata |
1643 |
#!/bin/sh |
2 |
|
|
# linuxsampler.starter |
3 |
|
|
# In the binary distribution, this wrapper script is placed in the same |
4 |
|
|
# directory as qsampler.app. The "true" binary of linuxsampler is placed |
5 |
|
|
# as bin/linuxsampler. This wrapper script creates the default instrument |
6 |
|
|
# database if not present, starts the Jack server, launches the JackPilot |
7 |
|
|
# application via AppleScript, |
8 |
|
|
# and finally invokes the "true" binary of linuxsampler. |
9 |
|
|
# 1 Jan 2008 Toshi Nagata |
10 |
|
|
# 4 Jan 2008 Redirect stderr of osascript to /dev/null to avoid misleading |
11 |
|
|
# error messages (Toshi Nagata) |
12 |
|
|
|
13 |
|
|
# Set up the "base" directory |
14 |
|
|
COMNAME=`which "$0"` |
15 |
|
|
DIRNAME=`dirname "$COMNAME"` |
16 |
|
|
|
17 |
|
|
# Create database if not present |
18 |
|
|
if ! test -e $HOME/Library/linuxsampler/linuxsampler.db; then |
19 |
|
|
mkdir -p $HOME/Library/linuxsampler/plugins |
20 |
|
|
"$DIRNAME/bin/linuxsampler" --create-instruments-db $HOME/Library/linuxsampler/linuxsampler.db |
21 |
|
|
fi |
22 |
|
|
|
23 |
|
|
# Start jackd |
24 |
|
|
if test -e $HOME/.jackdrc; then |
25 |
|
|
# Collect the options |
26 |
|
|
jackopt=`awk '/^-/ { x = x $0 } END { print x }' $HOME/.jackdrc` |
27 |
|
|
else |
28 |
|
|
jackopt="-R -d coreaudio" |
29 |
|
|
fi |
30 |
|
|
/usr/local/bin/jackd $jackopt & # If already running, then it just exits |
31 |
|
|
|
32 |
|
|
# Start JackPilot |
33 |
|
|
# (Errors will be silently ignored) |
34 |
|
|
osascript -e 'tell application "JackPilot" to activate' -e 'tell application "qsampler" to activate' 2>/dev/null & |
35 |
|
|
|
36 |
|
|
# Invoke linuxsampler |
37 |
|
|
if test -e "$DIRNAME/bin/linuxsampler"; then |
38 |
|
|
exe="$DIRNAME/bin/linuxsampler" |
39 |
|
|
else |
40 |
|
|
exe="$DIRNAME/linuxsampler" |
41 |
|
|
fi |
42 |
|
|
exec "$exe" $@ |