Mp3 player with no dialog: /play (song number optional, leave blank for random play), /dir to set file directory, /add to add file to playlist, /stop to stop, /check returns the number of files in playlist
alias dir {
set %sdir $sdir(C:\)
}
alias add {
if ($read(playlist.txt,1) == $null) { write -c playlist.txt }
write -a playlist.txt $sfile(%mp3.sdir)
echo -a File Added
}
alias play {
if ($1 == $null) {
set %song $read(playlist.txt,$rand(1,$lines(playlist.txt)))
splay %song
.amsg [Now Playing] $nopath(%song) [Song #] $readn $+ / $+ $lines(playlist.txt)
echo -a [Now Playing] $nopath(%song) [Song #] $readn $+ / $+ $lines(playlist.txt)
}
else {
set %song $read(playlist.txt,$1)
splay %song
.amsg [Now Playing] $nopath(%song) [Song #] $readn $+ / $+ $lines(playlist.txt)
echo -a [Now Playing] $nopath(%song) [Song #] $readn $+ / $+ $lines(playlist.txt)
}
}
alias stop {
splay stop
}
alias check {
echo -a You have $lines(playlist.txt) tracks in your playlist
}