~ubuntu-branches/debian/squeeze/bristol/squeeze

« back to all changes in this revision

Viewing changes to bin/startBristol

  • Committer: Bazaar Package Importer
  • Author(s): Guenter Geiger (Debian/GNU)
  • Date: 2004-08-16 17:25:51 UTC
  • Revision ID: james.westby@ubuntu.com-20040816172551-b0wxc0izlhxa6ugn
Tags: 0.9.1-11
* Fixed gcc-3.4 compilation
* removed dynamic libraries, bristolenine and bristol are linked
  dynamically now (closes: #265621) (closes: #265052)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
quiet=0
6
6
verbose=0
7
7
 
8
 
# ALSA audio doesn't work on my SBLive, fall back to OSS
9
 
audioflags="-audio oss"
10
 
 
11
 
# ALSA sequencer support is always a nice feature
12
 
midiflags="-midi alsa -seq"
13
 
 
14
 
 
15
 
 
16
 
checkdriver() 
17
 
{
18
 
    if test ! -d /proc/asound/seq; then
19
 
        echo "ALSA sequencer not installed, falling back to OSS midi"
20
 
        midiflags="-midi oss"
21
 
    fi
22
 
}
23
 
 
24
8
showhelp()
25
9
{
26
10
        if [ $verbose = 1 ]; then
31
15
                echo "startBristol [-explorer|-mini|-hammond|-b3|-dx|-juno|-prophet|-mixer|-vox|-pro10|-rhodes] [-oss|-alsa] [-libtest] [[-verbose|-v] -help|-h]"
32
16
                echo
33
17
                echo "Press 'q' in any synth window to exit application"
34
 
                echo "bristol -v -h for more verbose help output"
35
 
                echo "You may want to give the /usr/bin/bristolengine suid root permissions"
 
18
                echo "startBristol -v -h for more verbose help output"
 
19
                echo "You may want to give the bin/bristolengine suid root permissions"
36
20
                echo
37
21
                exit 0
38
22
        fi
74
58
        fi
75
59
done
76
60
 
77
 
 
78
 
# Set the needed environment variables
79
 
 
 
61
# Nokey: Don't override BRISTOL if it's not already set
80
62
if [ -z "$BRISTOL" ]; then
81
63
        declare -x BRISTOL=/usr/share/bristol
82
64
fi
83
65
 
 
66
# Nokey: Does the BRISTOL directory actually exist?
84
67
if [ ! -d $BRISTOL ]; then
85
 
    echo "incomplete installation of bristol"
 
68
        # Apparently not. Let's try to make a guess as to where it is.
 
69
 
 
70
        # Try to find out how we were started. If this script was in
 
71
        #  the PATH of the user, the $0 should have a leading '/'.
 
72
        #  This leading '/' would also be there if this script was
 
73
        #  executed as /full/path/name/startBristol
 
74
        STARTUP=$0
 
75
        # If this script was started as ./"*whatever*" then we need
 
76
        #  to strip off the './' in order to accurately determine
 
77
        #  the BRISTOL directory
 
78
        if [ "$(echo $STARTUP | cut -c 1-2)" = "./" ]; then
 
79
                STARTUP=$(echo $STARTUP | cut -c 3-)
 
80
        fi
 
81
        
 
82
        if [ "$(echo $STARTUP | cut -c 1)" = "/" ]; then
 
83
                BIN_DIR=$(dirname $STARTUP)
 
84
        else
 
85
                BIN_DIR=$(dirname $PWD/$STARTUP)
 
86
        fi
 
87
 
 
88
        declare -x BRISTOL=$(dirname $BIN_DIR)
 
89
        unset BIN_DIR STARTUP
86
90
fi
87
91
 
 
92
#
 
93
# If slabhome already exists, we should take it rather than this definition.
 
94
#
 
95
declare -x SLAB_HOME=$BRISTOL
88
96
declare -x BRIGHTON=$BRISTOL
89
 
declare -x LD_LIBRARY_PATH=/usr/lib/bristol
90
 
 
91
 
 
 
97
 
 
98
declare -x LD_LIBRARY_PATH=/usr/lib/bristol:${BRISTOL}/lib
 
99
 
 
100
declare PATH=${PATH}:$BRISTOL/bin
 
101
 
 
102
# see if we should advise making the binary a suid root for FIFO scheduling
92
103
if [ ${EUID} -ne 0 ]; then
93
 
    echo "      You may want to make bristolengine a suid-root executable"
 
104
        if [ `ls -l ${BRISTOL}/bin/bristolengine | awk '{printf $3}'` != "root" ]; then
 
105
                echo "  You may want to make bristolengine a suid-root executable"
 
106
        elif [ ! -u ${BRISTOL}/bin/bristolengine ]; then
 
107
                echo "  You may want to make bristolengine a suid-root executable"
 
108
        fi
94
109
fi
95
110
 
96
 
checkdriver
97
 
 
98
111
#
99
112
# bristolengine has flags for -oss or -alsa drivers, -preload buffers of
100
113
# -bufsize bytes (not samples):
102
115
#
103
116
if [ $engine = 1 ]; then
104
117
        if [ $quiet = 0 ]; then
105
 
                bristolengine -preload 4 -bufsize 1024 $audioflags $midiflags $* &
 
118
                bristolengine -preload 4 -bufsize 1024 $* &
106
119
        else
107
 
                bristolengine -preload 4 -bufsize 1024 $audioflags $midiflags $* > /dev/null 2>&1 &
 
120
                bristolengine -preload 4 -bufsize 1024 $* > /dev/null 2>&1 &
108
121
        fi
109
122
fi
110
123
if [ $quiet = 0 ]; then
111
 
        bristol.real $* -engine
 
124
        bristol $* -engine
112
125
else
113
 
        bristol.real $* -engine > /dev/null 2>&1
 
126
        bristol $* -engine > /dev/null 2>&1
114
127
fi