summaryrefslogtreecommitdiffstats
path: root/noise/modules/overlord
diff options
context:
space:
mode:
authorkrebs <krebs@fuerkrebs>2011-09-09 20:26:03 -0400
committerkrebs <krebs@fuerkrebs>2011-09-09 20:26:03 -0400
commit3b48e005f95dbadcef714e225b3b104b3935e9c7 (patch)
tree85724e91e9a10ff146fea187bc766305eeccb351 /noise/modules/overlord
parente71fd36593eebd402dd2aa2425473827dda1c9f2 (diff)
//noise /overlord: removed redundancy
Diffstat (limited to 'noise/modules/overlord')
-rwxr-xr-xnoise/modules/overlord48
1 files changed, 22 insertions, 26 deletions
diff --git a/noise/modules/overlord b/noise/modules/overlord
index 6edb0fd8..53766116 100755
--- a/noise/modules/overlord
+++ b/noise/modules/overlord
@@ -1,35 +1,31 @@
#! /bin/sh
set -euf
+max=100
+step=10
+min=0
+
announce() {
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 90%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 80%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 70%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 60%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 50%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 40%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 30%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 20%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 10%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 0%
-/krebs/streams/streams stop
-amixer -q -c 0 -D hw:0 sset Front 100%
-mplayer /krebs/god/overlord/announce.mp3
-espeak -v de -s 120 -a 900 "$*"
-/krebs/streams/streams start
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 0%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 10%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 20%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 30%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 40%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 50%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 60%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 70%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 80%
-sleep 0.1; amixer -q -c 0 -D hw:0 sset Front 90%
+ # fade-out streams
+ for i in `seq $max -$step $min`; do
+ amixer -q -c 0 -D hw:0 sset Front $i%
+ sleep 0.1
+ done
+ /krebs/streams/streams stop
+
+ amixer -q -c 0 -D hw:0 sset Front $max%
+ mplayer /krebs/god/overlord/announce.mp3 >/dev/null
+ espeak -v de -s 120 -a 900 "$*"
+
+ # fade-in streams
+ /krebs/streams/streams start
+ for i in `seq $min $step $max`; do
+ sleep 0.1
+ amixer -q -c 0 -D hw:0 sset Front $i%
+ done
}
-case "$1" in
+case "${1---help}" in
--help) echo "Make an announcement! Usage: /overlord <text>";;
*) announce "$@";;
esac