diff options
author | tv <tv@also> | 2011-05-29 15:47:21 +0200 |
---|---|---|
committer | tv <tv@also> | 2011-05-29 15:47:21 +0200 |
commit | e0ec5d2e8560ae433ee677622b24ba82dbe7630b (patch) | |
tree | a1fcb14eeafc3df41427896d9b413087d24d71f1 /noise/modules/play | |
parent | edaa1d7f7a0ed33c019fce185b8aff7563498b6e (diff) |
lowered filesystem hierarchy--everything are modules
Diffstat (limited to 'noise/modules/play')
-rwxr-xr-x | noise/modules/play | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/noise/modules/play b/noise/modules/play new file mode 100755 index 00000000..749b450a --- /dev/null +++ b/noise/modules/play @@ -0,0 +1,36 @@ +#! /bin/sh +case "$1" in + (--help) + echo "play an audio file" ;; + (*) + exec 2>&1 + ffs='wav mp3 ogg asf flac' + + if test -z "$*" ; then + ls $HOME/noise/samples | sed -r ' + s:\.('"`echo "$ffs" | tr \ \|`"')$: [30m\1[m: + s:^:/play : + s:.*:[32m&[m: + ' + else + for i in $ffs ; do + f=$HOME/noise/samples/$1.$i + test -f "$f" && + case "$i" in + wav) aplay "$f" & ;; + *) mplayer "$f" & ;; + esac && break + done || cat<<EOF +[33m\ +Keine Audiodatei mit dem Namen + + [4m$1[;33m.EXT + +gefunden... am besten gleich uploaden: + + scp NAME shack@shack.shack:noise/samples/ + +folgende Dateiendungen werden erkannt: $ffs[m +EOF + fi +esac |