View Single Post
Old 3rd May 2012, 05:03   #21
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
Quote:
Originally Posted by pumbaa2 View Post
The problem with this method is it will literally have to run a loop for however many items are on the list, except the last item which obviously gets inserted in the last blank slot. This method could be CPU time consuming during the randomize process where the other method is predictable and requires 1 loop with 2 variables, 1 counting up and another counting down, then alternate between them.
Why pre-shuffle the whole "deck" - you aren't dealing cards - you're streaming media, one item at a time

have a pool of unplayed items ... dip into it randomly and remove an item when you want play something ... while playing, you don't care what's in the pool

that way ... you can add to the pool at any time ... pre-shuffling would require you to re-shuffle when adding to the list

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote