Logged In: YES
user_id=444162

OK, I did some thinking and that was really ugly. I've
tried to improve on it a bit by adding a default level that
is explicitly declared, doing some bounds checking, and
adding to the documentation.

diff -aur old/flacify new/flacify
--- old/flacify 2004-05-17 21:35:07.797361975 -0400
+++ new/flacify 2004-05-17 21:40:52.527514056 -0400
@@ -25,6 +25,8 @@
my $debug = 0;
my $dryrun = 0;
my $tagdiscs = 0;
+my $defaultlevel = 7;
+my $flaclevel = $defaultlevel;
my %EXES = ("unshn" => undef,
"flac" => undef,
"metaflac" => undef);
@@ -50,6 +52,7 @@
GetOptions ("debug!" => \$debug,
"discs!" => \$tagdiscs,
"dry-run!" => \$dryrun,
+ "flaclevel=i" => \$flaclevel,
"help!" => sub { use Pod::Usage;
pod2usage (-exitval => 0,
-verbose => 1); },
"version!" => sub { print "$progname $rcsid\n";
exit (0); });
@@ -200,10 +203,12 @@

     \# Compress the WAV files to FLAC files, deleting as

we go.
# Ensure CD sector alignment
+ if ( $flaclevel < 0 || $flaclevel > 8 ) {
$flaclevel = $defaultlevel };
my $status = run_command ("flac",
"--sector-align",
"--delete-input-file",
"--replay-gain",
+ "-".$flaclevel,
@FILES);

     if \($status \!= 0\) \{

@@ -427,6 +432,10 @@

Print what commands would be run, but don't run them.

+=item B<--flaclevel <n>>
+
+Set flac compression level to n where 0 <= n <= 8.
Defaults to value of $defaultlevel, which is defined at line
28 of the script.
+
=back

=head1 DESCRIPTION
@@ -471,7 +480,7 @@

Any WAV files resulting from the previous step are then
compressed
using the command line L<flac> encoder. The following
options are
-passed to L<flac>: --sector-align --delete-input-file
--replay-gain.
+passed to L<flac> along with the default or selected
compression level: --sector-align --delete-input-file
--replay-gain.

=item Tagging