my type
Creates a array of the type TTrack
aSongs[] AS TTrack
pushes stuff into the array.
my player function:
I was looking for a way to do this without the labels and still having a functional commandloop, but this works fine
Thanks for all the help
Code (glbasic) Select
TYPE TTrack
artist$
songtitle$
filename$
graphics$
ENDTYPE
Creates a array of the type TTrack
aSongs[] AS TTrack
pushes stuff into the array.
my player function:
Code (glbasic) Select
GLOBAL i%
LET i%=0
FUNCTION play: track[] AS TTrack
LOCAL currvolume=0.5, volume
MUSICVOLUME currvolume
init(resx, resy,"16.jpg",1)
SLEEP 5000
//Spill av uforstyrret
nexttrack:
PLAYMUSIC track[i%].filename$, FALSE
WHILE (ISMUSICPLAYING()=TRUE)
curplay:
draw(track[i%], i%, resx,resy)
IF KEY(203)=1
GOTO prev //prevtrack
ELSEIF KEY(205)=1
GOTO skip //nexttrack right arrow
ELSEIF KEY(57)=1
GOTO ablab //about Space hold
ELSEIF KEY(200)=1
GOSUB greetScroller //Alternative greeter down arrow
ELSEIF KEY(28)=1
GOSUB pause //pause return
ELSEIF KEY(1)=1
END
ENDIF
WEND
STOPMUSIC
i%=i%+1
IF i%>11 THEN END
SLEEP 100
GOTO nexttrack
prev:
IF i%<1
i%=0
GOTO curplay
ELSE
STOPMUSIC
i%=i%-1
GOTO nexttrack
ENDIF
GOTO curplay
skip:
STOPMUSIC
IF i%>11
i%=12
GOTO curplay
ELSE
i%=i%+1
GOTO nexttrack
ENDIF
GOTO curplay
I was looking for a way to do this without the labels and still having a functional commandloop, but this works fine
Thanks for all the help
