Neuros Forums
Home | Active Topics | Search | FAQ
 All Forums
 442
 442 Feedback and Discussion
 Playlist
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ice.skillz
Posting is for Closers

75 Posts

Posted - 04/04/2006 :  8:01:12 PM  Show Profile  Visit ice.skillz's Homepage
Is there a way to make a playlist. Without having to put every file as "favorite". Maybe by editting the "audall.m3u" or "audfav.m3u" we can achieve this? A mp3 player isn't complete without having to make your own playlist. I just want to know if this is possible on the current 442.

like my sig

Your quick response to this post: (0 total votes)
I agree (0%)
I disagree (0%)

andrew
Posting is for Closers

32 Posts

Posted - 04/18/2006 :  5:57:57 PM  Show Profile  Send andrew an ICQ Message
quote:
Originally posted by ice.skillz

Is there a way to make a playlist. Without having to put every file as "favorite". Maybe by editting the "audall.m3u" or "audfav.m3u" we can achieve this? A mp3 player isn't complete without having to make your own playlist. I just want to know if this is possible on the current 442.



I wrote a perl script that would take the audall.m3u, randomize it and rewrite it as the audfav.m3u, that at least gives me a "shuffle all songs" playback.

In the m3u file they use, each MP3 takes 2 lines, the first being the name of the song and the second being the path to the song. I am not sure if this is a standard m3u file.

I have the script saved as random_m3u.pl, and I run:
random_m3u.pl audall.m3u > audfav.m3u


#!/usr/bin/perl
use strict;
use warnings;
my @list;
while (<>) {
	my $comment = $_;
	my $file = <>;
	#print $file, "-",$comment, "\n";
	push @list, {
		comment => $comment,
		file    => $file,
	};
}
fisher_yates_shuffle(\@list);
foreach (@list) {
	print $_->{'comment'}, $_->{'file'};
}
# fisher_yates_shuffle( \@array ) : generate a random permutation
# of @array in place
# from perlfaq4 
#    http://perldoc.perl.org/perlfaq4.html
sub fisher_yates_shuffle {
    my $array = shift;
    my $i;
    for ($i = @$array; --$i; ) {
        my $j = int rand ($i+1);
        next if $i == $j;
        @$array[$i,$j] = @$array[$j,$i];
    }
}


l8rZ

Edited by - andrew on 04/18/2006 6:00:22 PM

Your quick response to this post: (0 total votes)
I agree (0%)
I disagree (0%)
Go to Top of Page

rastyk
Posting is for Closers

41 Posts

Posted - 04/22/2006 :  2:49:39 PM  Show Profile
Now that's good thinking!

Your quick response to this post: (0 total votes)
I agree (0%)
I disagree (0%)
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Neuros Forums Go To Top Of Page
Snitz Forums 2000