/*
Syntax: /hardsplay [-cwmpq] <soundfile|stop|skip>
= Regular syntax of /splay, supporting all switches and the stop/skip parameters. Pause / resume / seek are NOT supported.
*/
alias hardsplay {
if (!$1) { echo -sg Hardsplay: invalid parameters. Syntax: /hardsplay [-cwmpq] <soundfile|stop|skip> }
else {
if (($gettok($1-,-1,32) == stop) || (($left($1,1) == -) && (c isin $1))) { unset %hardsplay.* }
if (($inwave) || ($insong) || ($inmidi)) {
if ($gettok($1-,-1,32) == skip) { splay $1- | hardsplay.queue | return }
elseif (($left($1,1) == -) && (q isin $1)) {
set -e $+(%,hardsplay.,$calc($gettok($var(hardsplay.*,$var(hardsplay.*,0)),-1,46) +1)) $remove($1,q) $2-
return
}
}
if (!$ebeeps) { .ebeeps on | .timer -m 1 1 .ebeeps off }
splay $1-
}
}
on *:midiend: { hardsplay.queue }
on *:waveend: { hardsplay.queue }
on *:mp3end: { hardsplay.queue }
alias -l hardsplay.queue {
if ($var(hardsplay.*,1).value) { hardsplay $v1 | unset $var(hardsplay.*,1) }
}