#!/usr/bin/perl -w # tocmake.pl v0.2 # now supports pregaps between each track. Specify at command line # run with no command line option for usage info #Thanks to dave for the new feature #tocmake.pl 0.1 - gets a listing of all .wav files in the current directory #and creates file new.toc for use with cdrdao. The TOC-file contains all #the wav files in alphabetical order, with no pregaps in between tracks. #Jan 9, 2000 - Matt Borowski use strict; my (@filenames, $filename, $gap, $i, $numberoffiles, $line, $yesno, $j); print "\nCDRDAO Table of Contents Creation Tool (tocmake.pl)\n\n"; &help if ($#ARGV eq -1); if (!defined($filename)){$filename = "new.toc";} $gap = $ARGV[1]; if (!defined($gap)){$gap = 0;} @filenames = glob("*.wav"); $i=1; foreach $line (@filenames){ print "$i) $line\n"; $i++; } $numberoffiles=@filenames; print "\nCreate $filename file with $numberoffiles files [with $gap second gaps between them]\n=> (y/n)? "; $yesno = ; chomp($yesno); #if($yesno eq "y"){ if($yesno =~ /[yY]/i){ print "Writing $filename file: "; open(TOC,">$filename"); print TOC "CD_DA\n"; $j=1; foreach $line (@filenames){ print TOC "// Track $j\n"; print TOC "TRACK AUDIO\n"; if ($gap != 0){print TOC "PREGAP 0:$gap:0\n";} print TOC "FILE \"$line\" 0\n"; $j++; } print "done.\n\n"; } else { print "Okay, aborting.\n\n"; exit; } sub help { print "Usage: $0 \n\n"; exit; }