b43535b63a9c38e55c7b29a7f0403d884cade0b8
[profile/ivi/pulseaudio.git] / 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                         PADSP_DEBUG=1
50                         export PADSP_DEBUG
51                         ;;
52                 *)
53                         echo "$0 - redirect OSS audio devices to Polypaudio"
54                         echo " "
55                         echo "$0 [options] application [arguments]"
56                         echo " "
57                         echo "options:"
58                         echo "  -h                  show brief help"
59                         echo "  -s <host>[:<port>]  contact a specific Polypaudio server"
60                         echo "  -n <name>           client name to report to the server"
61                         echo "  -m <name>           stream name to report to the server"
62                         echo "  -M                  disable /dev/mixer emulation"
63                         echo "  -S                  disable /dev/sndstat emulation"
64                         echo "  -D                  disable /dev/dsp emulation"
65                         echo "  -d                  enable debug output"
66                         exit 0
67                         ;;
68         esac
69 done
70
71 shift $(( $OPTIND - 1 ))
72
73 if [ x"$LD_PRELOAD" = x ] ; then
74    LD_PRELOAD="libpolypdsp.so"
75 else
76    LD_PRELOAD="$LD_PRELOAD libpolypdsp.so"
77 fi
78
79 export LD_PRELOAD
80
81 exec "$@"