Revision: 2012
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2012&view=rev
Author:   teuf
Date:     2008-06-09 13:02:06 -0700 (Mon, 09 Jun 2008)

Log Message:
-----------
* src/db-artwork-writer.c:
* src/itdb_device.c:
* src/itdb_device.h:
* src/itdb_sysinfo_extended_parser.c:
* src/itdb_sysinfo_extended_parser.h: implements
itdb_device_supports_sparse_artwork (instead of the old stub always
returning TRUE). Use data from SysInfoExtended if it's available,
use hardcoded table from libgpod if not.

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/src/db-artwork-writer.c
    libgpod/trunk/src/itdb_device.c
    libgpod/trunk/src/itdb_device.h
    libgpod/trunk/src/itdb_sysinfo_extended_parser.c
    libgpod/trunk/src/itdb_sysinfo_extended_parser.h

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2008-06-09 19:59:31 UTC (rev 2011)
+++ libgpod/trunk/ChangeLog     2008-06-09 20:02:06 UTC (rev 2012)
@@ -1,13 +1,24 @@
-2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
+2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
 
+       * src/db-artwork-writer.c:
        * src/itdb_device.c:
        * src/itdb_device.h:
        * src/itdb_sysinfo_extended_parser.c:
+       * src/itdb_sysinfo_extended_parser.h: implements
+       itdb_device_supports_sparse_artwork (instead of the old stub always
+       returning TRUE). Use data from SysInfoExtended if it's available,
+       use hardcoded table from libgpod if not.
+
+2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
+
+       * src/itdb_device.c:
+       * src/itdb_device.h:
+       * src/itdb_sysinfo_extended_parser.c:
        * src/itdb_sysinfo_extended_parser.h: merge Itdb_ArtworkFormat and
        SysInfoImageFormat, use artwork formats from SysInfoExtended when
        it's available instead of using the hardcoded tables from libgpod
 
-2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
+2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
 
        * src/db-artwork-writer.c:
        * src/db-image-parser.h:
@@ -18,7 +29,7 @@
        pointers to the appropriate Itdb_ArtworkFormat for the thumbnail
        type when it's needed
 
-2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
+2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
 
        * src/db-artwork-parser.c: remove duplicated artwork/photo support
        testing functions
@@ -39,12 +50,12 @@
        * src/db-artwork-writer.c: ditto
        * src/ithumb-writer.c: ditto
 
-2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
+2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
 
        * src/gchecksum.c: fix compilation (it's only compiled on system with
        older glib versions)
 
-2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
+2008-06-09  Christophe Fergeau  <[EMAIL PROTECTED]>
 
        * src/db-artwork-writer.c:
        * src/itdb_artwork.c:

Modified: libgpod/trunk/src/db-artwork-writer.c
===================================================================
--- libgpod/trunk/src/db-artwork-writer.c       2008-06-09 19:59:31 UTC (rev 
2011)
+++ libgpod/trunk/src/db-artwork-writer.c       2008-06-09 20:02:06 UTC (rev 
2012)
@@ -910,14 +910,6 @@
        return total_bytes;
 }
 
-
-static gboolean
-ipod_supports_sparse_artwork (Itdb_Device *device)
-{
-    return TRUE;
-}
-
-
 /* renumber the artwork IDs for all tracks containing artwork and with
    an ID of != 0 */
 /* if the iPod does not support sparse artwork, renumber consecutively
@@ -932,7 +924,7 @@
 
     cur_id = min_id;
 
-    if (ipod_supports_sparse_artwork (db->device))
+    if (itdb_device_supports_sparse_artwork (db->device))
     {
        GHashTable *id_hash;
 
@@ -1129,7 +1121,7 @@
      * high */
     max_id = ipod_artwork_db_set_ids (itdb);
 
-    if (ipod_supports_sparse_artwork (itdb->device))
+    if (itdb_device_supports_sparse_artwork (itdb->device))
     {
        /* go through all newly added artwork and pass out new IDs. the
           same ID will be assigned to identical artwork within one album */

Modified: libgpod/trunk/src/itdb_device.c
===================================================================
--- libgpod/trunk/src/itdb_device.c     2008-06-09 19:59:31 UTC (rev 2011)
+++ libgpod/trunk/src/itdb_device.c     2008-06-09 20:02:06 UTC (rev 2012)
@@ -823,6 +823,50 @@
     g_return_val_if_reached (NULL);
 }
 
+G_GNUC_INTERNAL gboolean 
+itdb_device_supports_sparse_artwork (const Itdb_Device *device)
+{
+    gboolean supports_sparse_artwork = FALSE;
+
+    g_return_val_if_fail (device != NULL, FALSE);
+
+    if (device->sysinfo_extended != NULL) {
+        supports_sparse_artwork = 
itdb_sysinfo_properties_supports_sparse_artwork (device->sysinfo_extended);
+    }
+
+    if (supports_sparse_artwork == FALSE) {
+        const Itdb_IpodInfo *info;
+        info = itdb_device_get_ipod_info (device);
+        switch (info->ipod_generation) {
+            case ITDB_IPOD_GENERATION_UNKNOWN:
+            case ITDB_IPOD_GENERATION_FIRST:
+            case ITDB_IPOD_GENERATION_SECOND:
+            case ITDB_IPOD_GENERATION_THIRD:
+            case ITDB_IPOD_GENERATION_FOURTH:
+            case ITDB_IPOD_GENERATION_PHOTO:
+            case ITDB_IPOD_GENERATION_MOBILE:
+            case ITDB_IPOD_GENERATION_MINI_1:
+            case ITDB_IPOD_GENERATION_MINI_2:
+            case ITDB_IPOD_GENERATION_SHUFFLE_1:
+            case ITDB_IPOD_GENERATION_SHUFFLE_2:
+            case ITDB_IPOD_GENERATION_SHUFFLE_3:
+                supports_sparse_artwork = FALSE;
+                break;
+            case ITDB_IPOD_GENERATION_NANO_1:
+            case ITDB_IPOD_GENERATION_NANO_2:
+            case ITDB_IPOD_GENERATION_NANO_3:
+            case ITDB_IPOD_GENERATION_VIDEO_1:
+            case ITDB_IPOD_GENERATION_VIDEO_2:
+            case ITDB_IPOD_GENERATION_CLASSIC_1:
+            case ITDB_IPOD_GENERATION_TOUCH_1:
+            case ITDB_IPOD_GENERATION_IPHONE_1:
+                supports_sparse_artwork = TRUE;
+                break;
+        }
+    }
+    return supports_sparse_artwork;
+}
+
 /* Determine the number of F.. directories in iPod_Control/Music.*/
 G_GNUC_INTERNAL gint
 itdb_musicdirs_number_by_mountpoint (const gchar *mountpoint)

Modified: libgpod/trunk/src/itdb_device.h
===================================================================
--- libgpod/trunk/src/itdb_device.h     2008-06-09 19:59:31 UTC (rev 2011)
+++ libgpod/trunk/src/itdb_device.h     2008-06-09 20:02:06 UTC (rev 2012)
@@ -118,7 +118,7 @@
 G_GNUC_INTERNAL gint itdb_device_musicdirs_number (Itdb_Device *device);
 G_GNUC_INTERNAL void itdb_device_autodetect_endianess (Itdb_Device *device);
 G_GNUC_INTERNAL guint64 itdb_device_get_firewire_id (const Itdb_Device 
*device);
-
+G_GNUC_INTERNAL gboolean itdb_device_supports_sparse_artwork (const 
Itdb_Device *device);
 G_END_DECLS
 
 #endif

Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.c
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.c    2008-06-09 19:59:31 UTC 
(rev 2011)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.c    2008-06-09 20:02:06 UTC 
(rev 2012)
@@ -546,3 +546,11 @@
     g_return_val_if_fail (props != NULL, NULL);
     return props->chapter_image_formats;
 }
+
+G_GNUC_INTERNAL gboolean
+itdb_sysinfo_properties_supports_sparse_artwork (const SysInfoIpodProperties 
*props)
+{
+    g_return_val_if_fail (props != NULL, NULL);
+
+    return props->supports_sparse_artwork;
+}

Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.h
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.h    2008-06-09 19:59:31 UTC 
(rev 2011)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.h    2008-06-09 20:02:06 UTC 
(rev 2012)
@@ -50,6 +50,8 @@
 itdb_sysinfo_properties_get_photo_formats (const SysInfoIpodProperties *);
 G_GNUC_INTERNAL const GList *
 itdb_sysinfo_properties_get_chapter_image_formats (const SysInfoIpodProperties 
*);
+G_GNUC_INTERNAL gboolean
+itdb_sysinfo_properties_supports_sparse_artwork (const SysInfoIpodProperties 
*);
 
 G_END_DECLS
 


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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to