Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / icedax / readmult
1 #! /bin/sh
2 #
3 # Script to read more than 1 song with icedax
4 # Each file gets an individual name from the command line
5 #
6 # based on a perl script from Matthias Schniedermeyer
7 #
8 # usage: readmult <track a> <title a> <track b> <title b> ...
9 #
10 # example: readmult 1 intro 3 lovesong 5 medley
11 # will produce a file named intro.wav for track 1,
12 #              a file named lovesong.wav for track 3, and
13 #              a file named medley.wav for track 5.
14 #
15 CDDA2WAV=icedax
16 CDDA2WAVOPTS="-P0"
17
18 if [ $(( $# % 2 )) -eq 0 ]; then
19   while [ $# -ge 2 ]; do
20     $CDDA2WAV $CDDA2WAVOPTS -Owav -t $1 $PREFIX$2".wav"
21     RES=$?
22     if [ $RES -ne 0 ]; then
23       echo "$CDDA2WAV error, return value "$RES". Aborted." >&2
24       break
25     fi
26     shift 2
27   done
28 else
29   echo "usage: $0 [<Tracknr> <Filename>] ..." >&2
30 fi
31