… | |
… | |
1263 | $table |
1263 | $table |
1264 | } |
1264 | } |
1265 | |
1265 | |
1266 | my %SORT_ORDER = ( |
1266 | my %SORT_ORDER = ( |
1267 | type => undef, |
1267 | type => undef, |
1268 | mtime => sub { sort { |
1268 | mtime => sub { |
|
|
1269 | my $NOW = time; |
|
|
1270 | sort { |
|
|
1271 | my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; |
|
|
1272 | my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; |
|
|
1273 | |
1269 | ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) |
1274 | ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) |
1270 | or $b->{mtime} <=> $a->{mtime} |
1275 | or $btime <=> $atime |
1271 | or $a->{type} <=> $b->{type} |
1276 | or $a->{type} <=> $b->{type} |
|
|
1277 | } @_ |
1272 | } @_ }, |
1278 | }, |
1273 | weight => sub { sort { |
1279 | weight => sub { sort { |
1274 | $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) |
1280 | $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) |
1275 | or $a->{type} <=> $b->{type} |
1281 | or $a->{type} <=> $b->{type} |
1276 | } @_ }, |
1282 | } @_ }, |
1277 | ); |
1283 | ); |
… | |
… | |
1916 | |
1922 | |
1917 | audio_music_finished; |
1923 | audio_music_finished; |
1918 | |
1924 | |
1919 | local $_; |
1925 | local $_; |
1920 | while (<$fh>) { |
1926 | while (<$fh>) { |
1921 | last; |
|
|
1922 | next if /^\s*#/; |
1927 | next if /^\s*#/; |
1923 | next if /^\s*$/; |
1928 | next if /^\s*$/; |
1924 | |
1929 | |
1925 | my ($file, $volume, $event) = split /\s+/, $_, 3; |
1930 | my ($file, $volume, $event) = split /\s+/, $_, 3; |
1926 | |
1931 | |