This is now tested; both multi-file and single-file modes work fine,
and multi-file is now fully parallelizable.
(flac): Refactor this to encode one wav file to one flac, instead of
looping over all the wavs for a multi-file mode. This leaves behind
the fa-rip directories instead of cleaning them up; i left a comment
where the cleanup should happen; easy enough to fix. When creating or
removing files or directories, test for $!{EEXIST} and $!{ENOENT} on
failure rather than stat(2)ing up front.
(flacloop): Move some of the multi-file processing here into our new
Jobs::run get-jobs function; it manages a queue of wav files so we can
fully parallelize even multi-file jobs, instead of having the disc as
the unit of parallelization.
Improve Jobs package:
- no longer need global @jobs and @finished
- @finished is gone completely
- new run function which takes care of all the details; you just give
it a function to call to get a new job function, and optional
reportingi functions.
epg [Fri, 23 Jun 2006 01:30:43 +0000 (01:30 +0000)]
Here's a simple hack to split single cue-containing flac files into
single-track flac files. It's almost entirely a copy/paste of
parts of fa-flacd and flac2mp3; all the common parts really should
be factored out...
WTF! I just noticed that i forgot the part of hhlp that would
actually create the array reference, but it worked anyway! Now i
find out perl has autovivified these since at least 2000. Yet i'm
sure they weren't being autovivified when i had to do something
similar at Lexmark a couple years ago. Maybe it was a bug in
whatever Perl version i was using, or more likely i was just smoking
crack...
(newjob): Should be setting $SIG{CHLD} to 'DEFAULT', not 'IGNORE'.
The former happened to work on NetBSD but isn't right, and doesn't
work on Linux 2.6 (was causing system(flac) to return -1).
1. Switch to TITLE[n] style tags
2. Support multi-artist discs
(tags_file): Split all the duplicated candidate-tags file writing
stuff from tags into this new function. It uses TITLE[n] style tags,
and ARTIST[n] tags for multi-artist discs.
(tags): Use tags_file. If any of the matching MusicBrainz album
objects' has_various_artists function returns true, make a
candidate-tags-0v file with blank ARTIST[n] entries, as well as
putting them in the candidate-tags-$i file.
epg [Sun, 5 Dec 2004 07:10:57 +0000 (07:10 +0000)]
(run_or_die): Print command if verbose mode.
(flac2mp3): Pass --quiet and --verbose options to flac and lame as
appropriate. If --lame-options given, also pass those to lame.
Previously --preset standard was hard-coded, now it is just the
default if --lame-options is not given.
(MAIN): Now take options: --lame-options, -q/--quiet, -v/--verbose,
and -h/--help.
epg [Sat, 23 Oct 2004 02:40:41 +0000 (02:40 +0000)]
Ah-hah! I have finally found the bug that caused my mp3s to include a
bit of the next track at the end of one, but only sometimes. The
hundredths of a second vs. sector was certainly a bug, but was not
this bug.
(get_decode_args): Use sprintf %02d for each field. Previously i
was just stringing them together with colon and dot, so "9" becomes
"9" instead of "09", which flac sees as 90!
Sanitize filename sanitization and quoting. I'm not sure why i was
s/[:'"]/_/g, momentary insanity i suppose. All i need do is replace /
with _ on output filenames and replace ' with '\'' on filenames that
will go to the shell surrouned by '' quotes, instead of being passed
directly into a program's argv.
fa-flacd:
(flac): Do / sanitization only, since we're not going through the
shell, but running flac directly.
flac2mp3:
(flac2mp3): We weren't sanitizing the input filename; start doing
so. Only do ' sanitization for input file and output id3tag
information, additionally do / sanitization on $outfile.
epg [Sun, 29 Aug 2004 23:14:14 +0000 (23:14 +0000)]
(reaper): Why was i passing 0 to waitpid? All the documentation says
to pass -1. 0 worked on NetBSD 1.6 but hangs on 2.0. Now pass -1 as
we're supposed to.
Try counting audio track lines in the cue file for the number of the
last track instead of $discid[2]. This seems to work better (so far)
for discs with data tracks.