annotate gettracks.sh @ 9:f3f2657296d2

Use Tcl 8.2 Catch socket errors. Create separate dummy file generation proc.
author darius
date Thu, 18 Jul 2002 06:37:12 +0000
parents cf06ab549064
children c9ade2a9c808
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
74031379d3cb Initial revision
darius
parents:
diff changeset
1 #!/bin/sh
74031379d3cb Initial revision
darius
parents:
diff changeset
2
74031379d3cb Initial revision
darius
parents:
diff changeset
3 cddev=/dev/acd0c
74031379d3cb Initial revision
darius
parents:
diff changeset
4 root=`dirname $0`
74031379d3cb Initial revision
darius
parents:
diff changeset
5 if [ $# -eq 0 ]; then
74031379d3cb Initial revision
darius
parents:
diff changeset
6 tracks=`$root/cddb-id -f $cddev -n`
74031379d3cb Initial revision
darius
parents:
diff changeset
7 else
74031379d3cb Initial revision
darius
parents:
diff changeset
8 tracks=$*
74031379d3cb Initial revision
darius
parents:
diff changeset
9 fi
74031379d3cb Initial revision
darius
parents:
diff changeset
10
74031379d3cb Initial revision
darius
parents:
diff changeset
11 echo Ripping tracks $tracks
74031379d3cb Initial revision
darius
parents:
diff changeset
12
74031379d3cb Initial revision
darius
parents:
diff changeset
13 ripper="cdd -t \$num -"
74031379d3cb Initial revision
darius
parents:
diff changeset
14 comp="lame -x -b 192 - -"
74031379d3cb Initial revision
darius
parents:
diff changeset
15 #comp="gogo -silent -offset 0 -b 192 stdin"
74031379d3cb Initial revision
darius
parents:
diff changeset
16
74031379d3cb Initial revision
darius
parents:
diff changeset
17 for t in $tracks ; do
74031379d3cb Initial revision
darius
parents:
diff changeset
18 num=`printf %02d $t`
74031379d3cb Initial revision
darius
parents:
diff changeset
19 name=`printf track_%s.mp3 $num`
5
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
20 if [ -e ".${num}.done" ]; then
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
21 echo Skipping $num
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
22 continue
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
23 fi
3
74031379d3cb Initial revision
darius
parents:
diff changeset
24 echo Ripping $num to $name
74031379d3cb Initial revision
darius
parents:
diff changeset
25 eval $ripper 2>> rip.log | sox -t cdr - -t wav - | $comp > $name
74031379d3cb Initial revision
darius
parents:
diff changeset
26 if [ $? -ne 0 ]; then
74031379d3cb Initial revision
darius
parents:
diff changeset
27 echo "Failed!"
74031379d3cb Initial revision
darius
parents:
diff changeset
28 exit 1
74031379d3cb Initial revision
darius
parents:
diff changeset
29 fi
5
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
30 touch ".${num}.done"
3
74031379d3cb Initial revision
darius
parents:
diff changeset
31 done
74031379d3cb Initial revision
darius
parents:
diff changeset
32
5
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
33 rm .*.done
cf06ab549064 Write files to mark our progress and skip doing tracks if we have
darius
parents: 3
diff changeset
34