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)
13
# Set up the "base" directory
15
DIRNAME=`dirname "$COMNAME"`
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
24
if test -e $HOME/.jackdrc; then
26
jackopt=`awk '/^-/ { x = x $0 } END { print x }' $HOME/.jackdrc`
28
jackopt="-R -d coreaudio"
30
/usr/local/bin/jackd $jackopt & # If already running, then it just exits
33
# (Errors will be silently ignored)
34
osascript -e 'tell application "JackPilot" to activate' -e 'tell application "qsampler" to activate' 2>/dev/null &
37
if test -e "$DIRNAME/bin/linuxsampler"; then
38
exe="$DIRNAME/bin/linuxsampler"
40
exe="$DIRNAME/linuxsampler"