diff options
author | Graydon, Tracy <tracy.graydon@intel.com> | 2012-11-28 19:03:52 -0800 |
---|---|---|
committer | Graydon, Tracy <tracy.graydon@intel.com> | 2012-11-28 19:03:52 -0800 |
commit | ff0a1baf66e5d4c4e93821a9732184e1cb5e7405 (patch) | |
tree | c1cb14f78b36f6368c0f86377cbb708d9b22611e /esddsp | |
download | esound-ff0a1baf66e5d4c4e93821a9732184e1cb5e7405.tar.gz esound-ff0a1baf66e5d4c4e93821a9732184e1cb5e7405.tar.bz2 esound-ff0a1baf66e5d4c4e93821a9732184e1cb5e7405.zip |
Initial commit for Tizensubmit/1.0/20121129.031008
Diffstat (limited to 'esddsp')
-rw-r--r-- | esddsp | 113 |
1 files changed, 113 insertions, 0 deletions
@@ -0,0 +1,113 @@ +#!/bin/sh +# esddsp - wrapper script to allow *some* binary only programs to use esd + +# default values for script variables +verbose=0 +set_name=0 + +# check for esddsp options +while test $# -gt 0; do + + case "$1" in + + -h|--help) + echo "esddsp - attempt to reroute audio device to esd" + echo " " + echo "esddsp [options] player arguments" + echo " " + echo "options:" + echo "-h, --help show brief help" + echo "-s, --server=HOST:PORT contact esd server on host at port" + echo "-m, --mixer enable mixer support" + echo "-n, --name=NAME use name to identify player to esd" + echo "-v, --verbose show parameters" + echo "--mmap use memory mapping emulation" + echo " (useful for games like quake)" + + exit 0 + ;; + + -s) + shift + if test $# -gt 0; then + ESPEAKER=$1 + export ESPEAKER + else + echo "no server specified" + exit 1 + fi + shift + ;; + + --server*) + ESPEAKER=`echo $1 | sed -e 's/^[^=]*=//g'` + export ESPEAKER + shift + ;; + + -m|--mixer) + ESDDSP_MIXER=1 + export ESDDSP_MIXER + shift + ;; + + -n) + shift + if test $# -gt 0; then + ESDDSP_NAME=$1 + export ESDDSP_NAME + else + echo "no player name specified" + exit 1 + fi + shift + set_name=1 + ;; + + --name*) + ESDDSP_NAME=`echo $1 | sed -e 's/^[^=]*=//g'` + export ESDDSP_NAME + set_name=1 + shift + ;; + + -v|--verbose) + verbose=1 + shift + ;; + + --mmap) + ESDDSP_MMAP=1 + export ESDDSP_MMAP + shift + ;; + + *) + # no more esddsp options, get on with life + break + ;; + esac +done + +# default name to player if not specified +if test "$set_name" = 0; then + ESDDSP_NAME=$1 + export ESDDSP_NAME +fi + +# echo options if verbose specified +if test "$verbose" = 1; then + echo "server: $ESPEAKER" + echo "name: $ESDDSP_NAME" + echo "command line: $@" +fi + +# setup esd to hijack calls made to /dev/dsp +prefix=/usr/local +exec_prefix=${prefix} + +LD_PRELOAD="libesddsp.so.0 libesd.so.0 $LD_PRELOAD" +export LD_PRELOAD + +# invoke the program with the args given +exec "$@" |