summaryrefslogtreecommitdiffstats
path: root/src/itdb_device.c
diff options
context:
space:
mode:
authorChristophe Fergeau <teuf@gnome.org>2007-04-14 11:16:29 +0000
committerChristophe Fergeau <teuf@gnome.org>2007-04-14 11:16:29 +0000
commit44fc5965bbfe238b84f05bda9fe8aa6a6f63f602 (patch)
tree088c57e37d1ce81758042d46063a40b908e6171b /src/itdb_device.c
parent48f7eb040eefe19059d267c897bf04ee894a8adf (diff)
downloadlibgpod-44fc5965bbfe238b84f05bda9fe8aa6a6f63f602.tar.gz
libgpod-44fc5965bbfe238b84f05bda9fe8aa6a6f63f602.tar.xz
libgpod-44fc5965bbfe238b84f05bda9fe8aa6a6f63f602.zip
2007-04-14 Christophe Fergeau <teuf@gnome.org>
* src/itdb_device.c: add itdb_device_supports_artwork and idb_device_supports_photo functions * docs/reference/tmpl/device.sgml: update api doc * src/itdb_itunesdb.c: don't try to write artwork database if the iPod model doesn't support artwork. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1414 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/itdb_device.c')
-rw-r--r--src/itdb_device.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/itdb_device.c b/src/itdb_device.c
index a66a2bc..35836fb 100644
--- a/src/itdb_device.c
+++ b/src/itdb_device.c
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-11-12 23:07:06 jcs>
+/* Time-stamp: <27-mar-2007 10:09:48 teuf>
|
| Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
| Part of the gtkpod project.
@@ -781,3 +781,56 @@ const gchar *itdb_info_get_ipod_generation_string (Itdb_IpodGeneration generatio
}
return NULL;
}
+
+
+/**
+ * itdb_device_supports_artwork:
+ * @device: an #Itdb_Device
+ *
+ * Indicates whether @device can display artwork or not. When dealing
+ * with a non-art capable ipod, no artwork data will be written to the
+ * iPod so you can spare calls to the artwork handling methods.
+ *
+ * Return value: true if @device can display artwork.
+ */
+
+gboolean itdb_device_supports_artwork (Itdb_Device *device)
+{
+ if (device == NULL) {
+ return FALSE;
+ }
+
+ return (itdb_device_get_artwork_formats (device) != NULL);
+}
+
+
+/**
+ * itdb_device_supports_photo:
+ * @device: an #Itdb_Device
+ *
+ * Indicates whether @device can display photos or not.
+ *
+ * Return value: true if @device can display photos.
+ */
+
+gboolean itdb_device_supports_photo (Itdb_Device *device)
+{
+ const Itdb_ArtworkFormat *formats;
+ const Itdb_ArtworkFormat *it;
+
+ if (device == NULL) {
+ return FALSE;
+ }
+
+ formats = itdb_device_get_artwork_formats (device);
+ if (formats == NULL) {
+ return FALSE;
+ }
+
+ it = formats;
+ while ((it->type != -1) && (it->type != ITDB_THUMB_PHOTO_FULL_SCREEN)) {
+ it++;
+ }
+
+ return (it->type != -1);
+}