Update of /cvsroot/gtkpod/gtkpod/scripts
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8690/scripts

Modified Files:
        convert-wav2mp3.sh 
Log Message:
        * scripts/convert-wav2mp3.sh: added genre-patch for
          genre types not supported by lame.



Index: convert-wav2mp3.sh
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/scripts/convert-wav2mp3.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- convert-wav2mp3.sh  23 Apr 2007 15:33:31 -0000      1.3
+++ convert-wav2mp3.sh  5 May 2007 04:49:24 -0000       1.4
@@ -79,13 +79,31 @@
     exit 5
 fi
 
+# Check if the genre is one which lame supports
+if [ -n "$genre" ] && `$lame --genre-list | grep -qi "\b$genre\b"`; then
+    genreopt="--tg \"$genre\""
+else
+    # check for id3v2
+    id3v2=`which id3v2`
+    if [ -n "$id3v2" ]; then
+        useid3v2=1
+    fi
+fi
+
 # Launch command
-"$lame" --preset standard --add-id3v2 --tt "$title" --ta "$artist" --tl 
"$album" --ty "$year" --tc "$comment" --tn "$tracknum" --tg "$genre" "$infile" 
"$outfile"
+"$lame" --preset standard --add-id3v2 --tt "$title" --ta "$artist" --tl 
"$album" --ty "$year" --tc "$comment" --tn "$tracknum" $genreopt "$infile" 
"$outfile"
 
 # Check result
 if [ "x$?" != "x0" ]; then
     exit 6
 fi
+
+# Try to set the genre with id3v2 if needed.  This may fail as older versions 
of
+# id3v2 did not support genre strings in place of numeric genre id's
+if [ -n "$useid3v2" ]; then
+    $id3v2 -g "$genre" "$outfile" || :
+fi
+
 # Seems to be ok: display filename for gtkpod
 echo $outfile
 exit 0


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to