Revision: 2270
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2270&view=rev
Author: teuf
Date: 2009-03-14 17:57:24 +0000 (Sat, 14 Mar 2009)
Log Message:
-----------
Add itdb_device_supports_podcast method
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/itdb.h
libgpod/trunk/src/itdb_device.c
libgpod/trunk/src/itdb_sysinfo_extended_parser.c
libgpod/trunk/src/itdb_sysinfo_extended_parser.h
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2009-03-14 11:31:41 UTC (rev 2269)
+++ libgpod/trunk/ChangeLog 2009-03-14 17:57:24 UTC (rev 2270)
@@ -1,3 +1,12 @@
+2009-03-14 Christophe Fergeau <[email protected]>
+
+ * src/itdb.h:
+ * src/itdb_device.c:
+ * src/itdb_sysinfo_extended_parser.c:
+ * src/itdb_sysinfo_extended_parser.h: add
+ itdb_device_supports_podcast method to test if an iPod supports
+ podcasts or not.
+
2009-03-14 Jorg Schuler <jcsjcs at users.sourceforge.net>
* src/itdb_itunesdb.c
Modified: libgpod/trunk/src/itdb.h
===================================================================
--- libgpod/trunk/src/itdb.h 2009-03-14 11:31:41 UTC (rev 2269)
+++ libgpod/trunk/src/itdb.h 2009-03-14 17:57:24 UTC (rev 2270)
@@ -1750,6 +1750,7 @@
gboolean itdb_device_supports_artwork (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);
const gchar *itdb_info_get_ipod_model_name_string (Itdb_IpodModel model);
const gchar *itdb_info_get_ipod_generation_string (Itdb_IpodGeneration
generation);
Modified: libgpod/trunk/src/itdb_device.c
===================================================================
--- libgpod/trunk/src/itdb_device.c 2009-03-14 11:31:41 UTC (rev 2269)
+++ libgpod/trunk/src/itdb_device.c 2009-03-14 17:57:24 UTC (rev 2270)
@@ -1941,3 +1941,52 @@
}
return quark;
}
+
+/**
+ * itdb_device_supports_podcast:
+ * @device: an #Itdb_Device
+ *
+ * Indicates whether @device can play podcasts or not.
+ *
+ * Returns: true if @device can play podcasts.
+ *
+ * Since: 0.7.2
+ */
+gboolean
+itdb_device_supports_podcast (const Itdb_Device *device)
+{
+ if (device->sysinfo_extended != NULL) {
+ return itdb_sysinfo_properties_supports_podcast
(device->sysinfo_extended);
+ } else {
+ 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_MOBILE:
+ return FALSE;
+ case ITDB_IPOD_GENERATION_FOURTH:
+ case ITDB_IPOD_GENERATION_PHOTO:
+ case ITDB_IPOD_GENERATION_MINI_1:
+ case ITDB_IPOD_GENERATION_MINI_2:
+ case ITDB_IPOD_GENERATION_NANO_1:
+ case ITDB_IPOD_GENERATION_NANO_2:
+ case ITDB_IPOD_GENERATION_NANO_3:
+ case ITDB_IPOD_GENERATION_NANO_4:
+ case ITDB_IPOD_GENERATION_SHUFFLE_1:
+ case ITDB_IPOD_GENERATION_SHUFFLE_2:
+ case ITDB_IPOD_GENERATION_SHUFFLE_3:
+ case ITDB_IPOD_GENERATION_VIDEO_1:
+ case ITDB_IPOD_GENERATION_VIDEO_2:
+ case ITDB_IPOD_GENERATION_CLASSIC_1:
+ case ITDB_IPOD_GENERATION_CLASSIC_2:
+ case ITDB_IPOD_GENERATION_TOUCH_1:
+ case ITDB_IPOD_GENERATION_IPHONE_1:
+ return TRUE;
+ }
+ g_return_val_if_reached (FALSE);
+ }
+}
Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.c
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.c 2009-03-14 11:31:41 UTC
(rev 2269)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.c 2009-03-14 17:57:24 UTC
(rev 2270)
@@ -639,3 +639,11 @@
return props->supports_sparse_artwork;
}
+
+gboolean
+itdb_sysinfo_properties_supports_podcast (const SysInfoIpodProperties *props)
+{
+ g_return_val_if_fail (props != NULL, FALSE);
+
+ return props->podcasts_supported;
+}
Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.h
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.h 2009-03-14 11:31:41 UTC
(rev 2269)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.h 2009-03-14 17:57:24 UTC
(rev 2270)
@@ -58,6 +58,8 @@
itdb_sysinfo_properties_get_chapter_image_formats (const SysInfoIpodProperties
*);
G_GNUC_INTERNAL gboolean
itdb_sysinfo_properties_supports_sparse_artwork (const SysInfoIpodProperties
*);
+G_GNUC_INTERNAL gboolean
+itdb_sysinfo_properties_supports_podcast (const SysInfoIpodProperties *);
G_END_DECLS
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