Fix Cue file always references "dummy.wav" bug
authorColin Tuckley <colin@tuckley.org>
Sat, 13 Mar 2010 10:15:18 +0000 (10:15 +0000)
committerColin Tuckley <colin@tuckley.org>
Sat, 13 Mar 2010 10:15:18 +0000 (10:15 +0000)
    patch from Chris Chiappa (Closes: #459928).

abcde
changelog
debian/changelog

diff --git a/abcde b/abcde
index 6712c57..79afd6a 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -1662,7 +1662,7 @@ abcde.mkcue () {
 
        local MODE DISCID TRACKS
        local i OFFSET LBA 
-
+    local CUEWAVFILE
 
     if [ "$1" = --wholedisc ] ; then
         MODE=INDEX
@@ -1670,6 +1670,21 @@ abcde.mkcue () {
         MODE=PREGAP
     fi
 
+    vecho "One track is $ONETRACK"
+    TRACKFILE="$(mungefilename "$TRACKNAME")"
+    ARTISTFILE="$(mungefilename "$TRACKARTIST")"
+    ALBUMFILE="$(mungefilename "$DALBUM")"
+    if [ "$ONETRACK" = "y" ]; then
+        if [ "$VARIOUSARTISTS" = "y" ]; then
+            CUEWAVFILE="$(eval echo \""$VAONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT"
+        else
+            CUEWAVFILE="$(eval echo \""$ONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT"
+        fi
+        vecho "Cue wav file is $CUEWAVFILE"
+    else
+        CUEWAVFILE="dummy.wav"
+    fi
+
     set -- $TRACKINFO
 
     DISCID=$1
@@ -1677,7 +1692,7 @@ abcde.mkcue () {
     shift 2
 
     echo REM DISCID $DISCID
-    echo FILE \"dummy.wav\" WAVE
+    echo FILE \""$CUEWAVEFILE"\" WAVE
 
     if [ $1 -ne 150 ] && [ $MODE = "PREGAP" ] ; then
         OFFSET=$1
@@ -2011,6 +2026,25 @@ do_cleancue()
                                        eval track="\$TRACK$n"
                                        n=$(expr $n + 1)
                                        echo "    TITLE \"$track\"" >> "$CUEFILE_OUT"
+                               # When making a single-track rip, put the
+                               # actual file name into the file declaration
+                               # in the cue file so that it is usable by
+                               # music players and the like
+                               elif [ "$ONETRACK" = "y" ] &&
+                                               echo "$line" | grep '^FILE "dummy.wav" WAVE' > /dev/null 2>&1 ; then
+
+                                       TRACKFILE="$(mungefilename "$TRACKNAME")"
+                                       ARTISTFILE="$(mungefilename "$TRACKARTIST")"
+                                       ALBUMFILE="$(mungefilename "$DALBUM")"
+
+                                       if [ "$VARIOUSARTISTS" = "y" ]; then
+                                               OUTPUTFILE="$(eval echo \""$VAONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT"
+                                       else
+                                               OUTPUTFILE="$(eval echo \""$ONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT"
+                                       fi
+
+                                       echo "FILE \"$OUTPUTFILE\" WAVE" >> "$CUEFILE_OUT"
+                                       continue
                                fi
 # FIXME # If the lines above are uncommented, remove the line below.
                                echo "$line" >> "$CUEFILE_OUT"
index bdf7b01..279e192 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,6 +1,8 @@
 abcde 2.4.2
 
   * Bumped to 2.4.2
+  * Fix Cue file always references "dummy.wav" bug
+    patch from Chris Chiappa (Closes: #459928).
 
  -- Colin Tuckley <colint@debian.org>  Sat, 27 Feb 2010 11:21:37 +0000
 
index 946e6fd..d7070c3 100644 (file)
@@ -2,8 +2,10 @@ abcde (2.4.2-1) unstable; urgency=low
 
   * Bumped to 2.4.2
   * Update standards version to 3.8.4 (no changes required).
+  * Fix Cue file always references "dummy.wav" bug
+    patch from Chris Chiappa (Closes: #459928).
 
- -- Colin Tuckley <colint@debian.org>  Sat, 27 Feb 2010 11:21:37 +0000
+ -- Colin Tuckley <colint@debian.org>  Sat, 13 Mar 2010 10:10:43 +0000
 
 abcde (2.4.1-1) unstable; urgency=low