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



Rockbox mail archive

Subject: Re: Play songs by tracknum
From: David Newhook (d_newhook_at_hotmail.com)
Date: 2004-03-03


That's great Matt thanks very much.

I'm a novice with Perl, I'm getting the following running the script in my
home cygwin directory with a couple of mp3 files...

$ ./rename.sh
Can't locate MP3/Tag.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.2/cygwin-thre
ad-multi-64int /usr/lib/perl5/5.8.2
/usr/lib/perl5/site_perl/5.8.2/cygwin-thread
-multi-64int /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl .) at
/ren
ame.sh line 3.
BEGIN failed--compilation aborted at ./rename.sh line 3.

Do I need to re-run cygwin setup to get the MP3/Tag.pm module?

Cheers,
Dave

----- Original Message -----
From: "Matthew A. R. Sherian" <mars_at_mars-tmc.hq.themunicenter.com>
To: "Rockbox development" <rockbox_at_cool.haxx.se>
Sent: Wednesday, March 03, 2004 1:37 PM
Subject: Re: Play songs by tracknum

> Here is a little perl script I I wrote to rename files. If you are using
> linux or have Cygwin (www.cygwin.com)
>
> #!/usr/bin/perl
>
> use MP3::Tag;
> use Getopt::Long;
> my $basedir;
> GetOptions(
> "batch" => \$batch,
> "single" => \$single,
> "help" => \$help
> );
> unless($batch||$single){
> die "usage: mp3rename.pl {--single|--batch}\n";
> }
> if ( defined($help) ){
> print "usage: mp3rename.pl {--single|--batch}\n";
> }
>
> if ( $batch ){
> @ls = split(/\n/,`ls -1`);
> foreach $filename (@ls){
> chomp($filename);
> if ($filename =~ /\.mp3/){
> RN();
> }
> }
> }
>
> if ( $single ){
> $filename = $ARGV[0] or print "You must supply a file\n";
> chomp($filename);
> if ($filename =~ m#/#){
> @path=split(/\//,$filename);
> pop(@path);
> foreach $e (@path){
> $basedir .= "$e/";
> }
> }
> if ($filename =~ /\.mp3/){
> RN();
> }
> }
> sub RN{
> $mp3 = MP3::Tag->new($filename);
>
> # get some information about the file in the easiest way
> ($song, $track, $artist, $album) = $mp3->autoinfo();
> if ( ! defined $track ){die "No Track Data, please use id3tag to
> provide\n";}
> $song =~ s/\?//g;
> if ($track <= 9 ){
> $track =~ s/(\d)/0$1/g;
> }
> $mp3->close();
> if ($basedir){
> print "Moving from $filename -> $basedir/$track $song.mp3\n";
> rename ($filename, "$basedir/$track $song.mp3")
> }
> else{
> print "Moving from $filename -> $track $song.mp3\n";
> rename ($filename, "$track $song.mp3")
> }
> }
>
>
> On Wed, 2004-03-03 at 04:47, David Newhook wrote:
> > Hi there,
> >
> > I'm new to the list but a longtime owner of an archos player 6000. I've
> > only got 4.5gb now thanks to an incident with the original drive during
a
> > very wet hike on a glacier... :p
> >
> > I just wanted to know if anyone knows how to, or would like to be able
to,
> > play a directory of tunes sorted by artist, tracknum then title.
> >
> > I haven't found a way to do this yet. I know this can be achieved with
> > playlists, but I haven't found a tool for compiling lists in the order I
> > want (any suggestions) and to be honest, I think generating all those
> > playlists for achieving a simple sort, would be overkill.
> >
> > Or maybe everyone simply enjoys listening to their album tracks in
> > alphabetical order?
> >
> > Suggestions on a postcard please...
> >
> > Dave
> >
> > _______________________________________________
> > http://cool.haxx.se/mailman/listinfo/rockbox
> >
> _______________________________________________
> http://cool.haxx.se/mailman/listinfo/rockbox
>
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox



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