Re: Shuffling and unshuffling (was Re: ID3 tag question)

Robert Moser II <[email protected]> Wed, 19 Feb 2003 07:31:50 -0800
Newsgroups gmane.music.equipment.slimp3.dev
Message-ID <[email protected]>
I don't have time to do the preference work and check this in, but this=20
will do the reshuffle on repeat, note that I haven't even compiled this=20
yet, so no guarantees.

In Playlist.pm, modify the skipsong function like this (taking out the pref=
=20
check since it won't exist).

sub skipsong {
         my ($client) =3D @_;
         # mark htmlplaylist invalid so the current song changes
         $client->htmlstatusvalid(0);
         currentSongIndex($client, currentSongIndex($client) + 1);
         if (currentSongIndex($client) >=3D count($client)) {
+               if (shuffle($client) &&=20
SliMP3::Prefs::get('reshuffleonrepeat')) {
+                       my $playmode =3D playmode($client);
+                       playmode($client,'stop');
+                       reshuffle($client);
+                       playmode($client,$playmode);
+               }
                 currentSongIndex($client, 0);
         }
}

At 01:47 PM 2/19/2003 +0100, you wrote:
>On Tue, 18 Feb 2003, Dave Sherohman wrote:
>
> > Grab a copy of XMMS (or WinAmp, if that's the way you swing).  Create
> > a playlist with 5 songs, ordered A, B, C, D, E.  Turn the "random"
> > switch on.  Hit 'next' a few times.  Doing this just now, I got the
> > play order E A C B D E B D A C B A.  Always random.
>
>I did. Winamp doesn't come with source, and doesn't run on my OS. But my
>version of Xmms does the same thing we do: it creates a mutated playlist
>and follows this list trough.
>
>It also does what I suggested: make a new shuffle-order when you repeat
>is on and it has reached the end of the playlist.
>
>The only thing it does different is that it *displays* your original
>sorted list while *playing* according ot a different shuffled list.
>
>pseudocode:
>
>unshuffled:
>         for i in 1 to len(playlist):
>         play(playlist[i])
>
>shuffled:
>         arr =3D new int[len(playlist)]
>         for i in 1 to len(playlist):
>                 arr[i] =3D i
>         permutate(arr)
>         for i in 1 to len(playlist)
>                 play(playlist[arr[i]])
>
>imho this is stupid. The only "advantage" this has over our system is
>that it makes it impossible for the user to see what comes next (or what
>was last).
>
>They do however shuffle again when hitting the end of the playlist. I
>personally think this is preferable, particularily on a short playlist.
>B A C D B A C D B A C D B A C D is not what most people expect when they
>tell their player to play "randomly" or "shuffled".
>
>
>Sincerely,
>         Eivind Kj=F8rstad


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/FpY02D/vN2EAA/xGHJAA/rIp0lB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

=20

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/=20