#!/bin/sh jackcnt=`ps -e | grep -c jackd` PREFIX=/usr LD_PRELOAD_OLD="" if test "$LD_PRELOAD" != "" then LD_PRELOAD_OLD=$LD_PRELOAD PRELOAD=$LD_PRELOAD:$PREFIX/lib/libjackasyn.so.0 else PRELOAD=$PREFIX/lib/libjackasyn.so.0 fi if test -f $PREFIX/lib/libjackasyn.so.0 -a "$jackcnt" != "0" then export LD_PRELOAD=$PRELOAD fi OLDIFS=$IFS export IFS='' for i in $@ do EXTENSION=`echo $i | sed -e 's/.*\.\(.*\)$/.\1/'` if [ `pidof jackd` ] then case $EXTENSION in .wav | .au | .aiff | .aif | .smp | .snd | .WAV | .Wav | .AU | .AIFF ) echo `echo $i |sed -e's/ /\\\ /g'`|xargs play ;; .mp3 | .Mp3 | .MP3 ) echo `echo $i |sed -e's/ /\\\ /g'`|xargs mpg123 ;; .m3u ) echo `echo $i |sed -e's/ /\\\ /g'`|xargs alsaplayer -i text ;; .ogg | .Ogg | .OGG ) echo `echo $i |sed -e's/ /\\\ /g'`|xargs ogg123 ;; .mid | .MID | .Mid | .midi | .MIDI ) echo `echo $i |sed -e's/ /\\\ /g'`|xargs timidity ;; esac else echo "jackd not running; Exiting..." && exit fi done if test "$LD_PRELOAD_OLD" != "" then export LD_PRELOAD=$LD_PRELOAD_OLD else unset LD_PRELOAD fi export IFS=$OLDIFS