commit 559c2c866b7572b99e978c2d00b51e3ca9beef68 Author: Christophe Fergeau <cferg...@mandriva.com> Date: Tue Feb 16 22:53:30 2010 +0100
add itdb_device_is_shuffle src/itdb_device.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/itdb_device.h | 1 + 2 files changed, 42 insertions(+), 0 deletions(-) --- diff --git a/src/itdb_device.c b/src/itdb_device.c index c1be97a..d42e6f0 100644 --- a/src/itdb_device.c +++ b/src/itdb_device.c @@ -2032,6 +2032,47 @@ gchar *itdb_device_get_uuid(const Itdb_Device *device) return g_hash_table_lookup (device->sysinfo, "FirewireGuid"); } +gboolean itdb_device_is_shuffle (const Itdb_Device *device) +{ + 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: + 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_NANO_5: + 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_CLASSIC_3: + case ITDB_IPOD_GENERATION_TOUCH_1: + case ITDB_IPOD_GENERATION_TOUCH_2: + case ITDB_IPOD_GENERATION_TOUCH_3: + case ITDB_IPOD_GENERATION_IPHONE_1: + case ITDB_IPOD_GENERATION_IPHONE_2: + case ITDB_IPOD_GENERATION_IPHONE_3: + return FALSE; + case ITDB_IPOD_GENERATION_SHUFFLE_1: + case ITDB_IPOD_GENERATION_SHUFFLE_2: + case ITDB_IPOD_GENERATION_SHUFFLE_3: + case ITDB_IPOD_GENERATION_SHUFFLE_4: + return TRUE; + } + g_return_val_if_reached (FALSE); +} + gboolean itdb_device_is_iphone_family (const Itdb_Device *device) { if (device->sysinfo_extended != NULL) { diff --git a/src/itdb_device.h b/src/itdb_device.h index 0eca609..31cdef1 100644 --- a/src/itdb_device.h +++ b/src/itdb_device.h @@ -176,6 +176,7 @@ G_GNUC_INTERNAL gboolean itdb_device_write_checksum (Itdb_Device *device, GError **error); G_GNUC_INTERNAL void itdb_device_set_timezone_info (Itdb_Device *device); G_GNUC_INTERNAL gboolean itdb_device_is_iphone_family (const Itdb_Device *device); +G_GNUC_INTERNAL gboolean itdb_device_is_shuffle (const Itdb_Device *device); G_GNUC_INTERNAL ItdbChecksumType itdb_device_get_checksum_type (const Itdb_Device *device); const Itdb_IpodInfo * ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2