dialog tdefmp3Play {
option dbu
size -1 -1 286 146
text "MP3s:", 1, 4 4 22 6
list 2, 4 12 258 128, size sort
button "", 3, 268 12 14 128, default multi
}
on *:DIALOG:mp3Play:init:*: mp3Play.init
alias -l mp3Play.init {
dialog -t mp3Play Basic MP3 Player - $&
$findfile($mp3dir, $iif(%žmp3.mask,%žmp3.mask,*.mp3), 0,1, $&
did -a mp3Play 2 $left($nopath($1-),-4)) MP3s found.
did -a mp3Play 3 $+( $&
P, $cr, $cr, $&
l, $cr, $cr, $&
a, $cr, $cr, $&
y, $cr, $cr, $&
$cr, $&
M, $cr, $cr, $&
P, $cr, $cr, $&
3)
}
on *:DIALOG:mp3Play:*click:2,3:{
if ($devent == sclick && $did == 3) || ($devent == dclick && $did == 2) {
.splay $+(",$mp3dir,$$did(2).seltext,.mp3")
echo $color(action) -ati $+( $&
* $&
$bytes($file($insong.fname).size,3).suf, $&
/, $&
$gmt($round($calc($insong.length / 1000),0),n:ss)) $&
* $&
$replace($left($nopath($insong.fname),-4),_,$chr(32)) $&
}
}
alias PlayMP3s {
if $1 { set -u2 %žmp3.mask $+(*,$replace($1-,$chr(32),*),*.mp3) }
if $dialog(mp3Play) { did -r mp3Play 2 | mp3Play.init }
else { dialog -m mp3Play tdefmp3Play }
}