Hi Jim,
I had a crack at your problem.
I managed to make a simple shell of a cd player using the arrowkeys.
up loads and plays
down stops and deletes
left and right change a track variable thats reused for the up and down keys
theres a small bug if u press the upkey twice but that should be able to be fixed with a if music playing command if /endif statement around the upkey commands that load and play the music.
yell out if i didnt comment enough.
rem ----------------------------------------------------------------
rem CD music Track snippet
rem indi 6/15/2003 359am
rem
rem
rem
rem ----------------------------------------------------------------
sync rate 60 : sync on
ink rgb(255,255,255),1
set text size 13
set text font "verdana"
make object cube 1,1
MaxTrax = Get Number of CD Tracks()
track = 1
load cdmusic track,1
play music 1
disable escapekey
while escapekey()=0
r = wrapvalue(r) + 1
rotate object 1,r,r,r
rem keystate(200) represents the up arrowkey
If keystate(200)=1 and UPKEY_switch=0
UPKEY_toggle=1-UPKEY_toggle
UPKEY_switch=1
load cdmusic track,1
play music 1
endif
If keystate(200)=0 then UPKEY_switch=0
if UPKEY_toggle = 1
endif
rem keystate(208) represents the down arrowkey
If keystate(208)=1 and DOWNKEY_switch=0
DOWNKEY_toggle=1-DOWNKEY_toggle
DOWNKEY_switch=1
stop music 1
delete music 1
endif
If keystate(208)=0 then DOWNKEY_switch=0
if DOWNKEY_toggle = 1
endif
rem keystate(203) represents the LEFT arrowkey
If keystate(203)=1 and LEFTKEY_switch=0
LEFTKEY_toggle=1-LEFTKEY_toggle
LEFTKEY_switch=1
track = track - 1
if track < 1 then track = 1
endif
If keystate(203)=0 then LEFTKEY_switch=0
if LEFTKEY_toggle = 1
endif
rem keystate(205) represents the RIGHT arrowkey
If keystate(205)=1 and RIGHTKEY_switch=0
RIGHTKEY_toggle=1-RIGHTKEY_toggle
RIGHTKEY_switch=1
track = track + 1
if track > MaxTrax then track = MaxTrax
endif
If keystate(205)=0 then RIGHTKEY_switch=0
if RIGHTKEY_toggle = 1
endif
text 10,10,"CD Player "
text 10,30,"max tracks :"+STR$(MaxTrax)
text 10,50,"track "+STR$(track)
for i = 1 to MaxTrax
text 10,70+(i*15),STR$(i)
next i
text 10,screen height()-30,"use upkey & downkey to start stop and left right to change tracks"
text 10,screen height()-15,"debug ascii number:"+STR$(scancode())
sync
endwhile
delete object 1
if music exist(1) then delete music 1
end