Minor typos.
authordata <data@a0fa61bc-5347-0410-a1a9-7f54aa4e1825>
Tue, 10 Jun 2008 10:32:24 +0000 (10:32 +0000)
committerdata <data@a0fa61bc-5347-0410-a1a9-7f54aa4e1825>
Tue, 10 Jun 2008 10:32:24 +0000 (10:32 +0000)
Applied some patches from Bill Adams and Marc Staveley.

git-svn-id: http://abcde.googlecode.com/svn/trunk@239 a0fa61bc-5347-0410-a1a9-7f54aa4e1825

abcde
abcde.conf
debian/changelog

diff --git a/abcde b/abcde
index f78666c..2358c1f 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -58,7 +58,7 @@ echo "-r <host1[,host2]...>"
 echo "       Also encode on these remote hosts"
 echo "-R     Use local CDDB in recursive mode"
 echo "-s <field>"
 echo "       Also encode on these remote hosts"
 echo "-R     Use local CDDB in recursive mode"
 echo "-s <field>"
-echo "       Show dielfs from the CDDB info (year,genre)"
+echo "       Show fields from the CDDB info (year,genre)"
 echo "-S <#> Set the CD speed"
 echo "-t <#> Start the track numbering at a given number"
 echo "-T <#> Same as -t but modifies tag numbering"
 echo "-S <#> Set the CD speed"
 echo "-t <#> Start the track numbering at a given number"
 echo "-T <#> Same as -t but modifies tag numbering"
@@ -68,7 +68,7 @@ echo "-V     Be a bit more verbose about what is happening behind the scenes"
 echo "-x     Eject CD after all tracks are read"
 echo "-w <comment>"
 echo "       Add a comment to the CD tracks"
 echo "-x     Eject CD after all tracks are read"
 echo "-w <comment>"
 echo "       Add a comment to the CD tracks"
-echo "-W <#> Contatenate CDs: -T #01 -w \"CD #\"" 
+echo "-W <#> Concatenate CDs: -T #01 -w \"CD #\"" 
 echo "-z     Use debug CDROMREADERSYNTAX option (needs cdparanoia)"
 echo ""
 echo "Tracks is a space-delimited list of tracks to grab."
 echo "-z     Use debug CDROMREADERSYNTAX option (needs cdparanoia)"
 echo ""
 echo "Tracks is a space-delimited list of tracks to grab."
@@ -420,6 +420,9 @@ getcddbinfo()
        TRACKNAME)
                TRACKNAME="$(grep ^TTITLE$CDDBTRACKNUM= "$CDDBDATA" | cut -f2- -d= | tr -d \[:cntrl:\] | sed 's/\ \+$//')"
                ;;
        TRACKNAME)
                TRACKNAME="$(grep ^TTITLE$CDDBTRACKNUM= "$CDDBDATA" | cut -f2- -d= | tr -d \[:cntrl:\] | sed 's/\ \+$//')"
                ;;
+       TRACK-INFO)
+               grep ^EXTT$CDDBTRACKNUM= "$CDDBDATA" | cut -f2- -d= | tr -d \[:cntrl:\] | perl -p -e 's/\\n/\n/;'
+               ;;
        esac
 }
 
        esac
 }
 
@@ -539,6 +542,7 @@ do_replaygain()
                        case "$OUTPUT" in
                                flac)
                                        run_command replaygain-flac nice $ENCNICE $METAFLAC --add-replay-gain "${OUTPUTFILES[@]}"
                        case "$OUTPUT" in
                                flac)
                                        run_command replaygain-flac nice $ENCNICE $METAFLAC --add-replay-gain "${OUTPUTFILES[@]}"
+                                       #run_command replaygain-flac true
                                        ;;
                                vorbis|ogg)
                                        run_command replaygain-vorbis nice $ENCNICE $VORBISGAIN --album "${OUTPUTFILES[@]}"
                                        ;;
                                vorbis|ogg)
                                        run_command replaygain-vorbis nice $ENCNICE $VORBISGAIN --album "${OUTPUTFILES[@]}"
@@ -774,11 +778,14 @@ return 0
 # do_tag [tracknumber]
 # id3 tags a filename
 # variables used:
 # do_tag [tracknumber]
 # id3 tags a filename
 # variables used:
-# TRACKS, TRACKNAME, TRACKARTIST, TAGGER, TAGGEROPTS, VORBISCOMMENT, METAFLAC, 
+# TRACKS, TRACKNAME, TRACKARTIST, TAGGER, TAGGEROPTS, VORBISCOMMENT, METAFLAC, ATOMICPARSLEY 
 # COMMENT, DALBUM, DARTIST, CDYEAR, CDGENRE (and temporarily) ID3TAGV
 do_tag ()
 {
        COMMENTOUTPUT="$(eval echo ${COMMENT})"
 # COMMENT, DALBUM, DARTIST, CDYEAR, CDGENRE (and temporarily) ID3TAGV
 do_tag ()
 {
        COMMENTOUTPUT="$(eval echo ${COMMENT})"
+       if [ -z "$COMMENTOUTPUT" ]; then
+               COMMENTOUTPUT="$(getcddbinfo TRACK-INFO)"
+       fi
        CDDBDISCID=$(echo $TRACKINFO | cut -d' ' -f1)
        run_command '' echo "Tagging track $1 of $TRACKS: $TRACKNAME..."
        # If we want to start the tracks with a given number, we need to modify the
        CDDBDISCID=$(echo $TRACKINFO | cut -d' ' -f1)
        run_command '' echo "Tagging track $1 of $TRACKS: $TRACKNAME..."
        # If we want to start the tracks with a given number, we need to modify the
@@ -901,7 +908,20 @@ do_tag ()
                        run_command tagtrack-$OUTPUT-$1 true
                        ;;
                m4a)
                        run_command tagtrack-$OUTPUT-$1 true
                        ;;
                m4a)
-                       run_command tagtrack-$OUTPUT-$1 true
+                       #  Use a temp-file of our choice. --overWrite seems to
+                       #  case core dumps with AtomicParsley 0.9.0
+                       ATOMICTEMPFILE="$ABCDETEMPDIR/track$1.m4a-atomic"
+
+                       VARIOUSBOOL="false"
+                       if [ "$VARIOUSARTISTS" = "y" ]; then
+                               VARIOUSBOOL="true"
+                       fi
+
+                       #It has to be command file opts for AtomicParsley
+                       run_command tagtrack-$OUTPUT-$1 nice $ENCNICE $ATOMICPARSLEY $ABCDETEMPDIR/track$1.m4a --artist "$TRACKARTIST" --album "$DALBUM" --title "$TRACKNAME" --tracknum ${TRACKNUM:-$1} --year "$CDYEAR" --genre "$CDGENRE" --compilation $VARIOUSBOOL --comment "$COMMENTOUTPUT" --output $ATOMICTEMPFILE
+                       if [ -f $ATOMICTEMPFILE ]; then
+                               mv "$ATOMICTEMPFILE" "$ABCDETEMPDIR/track$1.m4a"
+                       fi
                        ;;
                wav)
                        run_command tagtrack-$OUTPUT-$1 true
                        ;;
                wav)
                        run_command tagtrack-$OUTPUT-$1 true
@@ -2865,6 +2885,13 @@ post_read ()
 :
 }
 
 :
 }
 
+# post_encode
+# Empty post_encode function, to be defined in the configuration file.
+post_encode ()
+{
+:
+}
+
 ###############################################################################
 # End of functions
 #
 ###############################################################################
 # End of functions
 #
@@ -3506,6 +3533,7 @@ do
                        ;;
                m4a)
                        [ "$AACENCODERSYNTAX" = "default" ] && AACENCODERSYNTAX=faac
                        ;;
                m4a)
                        [ "$AACENCODERSYNTAX" = "default" ] && AACENCODERSYNTAX=faac
+                       [ "$DOTAG" = "y" ] && CHECKATOMICPARSLEY=y
                        ;;
                wav)
                        if [ "$KEEPWAVS" = "y" ]; then
                        ;;
                wav)
                        if [ "$KEEPWAVS" = "y" ]; then
@@ -3564,6 +3592,8 @@ case "$FLACENCODERSYNTAX" in
        flac)
                FLACENCODEROPTS="${FLACENCODEROPTSCLI:-$FLACOPTS}"
                FLACENCODER="$FLAC"     
        flac)
                FLACENCODEROPTS="${FLACENCODEROPTSCLI:-$FLACOPTS}"
                FLACENCODER="$FLAC"     
+               if [ "$DOREPLAYGAIN" = "y" ]; then
+                       FLACENCODEROPTS="${FLACENCODEROPTS} --replay-gain"
                # FLAC streams can be encapsulated on a Ogg transport layer
                if echo "$FLACENCODEROPTS" | egrep -- "(^| )--ogg($| )" > /dev/null 2>&1 ;then
                        log error "FLAC on an Ogg container is not yet supported"
                # FLAC streams can be encapsulated on a Ogg transport layer
                if echo "$FLACENCODEROPTS" | egrep -- "(^| )--ogg($| )" > /dev/null 2>&1 ;then
                        log error "FLAC on an Ogg container is not yet supported"
@@ -3728,6 +3758,7 @@ fi
 for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $MP3ENCODER \
        $OGGENCODER $FLACENCODER $SPEEXENCODER $MPPENCODER \
        $AACENCODER \
 for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $MP3ENCODER \
        $OGGENCODER $FLACENCODER $SPEEXENCODER $MPPENCODER \
        $AACENCODER \
+       ${NEEDATOMICPARSLEY+$ATOMICPARSLEY} \
        ${NEEDHTTPGET+$HTTPGET} ${NEEDDISTMP3+$DISTMP3} \
        ${NEEDCOMMENTER+$VORBISCOMMENT} ${NEEDMETAFLAC+$METAFLAC} \
        ${NEEDNORMALIZER+$NORMALIZER} ${NEEDEJECT+$EJECT} \
        ${NEEDHTTPGET+$HTTPGET} ${NEEDDISTMP3+$DISTMP3} \
        ${NEEDCOMMENTER+$VORBISCOMMENT} ${NEEDMETAFLAC+$METAFLAC} \
        ${NEEDNORMALIZER+$NORMALIZER} ${NEEDEJECT+$EJECT} \
@@ -3739,6 +3770,15 @@ do
        checkexec "$X"
 done
 
        checkexec "$X"
 done
 
+if [ "$CHECKATOMICPARSLEY" = "y" ]; then
+       if ! new_checkexec "$ATOMICPARSLEY"; then
+               echo "WARNING: $ATOMICPARSLEY Not Found Not Post-Tagging!"
+               DOTAG='n'
+       else
+               echo "Using $ATOMICPARSLEY To Tag AAC Tracks."
+       fi
+fi
+
 # And last but not least, check if we can diff between files. We do not abort,
 # since diffing is not critical...
 if [ -x $(which $DIFF) ]; then :; else
 # And last but not least, check if we can diff between files. We do not abort,
 # since diffing is not critical...
 if [ -x $(which $DIFF) ]; then :; else
@@ -4156,6 +4196,9 @@ if [ "$DOREPLAYGAIN" = "y" ]; then
        do_replaygain
 fi
 
        do_replaygain
 fi
 
+# Execute the user-defined post_encode function before cleaning up
+post_encode
+
 # Check to see if run_command logged any errors
 if [ -f "$ABCDETEMPDIR/errors" ]; then
        log error "The following commands failed to run:"
 # Check to see if run_command logged any errors
 if [ -f "$ABCDETEMPDIR/errors" ]; then
        log error "The following commands failed to run:"
index c24a369..e3cd89f 100644 (file)
 # * Translate colons to a space and a dash for Windows compatibility
 # * Eat control characters, single quotes, and question marks
 # * Translate spaces and forward slashes to underscores
 # * Translate colons to a space and a dash for Windows compatibility
 # * Eat control characters, single quotes, and question marks
 # * Translate spaces and forward slashes to underscores
-# * Translate stars into pluses.
 # To change that, redefine the mungefilename function.
 # mungefilename receives the CDDB data (artist, track, title, whatever)
 # as $1 and outputs it on stdout.
 #mungefilename ()
 #{
 # To change that, redefine the mungefilename function.
 # mungefilename receives the CDDB data (artist, track, title, whatever)
 # as $1 and outputs it on stdout.
 #mungefilename ()
 #{
-#      echo "$@" | sed s,:,\ -,g | tr \ /\* __+ | tr -d \'\"\?\[:cntrl:\]
+#      echo "$@" | sed s,:,\ -,g | tr \ / __ | tr -d \'\"\?\[:cntrl:\]
 #}
 
 # Custom genre munging:
 #}
 
 # Custom genre munging:
 #:
 #}
 
 #:
 #}
 
+# post_encode
+# By default it does nothing.
+# You can set some things to get abcde function in better ways:
+# * Move the resulting directory over the network
+# * Compare results with a previously made run, for tests
+# KEEP IN MIND that executables included in post_encode must be in your $PATH or
+# you have to define them with full /path/to/binary
+# Uncomment and substitute the ":" with your commands.
+#post_encode ()
+#{
+#:
+#}
+
 # If you'd like to have abcde eject the cdrom after all the tracks have been
 # read, uncomment the following line.
 #EJECTCD=y
 # If you'd like to have abcde eject the cdrom after all the tracks have been
 # read, uncomment the following line.
 #EJECTCD=y
index 061fe20..8b1fa5f 100644 (file)
@@ -21,6 +21,11 @@ abcde (2.3.99.7-1) unstable; urgency=low
   * Corrected man page wrapping. Thanks to Edward J. Shornock
     (Closes: #399289).
   * Adds DISCNUMBER to Ogg/Vorbis and FLAC when using -W.
   * Corrected man page wrapping. Thanks to Edward J. Shornock
     (Closes: #399289).
   * Adds DISCNUMBER to Ogg/Vorbis and FLAC when using -W.
+  * Minor typos (Closes: #458995)
+  * Added AtomicParley for AAC encoding. Thanks to Bill Adams.
+  * Added by Marc Staveley:
+    - post_encode hook.
+    - track comments if null and present in CDDB.
 
  -- Jesus Climent <jesus.climent@hispalinux.es>  Thu, 07 Nov 2007 10:29:54 +0300
 
 
  -- Jesus Climent <jesus.climent@hispalinux.es>  Thu, 07 Nov 2007 10:29:54 +0300