]> code.delx.au - pulseaudio/blob - src/utils/padsp
27f99336b17ddac2030d6052e5adb14efb50211b
[pulseaudio] / src / utils / padsp
1 #!/bin/sh
2
3 # $Id$
4 #
5 # This file is part of polypaudio.
6 #
7 # polypaudio is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # polypaudio is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with polypaudio; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 # USA.
21
22 while getopts 'hs:n:m:MSDd' param ; do
23 case $param in
24 s)
25 POLYP_SERVER="$OPTARG"
26 export POLYP_SERVER
27 ;;
28 n)
29 PADSP_CLIENT_NAME="$OPTARG"
30 export PADSP_CLIENT_NAME
31 ;;
32 m)
33 PADSP_STREAM_NAME="$OPTARG"
34 export PADSP_STREAM_NAME
35 ;;
36 M)
37 PADSP_NO_MIXER=1
38 export PADSP_NO_MIXER
39 ;;
40 S)
41 PADSP_NO_SNDSTAT=1
42 export PADSP_NO_SNDSTAT
43 ;;
44 D)
45 PADSP_NO_DSP=1
46 export PADSP_NO_DSP
47 ;;
48 d)
49 if [ x"$PADSP_DEBUG" = x ]; then
50 PADSP_DEBUG=1
51 else
52 PADSP_DEBUG=$(( $PADSP_DEBUG + 1 ))
53 fi
54 export PADSP_DEBUG
55 ;;
56 *)
57 echo "$0 - redirect OSS audio devices to Polypaudio"
58 echo " "
59 echo "$0 [options] application [arguments]"
60 echo " "
61 echo "options:"
62 echo " -h show brief help"
63 echo " -s <host>[:<port>] contact a specific Polypaudio server"
64 echo " -n <name> client name to report to the server"
65 echo " -m <name> stream name to report to the server"
66 echo " -M disable /dev/mixer emulation"
67 echo " -S disable /dev/sndstat emulation"
68 echo " -D disable /dev/dsp emulation"
69 echo " -d enable debug output"
70 exit 0
71 ;;
72 esac
73 done
74
75 shift $(( $OPTIND - 1 ))
76
77 if [ x"$LD_PRELOAD" = x ] ; then
78 LD_PRELOAD="libpolypdsp.so"
79 else
80 LD_PRELOAD="$LD_PRELOAD libpolypdsp.so"
81 fi
82
83 export LD_PRELOAD
84
85 exec "$@"