summaryrefslogtreecommitdiffstats
path: root/src/itdb_device.c
diff options
context:
space:
mode:
authorChristophe Fergeau <teuf@gnome.org>2008-06-09 20:02:06 +0000
committerChristophe Fergeau <teuf@gnome.org>2008-06-09 20:02:06 +0000
commit0705fe9f1958b17ca54483eecb0976ceb5e4d18f (patch)
tree486b6d53379f17686e54ff3f2b06850ca5d8e1d8 /src/itdb_device.c
parente7dc7876a7d4dc87290064e9c5bec7aaec60a82d (diff)
downloadlibgpod-0705fe9f1958b17ca54483eecb0976ceb5e4d18f.tar.gz
libgpod-0705fe9f1958b17ca54483eecb0976ceb5e4d18f.tar.xz
libgpod-0705fe9f1958b17ca54483eecb0976ceb5e4d18f.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
Diffstat (limited to 'src/itdb_device.c')
-rw-r--r--src/itdb_device.c44
1 files changed, 44 insertions, 0 deletions
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)