98
102
for index in $*; do
99
if [ $index = "-r" ]; then
100
index=$((index + 11))
103
if [ $index = "-n" ]; then
104
index=$((index + 11))
107
if [ $index = "-p" ]; then
108
index=$((index + 11))
111
if [ $index = "-synth" ]; then
112
index=$((index + 11))
115
if [ $index = "-midi" ]; then
116
index=$((index + 11))
103
if [ $index = "-port" ]; then
107
if [ $index = "-summary" ]; then
120
111
if [ $index = "-master" ]; then
123
114
if [ $index = "-engine" ]; then
117
if [ $index = "-gui" ]; then
126
120
if [ $index = "-v" ]; then
206
201
# Try and get Jack driver information. If the daemon is running, use it. If
207
202
# user has a .jackdrc use that, otherwise use /etc/jackdrc
209
# Thanks to Sylvain Robitaille for this code.
211
204
if [ ${DRIVER} == "-jack" ]; then
213
# See if the process is running
215
JACKD=`ps ax | grep -w jackd | grep -vw grep`
218
# Otherwise see what would be started
220
if [ -z "${JACKD}" ]; then
221
echo "jack driver requested, jackd not running"
223
if [ -f /etc/jackdrc ]; then
224
echo "jack configuration found in /etc/jackdrc"
225
JACKD=`cat /etc/jackdrc`
228
if [ -f ~/.jackdrc ]; then
229
echo "private jack configuration found in ~/.jackdrc"
230
JACKD=`cat ~/.jackdrc`
234
if [ -z "${JACKD}" ]; then
205
JACKPARAMS=`bristoljackstats 2>&1 | awk '/JACKSTATS/'`
208
RATE=`echo ${JACKPARAMS} | awk '{print $2}'`
209
COUNT=`echo ${JACKPARAMS} | awk '{print $3}'`
211
echo jackstats found -rate ${RATE} -count ${COUNT}
238
RATE=`echo ${JACKD} |grep -o -- '-r[0-9][0-9]*' |sed 's/^-r//'`
240
if [ -z "${RATE}" ]; then
241
# assume Jackd's default rate:
214
# We should not really get here. If jack was requested but the daemon
215
# could not be reached (we did not get feedback from bristoljackstats)
216
# then larger issues will occur presently
218
# Thanks to Sylvain Robitaille for the next code.
220
# See if the process is running
222
JACKD=`ps ax | grep -w jackd | grep -vw grep`
225
# Otherwise see what would be started
227
if [ -z "${JACKD}" ]; then
228
echo "jack driver requested, jackd not running"
230
if [ -f /etc/jackdrc ]; then
231
echo "jack configuration found in /etc/jackdrc"
232
JACKD=`cat /etc/jackdrc`
235
if [ -f ~/.jackdrc ]; then
236
echo "private jack configuration found in ~/.jackdrc"
237
JACKD=`cat ~/.jackdrc`
241
if [ -z "${JACKD}" ]; then
245
#COUNT=`echo ${JACKD} |grep -o -- '-p[0-9][0-9]*' |sed 's/^-p//'`
246
COUNT=`echo ${JACKD} |grep -o -- '-p[0-9][0-9]*' |tail -n1 |sed 's/^-p//'`
248
if [ -z "${COUNT}" ]; then
249
# assume Jackd's default count:
245
RATE=`echo ${JACKD} |grep -o -- '-r[0-9][0-9]*' |sed 's/^-r//'`
247
if [ -z "${RATE}" ]; then
248
# assume Jackd's default rate:
252
#COUNT=`echo ${JACKD} |grep -o -- '-p[0-9][0-9]*' |sed 's/^-p//'`
253
COUNT=`echo ${JACKD} |grep -o -- '-p[0-9][0-9]*' |tail -n1 |sed 's/^-p//'`
255
if [ -z "${COUNT}" ]; then
256
# assume Jackd's default count:
314
# Requesting an engine. This means we need a free TCP port. Our default is
315
# 5028 and if it is not free then search for one from there
317
if [ $engine = 1 ]; then
318
echo checking availability of TCP port $PORT
319
netstat -taln | grep $PORT > /dev/null
321
echo -n "port looked busy, trying "
322
PORT=`expr $PORT + 1`
324
netstat -taln | grep $PORT > /dev/null
326
if [ ${PORT} -lt 1024 -a ${UID} -ne 0 ]; then
327
echo you may not have permissions for ports less than 1024
329
echo using port $PORT
306
334
# the bristol engine has flags for -oss or -alsa drivers, -preload buffers of
307
335
# -count samples:
308
336
# bristol -preload 4 -count 256 [-oss]
310
338
if [ $engine = 1 ]; then
339
if [ $gui = 1 ]; then
340
if [ $quiet = 0 ]; then
341
bristol -rate ${RATE} -count ${COUNT} $args -port $PORT &
343
bristol -rate ${RATE} -count ${COUNT} $args -port $PORT > /dev/null 2>&1 &
346
if [ $quiet = 0 ]; then
347
bristol -rate ${RATE} -count ${COUNT} $args -port $PORT
349
bristol -rate ${RATE} -count ${COUNT} $args -port $PORT > /dev/null 2>&1
355
if [ $gui = 1 ]; then
311
356
if [ $quiet = 0 ]; then
312
bristol -rate ${RATE} -count ${COUNT} $* &
357
brighton $args -engine -port ${PORT}
314
bristol -rate ${RATE} -count ${COUNT} $* > /dev/null 2>&1 &
359
brighton $args -engine -port ${PORT} > /dev/null 2>&1
318
if [ $quiet = 0 ]; then
321
brighton $* -engine > /dev/null 2>&1
363
# Make sure we have the children returned, prevents ugly delayed output
364
if [ $engine = 1 ]; then
365
wait % >/dev/null 2>&1