
-----------------------------------
michael_li13
Sun Jan 22, 2006 5:09 pm

Playing Cd music, skipping songs?
-----------------------------------
1) When playing a CD, is it possible to skip songs? 
2) Once a song is stopped, can you restart it?
3) When playing a CD on Random (with the randint function) can you make sure it doesn't replay the same songs?

Plz help asap..... :cry:

-----------------------------------
Delos
Sun Jan 22, 2006 5:24 pm


-----------------------------------
1).  Simply specify which track to play.
2).  Simply specify which track to play.
3).  Create an array specifying which tracks have played, which have not played, and which will play next (a randomized queue).

-----------------------------------
michael_li13
Sun Jan 22, 2006 6:38 pm

problem with specifying track...
-----------------------------------
i would like for the user to type "play" and "Stop" to start and stop the track and "skip" to skip the track.  and i'm kinda of beginner at the arrays thing, could you give an example?

-----------------------------------
Rasta Fella
Sun Jan 22, 2006 9:05 pm


-----------------------------------
Check the Arrays Tutoriol. Also check Flexible Array Tutoriol all can be found under the Turing Walkthrough.

-----------------------------------
michael_li13
Mon Jan 23, 2006 5:17 pm

arrays...how to not replay songs....can't find connection
-----------------------------------
I looked through the walkthrough on arrays, and I guess I missed something because I still have no idea what you're talking about.  So...is there a way to play a CD random without replaying songs.  PLZ write an example!!!

-----------------------------------
Albrecd
Wed Jan 25, 2006 1:47 pm


-----------------------------------
you could use a randint.

var array : songalreadyplayed 1 .. howevermanysongsthereareontheCD of boolean
var Song := Rand.Int (0, howevermanysongsthereareontheCD)

for i : 1 .. howhowevermanysongsthereareontheCD
songalreadyplayed (i) := false
end for

loop
if songalreadyplayed (Song) = false then
%Play Track acording to Song (which is random)
songalreadyplayed (Song) := true
end if
randint (Song, 0, howevermanysongsthereareontheCD)
end loop
