# Process the WAV file into an MP3 and FLAC file.
# This is done in a background process.
def process_wav(track)
- FileUtils.mkdir_p(track.flac_dir, $fu_args)
+ FileUtils.mkdir_p(track.flac_dir, verbose: true, noop: !$opts.dry_run)
my_system("flac -f '#{track.wav_file_name}' \
--output-name='#{track.flac_file_name}' &>/dev/null")
my_system("flac --test '#{track.flac_file_name}' &>/dev/null")
- FileUtils.mkdir_p(track.mp3_dir, $fu_args)
+ FileUtils.mkdir_p(track.mp3_dir, verbose: true, noop: !$opts.dry_run)
my_system("lame -q 1 -b 192 '#{track.wav_file_name}' \
'#{track.mp3_file_name}' &>/dev/null")
- FileUtils.rm_f(track.wav_file_name, $fu_args)
+ FileUtils.rm_f(track.wav_file_name, verbose: true, noop: !$opts.dry_run)
end
def audiorip(tnum, track)
raise "failed to rip track #{tnum} (#{track.name})"
end
# cdparanoia always outputs to cdda.wav
- FileUtils.mv("cdda.wav", track.wav_file_name, $fu_args)
+ FileUtils.mv("cdda.wav", track.wav_file_name, verbose: true, noop: !$opts.dry_run)
# If there are too many processes, wait for one of them to terminate
if ($children.keys.length > $opts.max_children) then
opts.dry_run = false
opts.max_children = 4
opts.cd_dev = "/dev/cdrom"
- $fu_args = { :verbose => true }
# Fill in opts values
parser = OptionParser.new do |myparser|
myparser.on("--dry-run", "-d",
"Show what would be done, without doing it.") do |a|
opts.dry_run = true
- $fu_args = { :verbose => true, :noop => true }
end
myparser.on("--tracklist [FILE]", "-t",
"Provide a list of tracks to use.") do |file|