Revision: 1964
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1964&view=rev
Author:   jcsjcs
Date:     2008-04-19 02:26:28 -0700 (Sat, 19 Apr 2008)

Log Message:
-----------
        * src/flacfile.c (flac_get_file_info): patch by Peter Pletcher
          supporting the DATE field (alternative source for YEAR),
          extended track and disc numbers ("n/m" format), as well as
          correction of an obvious type (CNDR -> CDNR). Thanks!

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog
    gtkpod/trunk/src/flacfile.c

Modified: gtkpod/trunk/ChangeLog
===================================================================
--- gtkpod/trunk/ChangeLog      2008-04-19 09:13:33 UTC (rev 1963)
+++ gtkpod/trunk/ChangeLog      2008-04-19 09:26:28 UTC (rev 1964)
@@ -10,6 +10,11 @@
           instead of being grouped on the right together with the
           "Close" button).
 
+       * src/flacfile.c (flac_get_file_info): patch by Peter Pletcher
+          supporting the DATE field (alternative source for YEAR),
+          extended track and disc numbers ("n/m" format), as well as
+          correction of an obvious type (CNDR -> CDNR). Thanks!
+
 2008-04-18 Jorg Schuler <jcsjcs at users.sourceforge.net>
 
        * src/fileselection.c: add multiple directories patch by Alex

Modified: gtkpod/trunk/src/flacfile.c
===================================================================
--- gtkpod/trunk/src/flacfile.c 2008-04-19 09:13:33 UTC (rev 1963)
+++ gtkpod/trunk/src/flacfile.c 2008-04-19 09:26:28 UTC (rev 1964)
@@ -107,9 +107,37 @@
                     if (g_ascii_strncasecmp("YEAR=", tag, 5) == 0) {
                         track->year = atoi (tag + 5);
                     }
+                    if (g_ascii_strncasecmp("DATE=", tag, 5) == 0) {
+                       /* The date field is supposed to be of the
+                          format YYYY-MM-DD */
+                        track->year = atoi (tag + 5);
+                    }
+                    /* track_nr/tracks tag handling */
                     if (g_ascii_strncasecmp("TRACKNUMBER=", tag, 12) == 0) {
-                        track->track_nr = atoi (tag + 12);
+                        gchar* string;
+                        gchar* string2;
+                        string = tag + 12;
+                       string2 = strchr(string,'/');
+                       if (string2)
+                       {
+                           track->tracks = atoi (string2 + 1);
+                           *string2 = '\0';
+                       }
+                       track->track_nr = atoi (string);
                     }
+                    /* cd_nr/cds tag handling */
+                    if (g_ascii_strncasecmp("DISCNUMBER=", tag, 11) == 0) {
+                        gchar* string;
+                        gchar* string2;
+                        string = tag + 11;
+                       string2 = strchr(string,'/');
+                       if (string2)
+                       {
+                           track->cds = atoi (string2 + 1);
+                           *string2 = '\0';
+                       }
+                       track->cd_nr = atoi (string);
+                    }
                     if (g_ascii_strncasecmp("COMPOSER=", tag, 9) == 0) {
                         track->composer = charset_to_utf8 (tag + 9);
                     }
@@ -119,7 +147,7 @@
                     if (g_ascii_strncasecmp("TRACKS=", tag, 7) == 0) {
                         track->tracks = atoi (tag  + 7);
                     }
-                    if (g_ascii_strncasecmp("CNDR=", tag, 5) == 0) {
+                    if (g_ascii_strncasecmp("CDNR=", tag, 5) == 0) {
                         track->cd_nr = atoi (tag + 5);
                     }
                     if (g_ascii_strncasecmp("CDS=", tag, 4) == 0) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to