summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-06-09 20:02:06 +0000
committerteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2008-06-09 20:02:06 +0000
commit4ccb2914d8d24821266bc19dd77b9f5d4637d774 (patch)
tree486b6d53379f17686e54ff3f2b06850ca5d8e1d8
parent447dea0d8e1c0b0990b70ec8eff0597718c1aaf3 (diff)
downloadlibgpod-4ccb2914d8d24821266bc19dd77b9f5d4637d774.tar.gz
libgpod-4ccb2914d8d24821266bc19dd77b9f5d4637d774.tar.xz
libgpod-4ccb2914d8d24821266bc19dd77b9f5d4637d774.zip
* 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. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2012 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--ChangeLog21
-rw-r--r--src/db-artwork-writer.c12
-rw-r--r--src/itdb_device.c44
-rw-r--r--src/itdb_device.h2
-rw-r--r--src/itdb_sysinfo_extended_parser.c8
-rw-r--r--src/itdb_sysinfo_extended_parser.h2
6 files changed, 73 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 17e9d80..e961fcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,15 @@
-2008-06-09 Christophe Fergeau <christophe@anevia.com>
+2008-06-09 Christophe Fergeau <teuf@gnome.org>
+
+ * 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 <teuf@gnome.org>
* src/itdb_device.c:
* src/itdb_device.h:
@@ -7,7 +18,7 @@
SysInfoImageFormat, use artwork formats from SysInfoExtended when
it's available instead of using the hardcoded tables from libgpod
-2008-06-09 Christophe Fergeau <christophe@anevia.com>
+2008-06-09 Christophe Fergeau <teuf@gnome.org>
* 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 <christophe@anevia.com>
+2008-06-09 Christophe Fergeau <teuf@gnome.org>
* 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 <christophe@anevia.com>
+2008-06-09 Christophe Fergeau <teuf@gnome.org>
* src/gchecksum.c: fix compilation (it's only compiled on system with
older glib versions)
-2008-06-09 Christophe Fergeau <christophe@anevia.com>
+2008-06-09 Christophe Fergeau <teuf@gnome.org>
* src/db-artwork-writer.c:
* src/itdb_artwork.c:
diff --git a/src/db-artwork-writer.c b/src/db-artwork-writer.c
index 1d868fa..06252b9 100644
--- a/src/db-artwork-writer.c
+++ b/src/db-artwork-writer.c
@@ -910,14 +910,6 @@ write_mhfd (Itdb_DB *db, iPodBuffer *buffer, int id_max)
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 @@ ipod_artwork_db_set_ids (Itdb_iTunesDB *db)
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 @@ static guint32 itdb_prepare_thumbnails (Itdb_iTunesDB *itdb)
* 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 */
diff --git a/src/itdb_device.c b/src/itdb_device.c
index f31795c..f096450 100644
--- a/src/itdb_device.c
+++ b/src/itdb_device.c
@@ -823,6 +823,50 @@ GList *itdb_device_get_cover_art_formats (const Itdb_Device *device)
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)
diff --git a/src/itdb_device.h b/src/itdb_device.h
index 4152f28..8e43366 100644
--- a/src/itdb_device.h
+++ b/src/itdb_device.h
@@ -118,7 +118,7 @@ G_GNUC_INTERNAL GList *itdb_device_get_cover_art_formats (const Itdb_Device *dev
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
diff --git a/src/itdb_sysinfo_extended_parser.c b/src/itdb_sysinfo_extended_parser.c
index 2102502..b0e2fa5 100644
--- a/src/itdb_sysinfo_extended_parser.c
+++ b/src/itdb_sysinfo_extended_parser.c
@@ -546,3 +546,11 @@ itdb_sysinfo_properties_get_chapter_image_formats (const SysInfoIpodProperties *
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;
+}
diff --git a/src/itdb_sysinfo_extended_parser.h b/src/itdb_sysinfo_extended_parser.h
index ff3214c..221e0e8 100644
--- a/src/itdb_sysinfo_extended_parser.h
+++ b/src/itdb_sysinfo_extended_parser.h
@@ -50,6 +50,8 @@ G_GNUC_INTERNAL const GList *
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