A basic music player that searches your music folders for songs.
You need to change the first line of the code to the directory of your music folder.
MusicDirectory$="C:\Documents and Settings\Rory\My Documents\My Music"
set display mode 320,240,16
Set window on
set window position 512,380
set window title "DB Music Player"
sync on
randomize timer()
sw=screen width()
sh=screen height()
Print "Loading Songs"
sync
dim musicname$(1000)
dim r#(10)
dim col(10)
y=2
for fx=1 to 5
col(fx)=rgb(rnd(255),rnd(255),rnd(255))
next fx
set dir MusicDirectory$
perform checklist for files
repeat
repeat
inc y
path$=MusicDirectory$+"\"+checklist string$(y)
if path exist(path$)=1 and mid$(checklist string$(y),len(checklist string$(y))-3)<>"."
set dir path$
endif
until path exist(path$)=1 or checklist quantity()=y or mid$(checklist string$(y),len(checklist string$(y))-3)<>"."
empty checklist
perform checklist for files
for x=2 to checklist quantity()
if right$(checklist string$(x),4)=".mp3" or right$(checklist string$(x),5)=".midi"
inc musicnum
musicname$(musicnum)=checklist string$(x)
print checklist string$(x)
sync
load music checklist string$(x),musicnum
endif
next x
empty checklist
set dir MusicDirectory$
perform checklist for files
until checklist quantity()=y
if musicnum>0
do
repeat
ox=x
repeat
x=rnd(musicnum)
until x<>ox
play music x
repeat
cls 0
for fx=1 to 5
fx#=fx
ink col(fx),1
circle sw/2,sh/2,r#(fx)
`line (sin(r#(fx+5))*sh)+sw/2,(cos(r#(fx+5))*sh)+sh/2,(sin(r#(fx+5)+180)*sh)+sw/2,(cos(r#(fx+5)+180)*sh)+sh/2,col(fx+5)
inc r#(fx+5),(fx#/10)-0.25
inc r#(fx),fx#/10
if rnd(200)=1 then col(fx+5)=rgb(rnd(255),rnd(255),rnd(255))
if r#(fx)>sh then r#(fx)=0:col(fx)=rgb(rnd(255),rnd(255),rnd(255))
next fx
ink rgb(255,255,255),0
set cursor 0,0
center text sw/2,20,str$(x)+"/"+str$(musicnum)
center text sw/2,40,left$(musicname$(x),len(musicname$(x))-4)
center text sw/2,70,"<- ->"
if speed>0 then set music speed x,speed
if vol>0 then set music volume x,vol
line sw/2-50,100,sw/2+50,100,rgb(255,0,0)
line music volume(x)+sw/2-50,90,music volume(x)+sw/2-50,110
repeat
if spacekey()=1 and skip=0 then pause music x: skip=1
if spacekey()=1 and skip=2 then resume music x: skip=3
if spacekey()=0 and skip=1 then skip=2
if spacekey()=0 and skip=3 then skip=0
until music playing(x)=1
if mouseclick()=1
if mousey()>90 and mousey()<110 and mousex()>sw/2-50 and mousex()<sw/2+50
vol=mousex()-sw/2+50
print vol
endif
if mousey()>70 and mousey()<80 and mclick=0
if mousex()>sw/2-25 and mousex()<sw/2-10
mclick=1
stop music x
dec x,2
if x<1 then x=musicnum-1
endif
if mousex()>sw/2+10 and mousex()<sw/2+25
mclick=1
stop music x
endif
endif
endif
if mouseclick()=0 then mclick=0
sync
until music playing(x)=0
until x=musicnum
loop
endif
sync:center text sw/2,sh/2,"No songs avilable":sync
wait key
There is no such thing as "Too Fast!"