X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/d9db8984a67a969021899cd303680bfdbe5014c1..32851f8a26bc6a015c5ea215330cc1ea0c743608:/fa-flacd diff --git a/fa-flacd b/fa-flacd index e2a2b21..5f3ab7f 100755 --- a/fa-flacd +++ b/fa-flacd @@ -10,7 +10,7 @@ B, B, B - archive CDs to single FLAC files B [B<-jv>] -B +B [B<-d> I] [B<-t> I] B I @@ -85,16 +85,11 @@ sub flac { verbose("chdir($dir)\n"); chdir($dir) or die("chdir($dir): $!"); - $outfile = "$album.flac-tmp"; - for ($outfile) { - s/\//_/g; - s/:/_/g; - s/'/_/g; - s/"/_/g; - } + $outfile = "$album"; + $outfile =~ s/\//_/g; verbose("Running flac\n"); - $status = system('flac', '-o', "../$artist/$outfile", + $status = system('flac', '-o', "../$artist/$outfile.flac-tmp", '--delete-input-file', '-V', '--cuesheet', 'cue', '--no-padding', '--best', map({ ('-T', $_) } @tags), @@ -110,15 +105,13 @@ sub flac { verbose("Cleaning up $dir\n"); unlink('using-tags') or die("unlink(using-tags): $!"); unlink('cue') or die("unlink(cue): $!"); - rename('toc', "../$artist/$album.toc") - or die("rename(toc, ../$artist/$album.toc): $!"); - rename('log', "../$artist/$album.log") - or die("rename(log, ../$artist/$album.log): $!"); + rename('log', "../$artist/$outfile.log") + or die("rename(log, ../$artist/$outfile.log): $!"); chdir('..') or die("chdir(..): $!"); rmdir($dir) or die("rmdir($dir): $!"); - rename("$artist/$album.flac-tmp", "$artist/$album.flac") - or die("rename($artist/$album.flac-tmp, $artist/$album.flac): $!"); + rename("$artist/$outfile.flac-tmp", "$artist/$outfile.flac") + or die("rename($artist/$outfile.flac-tmp, $artist/$outfile.flac): $!"); return 0; } @@ -256,10 +249,16 @@ artist directory (and named by album) and the ID directory is removed. =head2 FA-RIP B uses C to create a directory for storage of its -intermediate files. It uses C to create the "cue" file and +intermediate files. It uses C to create the "cue" file and then passes the number of tracks (from the "cue" file) as command-line -arguments to B. Finally, it execs C to rip -the CD to the "wav" file. +arguments to B. + +If B<-t> I is specified, that number is used instead of +counting tracks in the "cue" file, and is also passed to C +to ensure that only that number of tracks is listed in the "cue" file. +This is handy if the CD has stupid data tracks. + +Finally, it execs C to rip the CD to the "wav" file. In order for this CD to be processed by B, the user must create a "tags" file. This is usually done by renaming one of the