Revision: 1798
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1798&view=rev
Author:   jcsjcs
Date:     2007-11-17 08:12:06 -0800 (Sat, 17 Nov 2007)

Log Message:
-----------
  * src/display_spl.c:
    Renamed "Time" to "Track length" for better understanding.
    Fixed track length display (unit was seconds but msecs had to be
    entered. Furthermore, due to a bug in libgpod offline playlist
    generation assumed the track length was given in seconds whereas
    the live-update on the iPod assumed it was given in msecs. You
    need at least libgpod SVN version 1797 for this to work
    consistently. libgpod 0.6.0 does not contain the fix.

    src/display_photo.c:
    Squashed warning about pointer to integer conversion.

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog_detailed
    gtkpod/trunk/src/display_photo.c
    gtkpod/trunk/src/display_spl.c

Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed     2007-11-17 06:19:50 UTC (rev 1797)
+++ gtkpod/trunk/ChangeLog_detailed     2007-11-17 16:12:06 UTC (rev 1798)
@@ -1,3 +1,17 @@
+2007-11-17 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+  * src/display_spl.c:
+    Renamed "Time" to "Track length" for better understanding.
+    Fixed track length display (unit was seconds but msecs had to be
+    entered. Furthermore, due to a bug in libgpod offline playlist
+    generation assumed the track length was given in seconds whereas
+    the live-update on the iPod assumed it was given in msecs. You
+    need at least libgpod SVN version 1797 for this to work
+    consistently. libgpod 0.6.0 does not contain the fix.
+
+    src/display_photo.c:
+    Squashed warning about pointer to integer conversion.
+
 2007-11-14 P.G. Richardson <phantom_sf at users.sourceforge.net>
 
   * src/display_photos.c

Modified: gtkpod/trunk/src/display_photo.c
===================================================================
--- gtkpod/trunk/src/display_photo.c    2007-11-17 06:19:50 UTC (rev 1797)
+++ gtkpod/trunk/src/display_photo.c    2007-11-17 16:12:06 UTC (rev 1798)
@@ -1102,7 +1102,7 @@
        switch (e->button)
        {
                case 3:
-                       gphoto_context_menu_init ((gint) data);
+                       gphoto_context_menu_init (GPOINTER_TO_INT(data));
                        return TRUE;
                default:
                        break;

Modified: gtkpod/trunk/src/display_spl.c
===================================================================
--- gtkpod/trunk/src/display_spl.c      2007-11-17 06:19:50 UTC (rev 1797)
+++ gtkpod/trunk/src/display_spl.c      2007-11-17 16:12:06 UTC (rev 1798)
@@ -91,7 +91,7 @@
     { ITDB_SPLFIELD_DATE_MODIFIED,  N_("Date modified") },
     { ITDB_SPLFIELD_TRACKNUMBER,    N_("Track number") },
     { ITDB_SPLFIELD_SIZE,           N_("Size") },
-    { ITDB_SPLFIELD_TIME,           N_("Time") },
+    { ITDB_SPLFIELD_TIME,           N_("Play time") },
     { ITDB_SPLFIELD_COMMENT,        N_("Comment") },
     { ITDB_SPLFIELD_DATE_ADDED,     N_("Date added") },
     { ITDB_SPLFIELD_COMPOSER,       N_("Composer") },
@@ -635,10 +635,17 @@
     switch (type)
     {
     case spl_ET_FROMVALUE:
-       splr->fromvalue = atol (str);
-       if (splr->field == ITDB_SPLFIELD_RATING)
+       switch (splr->field)
        {
-           splr->fromvalue *= ITDB_RATING_STEP;
+       case ITDB_SPLFIELD_RATING:
+           splr->fromvalue = ITDB_RATING_STEP * atol (str);
+           break;
+       case ITDB_SPLFIELD_TIME:
+           splr->fromvalue = 1000 * strtod (str, NULL);
+           break;
+       default:
+           splr->fromvalue = atol (str);
+           break;
        }
        break;
     case spl_ET_FROMVALUE_DATE:
@@ -650,10 +657,17 @@
        splr->fromdate = atol (str);
        break;
     case spl_ET_TOVALUE:
-       splr->tovalue = atol (str);
-       if (splr->field == ITDB_SPLFIELD_RATING)
+       switch (splr->field)
        {
-           splr->tovalue *= ITDB_RATING_STEP;
+       case ITDB_SPLFIELD_RATING:
+           splr->tovalue = ITDB_RATING_STEP * atol (str);
+           break;
+       case ITDB_SPLFIELD_TIME:
+           splr->tovalue = 1000 * strtod (str, NULL);
+           break;
+       default:
+           splr->tovalue = atol (str);
+           break;
        }
        break;
     case spl_ET_TOVALUE_DATE:
@@ -1004,22 +1018,27 @@
                               enum entrytype et)
 {
     gchar *strp = str;
-    gint stepsize = 1; /* for FROMVALUE/TOVALUE (20 for rating) */
 
     g_return_val_if_fail (str, NULL);
     g_return_val_if_fail (splr, NULL);
 
-    if (splr->field == ITDB_SPLFIELD_RATING)
-    {
-       stepsize = ITDB_RATING_STEP;
-    }
-
     switch (et)
     {
     case spl_ET_FROMVALUE:
        if (splr->fromvalue == ITDB_SPL_DATE_IDENTIFIER)
            splr->fromvalue = 0;
-       snprintf (str, WNLEN, "%lld", (long long int)(splr->fromvalue / 
stepsize));
+       switch (splr->field)
+       {
+       case ITDB_SPLFIELD_RATING:
+           snprintf (str, WNLEN, "%lld", (long long int)(splr->fromvalue / 
ITDB_RATING_STEP));
+           break;
+       case ITDB_SPLFIELD_TIME:
+           snprintf (str, WNLEN, "%.10g", ((gdouble)splr->fromvalue/1000));
+           break;
+       default:
+           snprintf (str, WNLEN, "%lld", (long long int)(splr->fromvalue));
+           break;
+       }
        break;
     case spl_ET_FROMVALUE_DATE:
        if (splr->fromvalue == ITDB_SPL_DATE_IDENTIFIER)
@@ -1032,7 +1051,18 @@
     case spl_ET_TOVALUE:
        if (splr->tovalue == ITDB_SPL_DATE_IDENTIFIER)
            splr->tovalue = 0;
-       snprintf (str, WNLEN, "%lld",  (long long int)(splr->tovalue / 
stepsize));
+       switch (splr->field )
+       {
+       case ITDB_SPLFIELD_RATING:
+           snprintf (str, WNLEN, "%lld",  (long long int)(splr->tovalue / 
ITDB_RATING_STEP));
+           break;
+       case ITDB_SPLFIELD_TIME:
+           snprintf (str, WNLEN, "%.10g", ((gdouble)splr->tovalue/1000));
+           break;
+       default:
+           snprintf (str, WNLEN, "%lld", (long long int)(splr->tovalue));
+           break;
+       }
        break;
     case spl_ET_TOVALUE_DATE:
        if (splr->tovalue == ITDB_SPL_DATE_IDENTIFIER)


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to