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