[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[abcde] Re: cddb-tool gives incorrect result with an inexact match
On Thu, Aug 31, 2000 at 07:05:38AM -0700, Robert Woodcock wrote:
> > Also, I have a patch to allow an additional configuration option:
> > 'nice'ness of the encoding, if anyone is out there (and/or
> > interested).
>
> I'm interested.
Here it is. Note, though, that it makes no check for the existence of
'nice' (though it's a built-in command for most shells, and a part of
the required base shellutils package for Debian systems). The syntax
"nice -ADJUSTMENT" for an increase of ADJUSTMENT seems to be more
universal than the alternate of "nice -n ADJUSTMENT". Thus, the former
is used.
I also added the ability to specify different nice levels for encoding
and CD recording (my very first modification was a simple 'renice
NICELEVEL $$' command before anything was run).
Also, this includes a modification to the 'vorbize' command that
allows it to embed the Artist, Album, and Track into the .ogg
properly.
Kevin.
-- Attached file included as plaintext by Listar --
diff -urN orig/abcde-1.9.1/abcde abcde-1.9.1/abcde
--- orig/abcde-1.9.1/abcde Thu Aug 31 11:38:16 2000
+++ abcde-1.9.1/abcde Thu Aug 31 11:37:49 2000
@@ -148,7 +148,7 @@
# do_encode [tracknumber] [hostname]
# If no hostname is specified, encode locally
# variables used:
-# TRACKS, TRACKNAME, DISTMP3, DISTMP3OPTS, ENCODERSYNTAX, OUTPUTTYPE, ENCODEROPTS
+# TRACKS, TRACKNAME, DISTMP3, DISTMP3OPTS, ENCODERSYNTAX, OUTPUTTYPE, ENCODEROPTS, DALBUM, DARTIST, ENCNICE
do_encode ()
{
IN="$ABCDETEMPDIR/track$1.wav"
@@ -160,16 +160,16 @@
run_command encodetrack-$1 $DISTMP3 $DISTMP3OPTS $2 "$IN" "$OUT"
else
case "$ENCODERSYNTAX" in
- lame|gogo) run_command encodetrack-$1 $ENCODER $ENCODEROPTS "$IN" "$OUT" ;;
- bladeenc|l3enc) run_command encodetrack-$1 $ENCODER "$IN" "$OUT" $ENCODEROPTS ;;
- mp3enc) run_command encodetrack-$1 $ENCODER -if "$OUT" -of "$OUT" $ENCODEROPTS ;;
+ lame|gogo) run_command encodetrack-$1 nice $ENCNICE $ENCODER $ENCODEROPTS "$IN" "$OUT" ;;
+ bladeenc|l3enc) run_command encodetrack-$1 nice $ENCNICE $ENCODER "$IN" "$OUT" $ENCODEROPTS ;;
+ mp3enc) run_command encodetrack-$1 nice $ENCNICE $ENCODER -if "$OUT" -of "$OUT" $ENCODEROPTS ;;
esac
fi
;;
ogg)
case "$ENCODERSYNTAX" in
- vorbize) run_command encodetrack-$1 $ENCODER $ENCODEROPTS "$IN" > "$OUT" ;;
- oggenc) run_command encodetrack-$1 $ENCODER $ENCODEROPTS "$IN" -o "$OUT" ;;
+ vorbize) run_command encodetrack-$1 nice $ENCNICE $ENCODER $ENCODEROPTS -w "$OUT" -a "$DARTIST" -t "$TRACKNAME" -l "$DALBUM" "$IN" ;;
+ oggenc) run_command encodetrack-$1 nice $ENCNICE $ENCODER $ENCODEROPTS "$IN" -o "$OUT" ;;
esac
;;
esac
@@ -571,9 +571,9 @@
OUTDATA="$ABCDETEMPDIR/track$UTRACKNUM.$OUTPUTTYPE"
echo "Grabbing track $UTRACKNUM: $TRACKNAME..." >&2
case "$CDROMREADERSYNTAX" in
- cdparanoia) $CDROMREADER -d $CDROM $UTRACKNUM "$WAVDATA" >&2 ;;
- cdda2wav) $CDROMREADER -H -D $CDROM -t $UTRACKNUM "$WAVDATA" >&2 ;;
- debug) $CDROMREADER -d $CDROM -w $UTRACKNUM-[:1] "$WAVDATA" >&2 ;;
+ cdparanoia) nice $RIPNICE $CDROMREADER -d $CDROM $UTRACKNUM "$WAVDATA" >&2 ;;
+ cdda2wav) nice $RIPNICE $CDROMREADER -H -D $CDROM -t $UTRACKNUM "$WAVDATA" >&2 ;;
+ debug) nice $RIPNICE $CDROMREADER -d $CDROM -w $UTRACKNUM-[:1] "$WAVDATA" >&2 ;;
esac
echo readtrack-$UTRACKNUM >> "$ABCDETEMPDIR/status"
}
@@ -592,6 +592,8 @@
PLAYLISTFORMAT='${ARTISTFILE}_-_${ALBUMFILE}.m3u'
PLAYLISTDATAPREFIX=''
ID3COMMENT=''
+ENCNICE=10
+RIPNICE=10
# program paths - defaults to checking your $PATH
LAME=lame
@@ -724,7 +728,21 @@
ENCODEROPTS="$MP3ENCOPTS"
ENCODER="$MP3ENC"
;;
+ vorbize)
+ ENCODEROPTS="$VORBIZEOPTS"
+ ENCODER="$VORBIZE"
+ ;;
esac
+
+# Clean up nice options (either use '-n NICELEVEL or -NICELEVEL')
+
+if [ "$ENCNICE" != "" ]; then
+ ENCNICE=-$ENCNICE
+fi
+if [ "$RIPNICE" != "" ]; then
+ RIPNICE=-$RIPNICE
+fi
+
if [ "$REMOTEHOSTS" != "" ]; then
REMOTEENCODE=y
diff -urN orig/abcde-1.9.1/abcde.conf abcde-1.9.1/abcde.conf
--- orig/abcde-1.9.1/abcde.conf Thu Aug 17 22:31:02 2000
+++ abcde-1.9.1/abcde.conf Thu Aug 31 11:36:12 2000
@@ -23,6 +23,15 @@
# and 'cdda2wav'.
#CDROMREADERSYNTAX=cdparanoia
+# Specify 'nice'ness of the encoder and of the CD reader.
+# This is a relative 'nice'ness (that is, if the parent process is at a
+# nice level of 12, and the ENCNICE is set to 3, then the encoder will
+# run with an absolute nice value of 15. Note also, that setting these
+# to be empty will result in some default niceness increase (4 in tcsh
+# and 10 using the bsdutils' nice).
+#ENCNICE=10
+#RIPNICE=10
+
# Paths of programs to use
#ID3=id3
#LAME=lame
To unsubscribe: echo unsubscribe | mail abcde-request@whimsica.lly.org