Re: [Easytag-mailing] ET 1.99.11 problems with FLAC + patch



Hi Mihai
Mihai Badila wrote:
 Been using ET 1.99.11 with enthusiasm with my .flacs. But it has 2 major
bugs.

 1. "Remove tags" erases also the replaygain tags along with TITLE, ARTIST,
etc. tags.

Short answer: Not a bug. It does exactly what it says unfortunately. ;)

Long answer:
If you noticed that it doesn't strip replay-gain tags from mp3s, I would guess the reason is that the most common way to add replay gain to
mp3 is with an (entirely separate) APE2 tag. Easytag doesn't currently
appear to support these, so it leaves them untouched.

 2. The COMMENT var. actually writes "DESCRIPTION=" in the .flac file. and
doesn't recognize the "COMMENT=" writen in the .flac with the Winamp FLAC
plugin 1.1.2.

Short answer: Not a bug.

Long answer:
As I see it, there are two reasons why Easytag writes DESCRIPTION instead of COMMENT:
  1. COMMENT isn't on the basic recommended fields list
  (http://www.xiph.org/vorbis/doc/v-comment.html)
  2. XMMS (the unix WinAmp) flac-plugin reads DESCRIPTION tags

[ Jérôme? That sound about right? ]

That aside, Easytag could easily include an option to write COMMENT instead of DESCRIPTION.

If you're able to compile from source I could certainly send you a patch to add a preferences option for it. I can't (conveniently) test or build Windows code. I wouldn't expect it to become a permanent part of Easytag though since it'd be adding Yet-Another-Option.

In fact, patch attached...

ciao
  Mark

--
Just some guy.


diff -urN easytag-1.99.11.orig/src/flac_tag.c easytag-1.99.11/src/flac_tag.c
--- easytag-1.99.11.orig/src/flac_tag.c	2005-12-08 23:01:14.000000000 +0000
+++ easytag-1.99.11/src/flac_tag.c	2006-01-08 00:03:03.000000000 +0000
@@ -389,7 +389,9 @@
      * Comment *
      ***********/
     field_num = 0;
-    while ( (field_num = FLAC__metadata_object_vorbiscomment_find_entry_from(vc_block,field_num,"DESCRIPTION")) >= 0 )
+    gchar *comment_or_description =  (FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT) ? "COMMENT" : "DESCRIPTION" ;
+
+    while ( (field_num = FLAC__metadata_object_vorbiscomment_find_entry_from(vc_block,field_num,comment_or_description)) >= 0 )
     {
         /* Extract field value */
         field = &vc->comments[field_num++];
@@ -559,6 +561,7 @@
      ***************************/
     for (i=0;i<(guint)vc->num_comments;i++)
     {
+        gchar *comment_or_description =  (FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT) ? "COMMENT=" : "DESCRIPTION=" ;
         field = &vc->comments[i];
         if ( strncasecmp((gchar *)field->entry,"TITLE=",       MIN(6,  field->length)) != 0
           && strncasecmp((gchar *)field->entry,"ARTIST=",      MIN(7,  field->length)) != 0
@@ -568,7 +571,7 @@
           && strncasecmp((gchar *)field->entry,"TRACKNUMBER=", MIN(12, field->length)) != 0
           && strncasecmp((gchar *)field->entry,"TRACKTOTAL=",  MIN(11, field->length)) != 0
           && strncasecmp((gchar *)field->entry,"GENRE=",       MIN(6,  field->length)) != 0
-          && strncasecmp((gchar *)field->entry,"DESCRIPTION=", MIN(12, field->length)) != 0
+          && strncasecmp((gchar *)field->entry,comment_or_description, MIN(strlen(comment_or_description), field->length)) != 0
           && strncasecmp((gchar *)field->entry,"COMPOSER=",    MIN(6,  field->length)) != 0
           && strncasecmp((gchar *)field->entry,"PERFORMER=",   MIN(6,  field->length)) != 0
           && strncasecmp((gchar *)field->entry,"COPYRIGHT=",   MIN(6,  field->length)) != 0
@@ -826,7 +829,14 @@
     // We write the comment using the "both" format
     if ( FileTag->comment )
     {
-        string = g_strconcat("DESCRIPTION=",FileTag->comment,NULL);
+        if (FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT)
+        {
+            string = g_strconcat("COMMENT=",FileTag->comment,NULL);
+        }
+        else
+        {
+            string = g_strconcat("DESCRIPTION=",FileTag->comment,NULL);
+        }
         field.entry = (FLAC__byte *)string;
         field.length = strlen(string);
         FLAC__metadata_object_vorbiscomment_insert_comment(vc_block,vc_block->data.vorbis_comment.num_comments,field,true);
diff -urN easytag-1.99.11.orig/src/prefs.c easytag-1.99.11/src/prefs.c
--- easytag-1.99.11.orig/src/prefs.c	2005-12-08 23:05:26.000000000 +0000
+++ easytag-1.99.11/src/prefs.c	2006-01-08 00:22:47.000000000 +0000
@@ -586,6 +586,12 @@
         "with 'comment=', whereas XMMS uses only `='. Please, uncheck this option if you don't want "
         "other apps to complain about an unknown field. Comments won't be shown in XMMS, though."),NULL);
 
+    FLACTagWriteDescriptionAsComment = gtk_check_button_new_with_label(_("FLAC Files : Write WinAmp-readable FLAC comments"));
+    gtk_box_pack_start(GTK_BOX(vbox),FLACTagWriteDescriptionAsComment ,FALSE,FALSE,0);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FLACTagWriteDescriptionAsComment),FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT);
+    gtk_tooltips_set_tip(Tips, FLACTagWriteDescriptionAsComment ,_("By default the comment field is written to a FLAC file as a 'DESCRIPTION=' tag. "
+                                                       "Select this to write a 'COMMENT=' tag instead."),NULL);
+    
     // Separator line
     Separator = gtk_hseparator_new();
     gtk_box_pack_start(GTK_BOX(vbox),Separator,FALSE,FALSE,0);
diff -urN easytag-1.99.11.orig/src/prefs.h easytag-1.99.11/src/prefs.h
--- easytag-1.99.11.orig/src/prefs.h	2005-11-29 22:37:14.000000000 +0000
+++ easytag-1.99.11/src/prefs.h	2006-01-07 14:53:29.000000000 +0000
@@ -97,6 +97,7 @@
 GtkWidget *NumberTrackFormated;
 GtkWidget *NumberTrackFormatedSpinButton;
 GtkWidget *OggTagWriteXmmsComment;
+GtkWidget *FLACTagWriteDescriptionAsComment; 
 GtkWidget *SetFocusToSameTagField;
 GtkWidget *SetFocusToFirstTagField;
 
diff -urN easytag-1.99.11.orig/src/setting.c easytag-1.99.11/src/setting.c
--- easytag-1.99.11.orig/src/setting.c	2005-12-07 22:42:02.000000000 +0000
+++ easytag-1.99.11/src/setting.c	2006-01-08 00:21:31.000000000 +0000
@@ -130,6 +130,7 @@
     {"number_track_formated",                CV_TYPE_BOOL,    &NUMBER_TRACK_FORMATED                    },
     {"number_track_formated_spin_button",    CV_TYPE_INT,     &NUMBER_TRACK_FORMATED_SPIN_BUTTON        },
     {"ogg_tag_write_xmms_comment",           CV_TYPE_BOOL,    &OGG_TAG_WRITE_XMMS_COMMENT               },
+    {"flac_tag_write_description_as_comment",CV_TYPE_BOOL,    &FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT    },
     {"set_focus_to_same_tag_field",          CV_TYPE_BOOL,    &SET_FOCUS_TO_SAME_TAG_FIELD              },
     {"set_focus_to_first_tag_field",         CV_TYPE_BOOL,    &SET_FOCUS_TO_FIRST_TAG_FIELD             },
     {"sorting_file_mode",                    CV_TYPE_INT,     &SORTING_FILE_MODE                        },
@@ -342,6 +343,7 @@
     NUMBER_TRACK_FORMATED                   = 1;
     NUMBER_TRACK_FORMATED_SPIN_BUTTON       = 2;
     OGG_TAG_WRITE_XMMS_COMMENT              = 1;
+    FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT   = 0;
     SET_FOCUS_TO_SAME_TAG_FIELD             = 1;
     SET_FOCUS_TO_FIRST_TAG_FIELD            = 0;
     SORTING_FILE_MODE                       = SORTING_BY_ASCENDING_FILENAME;
@@ -592,6 +594,7 @@
         NUMBER_TRACK_FORMATED                  = GTK_TOGGLE_BUTTON(NumberTrackFormated)->active;
         NUMBER_TRACK_FORMATED_SPIN_BUTTON      = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(NumberTrackFormatedSpinButton));
         OGG_TAG_WRITE_XMMS_COMMENT             = GTK_TOGGLE_BUTTON(OggTagWriteXmmsComment)->active;
+        FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT  = GTK_TOGGLE_BUTTON(FLACTagWriteDescriptionAsComment)->active;
         SORTING_FILE_CASE_SENSITIVE            = GTK_TOGGLE_BUTTON(SortingFileCaseSensitive)->active;
         SET_FOCUS_TO_SAME_TAG_FIELD            = GTK_TOGGLE_BUTTON(SetFocusToSameTagField)->active;
         SET_FOCUS_TO_FIRST_TAG_FIELD           = GTK_TOGGLE_BUTTON(SetFocusToFirstTagField)->active;
diff -urN easytag-1.99.11.orig/src/setting.h easytag-1.99.11/src/setting.h
--- easytag-1.99.11.orig/src/setting.h	2005-11-29 22:16:53.000000000 +0000
+++ easytag-1.99.11/src/setting.h	2006-01-07 14:49:49.000000000 +0000
@@ -114,6 +114,7 @@
 gint    NUMBER_TRACK_FORMATED;
 gint    NUMBER_TRACK_FORMATED_SPIN_BUTTON;
 gint    OGG_TAG_WRITE_XMMS_COMMENT;
+gint    FLAC_TAG_WRITE_DESCRIPTION_AS_COMMENT;
 gint    SET_FOCUS_TO_SAME_TAG_FIELD;
 gint    SET_FOCUS_TO_FIRST_TAG_FIELD;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]