Just another very simple but effective mp3 player
menu @MP3 {
dclick: splay $line(@MP3,$1) | ame is listening to: $nopath($line(@MP3,$1)) | set %song $1
}
alias readmp3 {
window -sl @MP3
dialog -m mc mc
if (%mp3dir == $null) { %mp3dir = $$sdir($mircdir,Select Mp3 Directory) }
write -c mp3list.txt
var %x = $findfile($+(",%mp3dir,"),*.mp3,0,.write mp3list.txt $1-)
var %y = 1
while %y {
if ($read(mp3list.txt) == $null) { halt }
aline @MP3 $read(mp3list.txt,%y)
inc %y
}
elseif (%mp3dir != $null) {
var %y = 1
while %y {
if ($read(mp3list.txt) == $null) { halt }
aline @MP3 $read(mp3list.txt,%y)
inc %y
}
}
}
dialog mc {
title "MP3 Controler"
size -1 -1 118 18
option dbu
button "Resume", 1, 1 3 37 12
button "Pause", 2, 39 3 37 12
button "Stop", 3, 77 3 37 12
}
on *:dialog:mc:sclick:*: {
if ($did == 1) { splay resume }
if ($did == 2) { splay pause }
if ($did == 3) { splay stop | unset %song }
}
on *:mp3end: { splay $line(@MP3,$($calc(%song + 1))) | ame is listening to: $nopath($line(@MP3,$($calc(%song + 1)))) }
menu channel {
-
Mp3 Player v1:/readmp3
}