53 |
use gnump3d::config; # My configuration file reading module. |
use gnump3d::config; # My configuration file reading module. |
54 |
use gnump3d::files; # My routines for working with files and dirs. |
use gnump3d::files; # My routines for working with files and dirs. |
55 |
use gnump3d::lang::lookup; # Multilingual text translations. |
use gnump3d::lang::lookup; # Multilingual text translations. |
56 |
use gnump3d::playlist; # My playlist generating code. |
use gnump3d::sorting; # Global sorting functions. |
57 |
use gnump3d::tagcache; # Access to the tag cache. |
use gnump3d::tagcache; # Access to the tag cache. |
58 |
use gnump3d::IP; # Local copy of NetAddr::IP. |
use gnump3d::IP; # Local copy of NetAddr::IP. |
59 |
use gnump3d::url; # URL encoding and decoding |
use gnump3d::url; # URL encoding and decoding |
1749 |
$song_format= &getConfig( "song_format", $song_format ); |
$song_format= &getConfig( "song_format", $song_format ); |
1750 |
$play_rec = &getConfig( "play_recursively_text", $play_rec ); |
$play_rec = &getConfig( "play_recursively_text", $play_rec ); |
1751 |
$sort_order = &getConfig( "sort_order", $sort_order ); |
$sort_order = &getConfig( "sort_order", $sort_order ); |
|
print "Read sort order from configuration file : $sort_order\n"; |
|
1752 |
} |
} |
1753 |
|
|
1754 |
# |
# |
1828 |
# Find all the subdirs. |
# Find all the subdirs. |
1829 |
# |
# |
1830 |
my @files = &dirsInDir( $dir ); |
my @files = &dirsInDir( $dir ); |
1831 |
@files = sort {uc($a) cmp uc($b)} @files; |
@files = &sortDirectories( @files ); |
1832 |
|
|
1833 |
foreach my $file (@files) |
foreach my $file (@files) |
1834 |
{ |
{ |
2035 |
$tagCache->setFormatString( $sort_order ); |
$tagCache->setFormatString( $sort_order ); |
2036 |
|
|
2037 |
# |
# |
2038 |
# Sort numerically if the sort order includes '$TRACK'. |
# Sort the files by the given format string. |
2039 |
# |
# |
2040 |
if ( $sort_order =~ /\$TRACK/ ) |
my $sorter = gnump3d::sorting->new( ); |
2041 |
{ |
$sorter->setTagCache( $tagCache ); |
2042 |
@FULLNAMES = sort{ my $one = getSongDisplay( $a, $sort_order ); |
@FULLNAMES = &sortFiles( $sort_order, @FULLNAMES ); |
|
my $two = getSongDisplay( $b, $sort_order ); |
|
|
return( $one <=> $two ); } @FULLNAMES; |
|
|
} |
|
|
else |
|
|
{ |
|
|
@FULLNAMES = sort{ my $one = getSongDisplay( $a, $sort_order ); |
|
|
my $two = getSongDisplay( $b, $sort_order ); |
|
|
return( $one cmp $two ); } @FULLNAMES; |
|
|
} |
|
2043 |
|
|
2044 |
# |
# |
2045 |
# Interpolate each sorted file. |
# Interpolate each sorted file. |