dialog mp3 {
title "M. P. 3."
size -1 -1 64 363
option dbu
edit "X - X", 7, 0 38 63 20, autohs center
edit "--:--", 8, 0 58 63 20, autohs center
text "Prog", 9, 0 78 63 20, center
text "%", 10, 22 99 17 8, center
}
alias play {
if (!%mp3ddir) { set %mp3ddir $$sdir(C:\music,Pick MP3 DIR) }
set %mp3.csong $$sfile($+(%mp3ddir,*.mp3),Pick Sound,Play)
mp3.play
}
alias mp3.play {
.splay $+(",%mp3.csong,")
.mp3.update
.set %mp3.splay 1
.timerstyles -m 0 300 $scroll
}
on *:dialog:mp3:init:*: {
dll $rbar Dock $dialog(mp3).hwnd > left
}
on *:dialog:mp3:close:*: { .splay -p stop | .timermp3 off }
alias mp3.update { .timermp3 -o 0 1 /mp3.update2 }
alias mp3.update2 {
if ($dialog(mp3)) {
if (!$sound(%mp3.csong).title) { did -ra mp3 7 Unknown }
else { did -ra mp3 7 $sound(%mp3.csong).artist - $sound(%mp3.csong).title }
did -ra mp3 9 $int($calc($calc($insong.pos / 1000) / $calc($insong.length / 1000) * 100))
did -ra mp3 8 $gmt($calc($insong.pos / 1000),nn:ss)
did -ra mp3 10 $int($calc($calc($insong.pos / 1000) / $calc($insong.length / 1000) * 100)) $+ %
if ($insong.pos >= $insong.length) { .timermp3 off }
}
else { timermp3 off | splay -p stop }
}
alias scroll {
if ($dialog(mp3)) {
/did -ra mp3 7 %styleMsg
/did -ra mp3 7 $right(%curVal, -1) $+ $left(%curVal, 1)
}
else { timerstyles off }
}