Revision 21330,
2.0 KB
checked in by ghudson, 20 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r21329,
which included commits to RCS files with non-trunk default branches.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # esddsp - wrapper script to allow *some* binary only programs to use esd |
---|
3 | |
---|
4 | # default values for script variables |
---|
5 | verbose=0 |
---|
6 | set_name=0 |
---|
7 | |
---|
8 | # check for esddsp options |
---|
9 | while test $# -gt 0; do |
---|
10 | |
---|
11 | case "$1" in |
---|
12 | |
---|
13 | -h|--help) |
---|
14 | echo "esddsp - attempt to reroute audio device to esd" |
---|
15 | echo " " |
---|
16 | echo "esddsp [options] player arguments" |
---|
17 | echo " " |
---|
18 | echo "options:" |
---|
19 | echo "-h, --help show brief help" |
---|
20 | echo "-s, --server=HOST:PORT contact esd server on host at port" |
---|
21 | echo "-m, --mixer enable mixer support" |
---|
22 | echo "-n, --name=NAME use name to identify player to esd" |
---|
23 | echo "-v, --verbose show parameters" |
---|
24 | echo "--mmap use memory mapping emulation" |
---|
25 | echo " (useful for games like quake)" |
---|
26 | |
---|
27 | exit 0 |
---|
28 | ;; |
---|
29 | |
---|
30 | -s) |
---|
31 | shift |
---|
32 | if test $# -gt 0; then |
---|
33 | ESPEAKER=$1 |
---|
34 | export ESPEAKER |
---|
35 | else |
---|
36 | echo "no server specified" |
---|
37 | exit 1 |
---|
38 | fi |
---|
39 | shift |
---|
40 | ;; |
---|
41 | |
---|
42 | --server*) |
---|
43 | ESPEAKER=`echo $1 | sed -e 's/^[^=]*=//g'` |
---|
44 | export ESPEAKER |
---|
45 | shift |
---|
46 | ;; |
---|
47 | |
---|
48 | -m|--mixer) |
---|
49 | ESDDSP_MIXER=1 |
---|
50 | export ESDDSP_MIXER |
---|
51 | shift |
---|
52 | ;; |
---|
53 | |
---|
54 | -n) |
---|
55 | shift |
---|
56 | if test $# -gt 0; then |
---|
57 | ESDDSP_NAME=$1 |
---|
58 | export ESDDSP_NAME |
---|
59 | else |
---|
60 | echo "no player name specified" |
---|
61 | exit 1 |
---|
62 | fi |
---|
63 | shift |
---|
64 | set_name=1 |
---|
65 | ;; |
---|
66 | |
---|
67 | --name*) |
---|
68 | ESDDSP_NAME=`echo $1 | sed -e 's/^[^=]*=//g'` |
---|
69 | export ESDDSP_NAME |
---|
70 | set_name=1 |
---|
71 | shift |
---|
72 | ;; |
---|
73 | |
---|
74 | -v|--verbose) |
---|
75 | verbose=1 |
---|
76 | shift |
---|
77 | ;; |
---|
78 | |
---|
79 | --mmap) |
---|
80 | ESDDSP_MMAP=1 |
---|
81 | export ESDDSP_MMAP |
---|
82 | shift |
---|
83 | ;; |
---|
84 | |
---|
85 | *) |
---|
86 | # no more esddsp options, get on with life |
---|
87 | break |
---|
88 | ;; |
---|
89 | esac |
---|
90 | done |
---|
91 | |
---|
92 | # default name to player if not specified |
---|
93 | if test "$set_name" = 0; then |
---|
94 | ESDDSP_NAME=$1 |
---|
95 | export ESDDSP_NAME |
---|
96 | fi |
---|
97 | |
---|
98 | # echo options if verbose specified |
---|
99 | if test "$verbose" = 1; then |
---|
100 | echo "server: $ESPEAKER" |
---|
101 | echo "name: $ESDDSP_NAME" |
---|
102 | echo "command line: $@" |
---|
103 | fi |
---|
104 | |
---|
105 | # setup esd to hijack calls made to /dev/dsp |
---|
106 | prefix=@prefix@ |
---|
107 | exec_prefix=@exec_prefix@ |
---|
108 | |
---|
109 | LD_PRELOAD="@libdir@/libesddsp.so.@ESD_MAJOR_VERSION@ @libdir@/libesd.so.@ESD_MAJOR_VERSION@ $LD_PRELOAD" |
---|
110 | export LD_PRELOAD |
---|
111 | |
---|
112 | # invoke the program with the args given |
---|
113 | exec "$@" |
---|
Note: See
TracBrowser
for help on using the repository browser.