Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: randomness and playlists
From: Daniel Stenberg (daniel_at_haxx.se)
Date: 2002-05-01


Hey

It struck me that if we end up with a playlist consisting of lots of tracks
and we want random selection, press play and a random tune starts... you play
N pieces of music and then shuts off.

Now, you start the player again. Where do you start again?

My thoughts:

We do no true random selections. We do a random based on a seed. The random
becomes the same every time given the same seed.

This way, we can store "index" and "seed" only, and then we always know which
track we played before this one (in fact, we have full backtrace all the
way), which one is next etc. No matter if you shut off the player in
between... And you won't hear the same tune twice until all tunes are played!

If you're not happy with the random order, you get a new scramble by changing
the seed.

-- 
  Daniel Stenberg -- Hacking Archos => http://bjorn.haxx.se/rockbox/



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa