summaryrefslogtreecommitdiffstats
path: root/src/db-artwork-parser.c
diff options
context:
space:
mode:
authorjcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-06-04 16:24:45 +0000
committerjcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-06-04 16:24:45 +0000
commit567f2a788c6aa050294e31f58f06e3d94f22fea5 (patch)
tree659eb107c8bbdacf0f74f3c9db68e0aa122eec6a /src/db-artwork-parser.c
parent86faaa2088244b44f54b463e4eccd84154afb219 (diff)
2006-06-05 Jorg Schuler <jcsjcs at users.sourceforge.net>
* src/db-artwork-parser.h src/db-artwork-parserc (ipod_supports_cover_art): made available G_GNUC_INTERNAL. Added ipod_supports_photos(). * src/itdb_itunesdb.c (itdb_create_directories): Create Photos directory. 2006-06-04 Jorg Schuler <jcsjcs at users.sourceforge.net> * src/db-image-parser.c src/itdb_artwork.c src/itdb_device.c src/itdb_photoalbum.c src/itdb_track.c src/ithumb-writer.c: Phased out private IPOD_COVER_SMALL... enum in favor of identical public enum "ItdbThumbType" ITDB_THUMB_COVER_SMALL... * src/db-image-parser.c (ipod_image_new_from_mhni): Accept all thumbnail types we know about (i.e. type != -1). * src/db-artwork-debug.h src/db-artwork-parser.h src/db-image-parser.h src/db-parse-context.h src/glib-compat.h src/itdb_endianness.h: Added CVS "$Id:" line, added copyright notices where missing, added explanations to itdb_endianess.h ;-) * src/itdb_itunesdb.c src/itdb_track.c src/itdb_device.c src/itdb_device.h Made naming consistent and suitable for export: Itdb_IpodModel -> Itdb_IpodInfo ipod_model_table -> ipod_info_table itdb_device_get_model_info() -> itdb_device_get_ipod_info() MODEL_TYPE_... -> ITDB_IPOD_MODEL_... nth_GENERATION -> ITDB_IPOD_GENERATION_nth Exported Itdb_IpodModel, Itdb_IpodGeneration, Itdb_IpodInfo, itdb_device_get_ipod_info(). * src/itdb_device.c: new API: itdb_info_get_ipod_info_table(), itdb_info_get_ipod_model_name() * src/itdb.h src/itdb_artwork.c: Removed unused field ->type in Itdb_Artwork and corresponding enum ItdbArtworkType. 2006-06-03 Jorg Schuler <jcsjcs at users.sourceforge.net> * src/itdb_artwork.c (itdb_thumb_get_gdk_pixbuf): handle thumbnail padding correctly -- who would have thought that iTunes indicates _negative_ padding at times... Please use the test-photos program to check out whether or not your photos show up correctly without black bars or funny colors. * src/db-artwork-writer.c src/db-image-parser.c src/itdb.h src/ithumb-writer.c: Hopefully do padding right: - read padding fields from mhni header and store them with each thumbnail - calculate padding for PhotoDB only (padding for iTunesDB Artwork does not seem to be necessary) - include the padding into the total width/height It seems to work well on my iPod Nano -- feedback appreciated. * tests/test-photos.c: added possibility to dump all photos into a directory: tests/test-photos dump <mountpoint> <output_dir> * src/itdb_artwork.c: changed byte order for full screen iPod Nanos. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1299 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/db-artwork-parser.c')
-rw-r--r--src/db-artwork-parser.c57
1 files changed, 49 insertions, 8 deletions
diff --git a/src/db-artwork-parser.c b/src/db-artwork-parser.c
index b5d7fde..4a848ce 100644
--- a/src/db-artwork-parser.c
+++ b/src/db-artwork-parser.c
@@ -323,7 +323,6 @@ parse_mhii (DBParseContext *ctx, GError *error)
switch (ctx->db->db_type) {
case DB_TYPE_PHOTO:
artwork = g_new0( Itdb_Artwork, 1 );
- artwork->type = ITDB_PHOTO;
artwork->artwork_size = get_gint32 (mhii->orig_img_size, ctx->byte_order);
artwork->id = get_gint32 (mhii->image_id, ctx->byte_order);
artwork->creation_date = itdb_time_mac_to_host( get_gint32 (mhii->digitised_date, ctx->byte_order) );
@@ -614,7 +613,7 @@ ipod_db_get_artwork_db_path (const char *mount_point)
return filename;
}
-static gboolean
+G_GNUC_INTERNAL gboolean
ipod_supports_cover_art (Itdb_Device *device)
{
const Itdb_ArtworkFormat *formats;
@@ -628,17 +627,59 @@ ipod_supports_cover_art (Itdb_Device *device)
return FALSE;
}
- while (formats->type != -1) {
- if ((formats->type == IPOD_COVER_SMALL)
- || (formats->type == IPOD_COVER_LARGE)) {
- return TRUE;
- }
- formats++;
+ while (formats->type != -1)
+ {
+ switch (formats->type)
+ {
+ case ITDB_THUMB_COVER_SMALL:
+ case ITDB_THUMB_COVER_LARGE:
+ return TRUE;
+ case ITDB_THUMB_PHOTO_SMALL:
+ case ITDB_THUMB_PHOTO_LARGE:
+ case ITDB_THUMB_PHOTO_FULL_SCREEN:
+ case ITDB_THUMB_PHOTO_TV_SCREEN:
+ break;
+ }
+ formats++;
}
return FALSE;
}
+G_GNUC_INTERNAL gboolean
+ipod_supports_photos (Itdb_Device *device)
+{
+ const Itdb_ArtworkFormat *formats;
+
+ if (device == NULL) {
+ return FALSE;
+ }
+
+ formats = itdb_device_get_artwork_formats (device);
+ if (formats == NULL) {
+ return FALSE;
+ }
+
+ while (formats->type != -1)
+ {
+ switch (formats->type)
+ {
+ case ITDB_THUMB_COVER_SMALL:
+ case ITDB_THUMB_COVER_LARGE:
+ break;
+ case ITDB_THUMB_PHOTO_SMALL:
+ case ITDB_THUMB_PHOTO_LARGE:
+ case ITDB_THUMB_PHOTO_FULL_SCREEN:
+ case ITDB_THUMB_PHOTO_TV_SCREEN:
+ return TRUE;
+ }
+ formats++;
+ }
+
+ return FALSE;
+}
+
+
int
ipod_parse_artwork_db (Itdb_iTunesDB *itdb)
{