November 24, 2006, 06:54:24 PM
News: WELCOME TO THE NEW NEUROS FORUMS!  CLICK HERE FOR MORE INFORMATION
or email tartz(at)neurostechnology.com
  Pages: [1]
Print
Author Topic: Playlist  (Read 724 times)
ice.skillz
Jr. Member
**
Posts: 75


View Profile WWW Email
« on: April 04, 2006, 08:01:12 PM »

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
Logged

like my sig
andrew
Newbie
*
Posts: 40


View Profile Email
« Reply #1 on: April 18, 2006, 05:57:57 PM »

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:
Code:
random_m3u.pl audall.m3u > audfav.m3u
Code:
#!/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
« Last Edit: April 18, 2006, 06:00:22 PM by andrew » Logged

l8rZ
rastyk
Newbie
*
Posts: 48


View Profile Email
« Reply #2 on: April 22, 2006, 02:49:39 PM »

Now that's good thinking!
Logged
dendocx
Newbie
*
Posts: 5


View Profile Email
« Reply #3 on: September 16, 2006, 08:03:19 AM »

Yes, I understand the concept of your script, but I don't understand how I should make it work. So the random m3u shuffles all the names of the audall.m3u into audfav.m3u I guess? But how do you make it run that.

What do I do with the code   " random_m3u.pl audall.m3u > audfav.m3u"

Do I store it into an other .pl file? Cause that doesn't work. I don't know scripts Smiley
Logged
andrew
Newbie
*
Posts: 40


View Profile Email
« Reply #4 on: September 19, 2006, 01:20:37 PM »

Yes, I understand the concept of your script, but I don't understand how I should make it work.

You run it from the command line. 

First, you save the script (the code starting with #!/usr/bin/perl) onto the root of the 442 named random_m3u.pl.  The rest of the instructions are for Windows (2000 or XP) users, if there are instructions needed for other OSs, let me know and I will try to get some.

Figure out what drive letter the 442 was mapped on (look in My Computer), it is probably something like G:, and in my examples I will use G:

Click on Start, choose Run, type in cmd and click OK

This should bring you up to a C:\> prompt.  Type in G: (or whatever your 442 mounted as) and press enter.

The prompt should now say G:\>.  Type in the command from the first code box (random_m3u.pl audall.m3u > audfav.m3u) and press enter and that should randomize your audfav playlist. 

Type in exit and press enter to close the command window, stop the 442 and the favorite playlist should now be randomized.
Logged

l8rZ
andrew
Newbie
*
Posts: 40


View Profile Email
« Reply #5 on: September 19, 2006, 01:25:07 PM »

You run it from the command line. 
Thinking about it, you can probably also make a batch file that will make it easier. 

Save the first code box (random_m3u.pl audall.m3u > audfav.m3u) as random_m3u.bat on the root of your 442, and save the second code box as random_m3u.pl also on the root of the 442.   The root I refer to is the same place the audall.m3u file resides.

Then you should just need to double click on the random_m3u.bat script to randomize the playlist.

This is Windows only, and both of the instructions require that you have perl installed.
Logged

l8rZ
Maxi80
Newbie
*
Posts: 3


View Profile
« Reply #6 on: September 19, 2006, 02:36:16 PM »

How to play the playlist when all the files are added into the playlist ?
I can't see it in the audio menu
Logged
andrew
Newbie
*
Posts: 40


View Profile Email
« Reply #7 on: September 21, 2006, 02:06:45 PM »

How to play the playlist when all the files are added into the playlist ?
I can't see it in the audio menu

Turn on the 442
Choose Audio Player
Press the Menu button
Under the Repeat item, press right or left until you choose Fav
Press Back/Exit and you should have the audfav.m3u playlist
Logged

l8rZ
  Pages: [1]
Print
Jump to: