Revision: 2272
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2272&view=rev
Author: teuf
Date: 2009-03-14 18:02:16 +0000 (Sat, 14 Mar 2009)
Log Message:
-----------
Add function to test if the ipod supports chapter images
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/itdb.h
libgpod/trunk/src/itdb_device.c
libgpod/trunk/src/itdb_device.h
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2009-03-14 17:59:36 UTC (rev 2271)
+++ libgpod/trunk/ChangeLog 2009-03-14 18:02:16 UTC (rev 2272)
@@ -1,5 +1,12 @@
2009-03-14 Christophe Fergeau <[email protected]>
+ * src/itdb.h
+ * src/itdb_device.c
+ * src/itdb_device.h: add itdb_device_supports_chapter_image method
+ to test if an iPod support chapter images or not.
+
+2009-03-14 Christophe Fergeau <[email protected]>
+
* src/itdb_device.c: factorize some code in legacy artwork
handling
Modified: libgpod/trunk/src/itdb.h
===================================================================
--- libgpod/trunk/src/itdb.h 2009-03-14 17:59:36 UTC (rev 2271)
+++ libgpod/trunk/src/itdb.h 2009-03-14 18:02:16 UTC (rev 2272)
@@ -1748,6 +1748,7 @@
const Itdb_IpodInfo *itdb_device_get_ipod_info (const Itdb_Device *device);
const Itdb_IpodInfo *itdb_info_get_ipod_info_table (void);
gboolean itdb_device_supports_artwork (const Itdb_Device *device);
+gboolean itdb_device_supports_chapter_image (const Itdb_Device *device);
gboolean itdb_device_supports_video (const Itdb_Device *device);
gboolean itdb_device_supports_photo (const Itdb_Device *device);
gboolean itdb_device_supports_podcast (const Itdb_Device *device);
Modified: libgpod/trunk/src/itdb_device.c
===================================================================
--- libgpod/trunk/src/itdb_device.c 2009-03-14 17:59:36 UTC (rev 2271)
+++ libgpod/trunk/src/itdb_device.c 2009-03-14 18:02:16 UTC (rev 2272)
@@ -1113,6 +1113,19 @@
g_return_val_if_reached (NULL);
}
+GList *itdb_device_get_chapter_image_formats (const Itdb_Device *device)
+{
+ g_return_val_if_fail (device != NULL, NULL);
+
+ if (device->sysinfo_extended == NULL) {
+ return itdb_device_get_artwork_formats_fallback (device,
+
ARTWORK_TYPE_CHAPTER_IMAGE);
+ } else {
+ return g_list_copy ((GList
*)itdb_sysinfo_properties_get_chapter_image_formats (device->sysinfo_extended));
+ }
+ g_return_val_if_reached (NULL);
+}
+
G_GNUC_INTERNAL gboolean
itdb_device_supports_sparse_artwork (const Itdb_Device *device)
{
@@ -1479,6 +1492,27 @@
return (formats != NULL);
}
+/**
+ * itdb_device_supports_chapter_images:
+ * @device: an #Itdb_Device
+ *
+ * Indicates whether @device can display chapter images or not.
+ *
+ * Return value: true if @device can display chapter images.
+ *
+ * Since: 0.7.2
+ */
+gboolean itdb_device_supports_chapter_image (const Itdb_Device *device)
+{
+ GList *formats;
+ if (device == NULL) {
+ return FALSE;
+ }
+ formats = itdb_device_get_chapter_image_formats (device);
+ g_list_free (formats);
+ return (formats != NULL);
+}
+
static char *
get_preferences_path (const Itdb_Device *device)
{
Modified: libgpod/trunk/src/itdb_device.h
===================================================================
--- libgpod/trunk/src/itdb_device.h 2009-03-14 17:59:36 UTC (rev 2271)
+++ libgpod/trunk/src/itdb_device.h 2009-03-14 18:02:16 UTC (rev 2272)
@@ -161,6 +161,7 @@
G_GNUC_INTERNAL GList *itdb_device_get_photo_formats (const Itdb_Device
*device);
G_GNUC_INTERNAL GList *itdb_device_get_cover_art_formats (const Itdb_Device
*device);
+G_GNUC_INTERNAL GList *itdb_device_get_chapter_image_formats (const
Itdb_Device *device);
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);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2