Here's my hacky patch to add SUBTITLE tags to flac files when ripping
in 1-file mode and when a cue sheet is being generated.  Since abcde
seems unmaintained I havent put a lot of effort into doing things the
right way.  Existing flac files can be tagged using existing cue files
outside of the context of abcde with something like this:
 awk -v r='"' '/^[ \t][ \t]*TRACK/ {printf "SUBTITLE(TRACK %s)=",$2}       \
               /^[ \t][ \t]*TITLE/ {split($0, st, r); printf "%s\n",st[2]}' \
        < foo.flac.cue | metaflac --import-tags-from=- foo.flac
--- /usr/bin/abcde	2006-08-05 15:14:30.000000000 -0400
+++ /home/cchiappa/bin/abcde_hack	2008-01-08 15:35:16.000000000 -0500
@@ -1970,6 +1970,16 @@
 	fi
 }
 
+# Add per-track tags to single file flac based on the generated cue file
+do_flactag_from_cue ()
+{
+    vecho "Tagging single-file flac from cue sheet"
+    awk -v r='"' '/^[ \t][ \t]*TRACK/ {printf "SUBTITLE(TRACK %s)=", $2}       \
+                  /^[ \t][ \t]*TITLE/ {split($0, st, r); printf "%s\n",st[2]}' \
+        < "$CUEFILE_IN" \
+        | $METAFLAC $METAFLACOPTS --import-tags-from=- "$ABCDETEMPDIR/track$1.$FLACOUTPUTCONTAINER"
+}
+
 # do_cddbparse
 # Parses a CDDB file and outputs the title and the track names.
 # Variables: CDDBFILE
@@ -4069,6 +4079,9 @@
 		if checkstatus cleancuefile >/dev/null; then :; else
 			if checkstatus cuefile >/dev/null ; then 
 				do_cleancue
+                                if [ "$ONETRACK" = "y" ] && [ "$OUTPUT" = "flac" ]; then
+                                    do_flactag_from_cue $UTRACKNUM
+                                fi
 			fi
 		fi
 	fi

Reply via email to