summaryrefslogtreecommitdiffstats
path: root/src/utils/padsp
blob: dc89bfb734eec82bf4f2add4a17b25153918bc5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh

# $Id$
#
# This file is part of polypaudio.
#
# polypaudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# polypaudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with polypaudio; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

while getopts 'hs:n:m:MSDd' param ; do
	case $param in
		s)
			POLYP_SERVER="$OPTARG"
			export POLYP_SERVER
			;;
		n)
			PA_CLIENT_NAME="$OPTARG"
			export PA_CLIENT_NAME
			;;
		m)
			PA_STREAM_NAME="$OPTARG"
			export PA_STREAM_NAME
			;;
		M)
			PA_NO_MIXER=1
			export PA_NO_MIXER
			;;
		S)
			PA_NO_SNDSTAT=1
			export PA_NO_SNDSTAT
			;;
		D)
			PA_NO_DSP=1
			export PA_NO_DSP
			;;
		d)
			PADSP_DEBUG=1
			export PADSP_DEBUG
			;;
		*)
			echo "$0 - redirect OSS audio devices to Polypaudio"
			echo " "
			echo "$0 [options] application [arguments]"
			echo " "
			echo "options:"
			echo "	-h                  show brief help"
			echo "	-s <host>[:<port>]  contact a specific Polypaudio server"
			echo "	-n <name>           client name to report to the server"
			echo "	-m <name>           stream name to report to the server"
			echo "	-M                  disable /dev/mixer emulation"
			echo "	-S                  disable /dev/sndstat emulation"
			echo "	-D                  disable /dev/dsp emulation"
			echo "	-d                  enable debug output"
			exit 0
			;;
	esac
done

shift $(( $OPTIND - 1 ))

if [ x"$LD_PRELOAD" = x ] ; then
   LD_PRELOAD="libpolypdsp.so"
else
   LD_PRELOAD="$LD_PRELOAD libpolypdsp.so"
fi

export LD_PRELOAD

exec "$@"