B<fa-flacd> [B<-jv>]
-B<fa-rip>
+B<fa-rip> [B<-d> I<device>] [B<-t> I<track-count>]
B<fa-tags> I<track-count>
=head2 FA-RIP
B<fa-rip> uses C<mktemp(1)> to create a directory for storage of its
-intermediate files. It uses C<cdrdao(1)> to create the "cue" file and
+intermediate files. It uses C<mkcue(1)> to create the "cue" file and
then passes the number of tracks (from the "cue" file) as command-line
-arguments to B<fa-tags>. Finally, it execs C<cdparanoia(1)> to rip
-the CD to the "wav" file.
+arguments to B<fa-tags>.
+
+If B<-t> I<track-count> is specified, that number is used instead of
+counting tracks in the "cue" file, and is also passed to C<mkcue(1)>
+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<cdparanoia(1)> to rip the CD to the "wav" file.
In order for this CD to be processed by B<fa-flacd>, the user must
create a "tags" file. This is usually done by renaming one of the
return 1
}
+trackcount=
+while getopts 'd:t:' ch; do
+ case ${ch} in
+ d)
+ CDDEV=${OPTARG}
+ export CDDEV
+ ;;
+ t)
+ trackcount=${OPTARG}
+ ;;
+ ?)
+ echo 'fa-rip [-t track-count]' >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((${OPTIND} - 1))
+
if [[ -z ${CDDEV} ]]; then
if ! get_cddev; then
echo 'CDDEV environment variable not set, defaults did not work' >&2
dir=$(mktemp -d flac-archive.XXXXXXXXXX)
cd ${dir}
-mkcue ${CDDEV} > cue
-
-trackcount=$(grep -c 'TRACK.*AUDIO' cue)
+if [[ -z ${trackcount} ]]; then
+ mkcue ${CDDEV} > cue
+ trackcount=$(grep -c 'TRACK.*AUDIO' cue)
+else
+ mkcue -t ${trackcount} ${CDDEV} > cue
+fi
fa-tags ${trackcount}