replace with improved/updated versions
authorThorsten Glaser <tg@mirbsd.org>
Sun, 23 Sep 2012 16:06:38 +0000 (18:06 +0200)
committerThorsten Glaser <tg@mirbsd.org>
Sun, 23 Sep 2012 16:25:31 +0000 (16:25 +0000)
mksh/flacplay [new file with mode: 0644]
posix/flacplay [deleted file]
posix/wcdiff

diff --git a/mksh/flacplay b/mksh/flacplay
new file mode 100644 (file)
index 0000000..520e98a
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/mksh
+# $MirOS: contrib/hosted/tg/flacplay,v 1.1 2012/09/23 16:04:48 tg Exp $
+
+if a=$(whence -p waveplay) && [[ -n $a && -x $a ]]; then
+       alias _wavplay='waveplay -'
+else
+       alias _wavplay='sox -t wav /dev/stdin -t sunau /dev/audio'
+fi
+
+trap "" INT
+
+for a in "$@"; do
+       if [[ -s $a ]]; then
+               print -ru2 "♬ $a"
+               flac -d -c "$a" | _wavplay
+       else
+               print -ru2 "Skipping illegible '$a'"
+       fi
+done
diff --git a/posix/flacplay b/posix/flacplay
deleted file mode 100644 (file)
index 3ad24c4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/mksh
-# probably works with POSIX shell, tested only with mksh
-
-trap "" INT
-for a in "$@"; do
-       flac -d -c "$a" | waveplay -
-done
index 24057dc..65bfe01 100644 (file)
@@ -1,5 +1,4 @@
 #!/bin/sh
 #!/bin/sh
-# colourised wdiff(1)
-
+# $MirOS: contrib/hosted/tg/wcdiff,v 1.1 2012/09/01 19:07:12 tg Exp $
 exec wdiff -w '\e[4;34m⌦\e[0m\e[1;4;31m' -x '\e[0m\e[4;34m⌫\e[0m' \
     -y '\e[4;34m▶\e[0m\e[1;4;32m' -z '\e[0m\e[4;34m◀\e[0m' "$@"
 exec wdiff -w '\e[4;34m⌦\e[0m\e[1;4;31m' -x '\e[0m\e[4;34m⌫\e[0m' \
     -y '\e[4;34m▶\e[0m\e[1;4;32m' -z '\e[0m\e[4;34m◀\e[0m' "$@"