diff options
author | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2007-10-01 15:28:49 +0000 |
---|---|---|
committer | Jorg Schuler <jcsjcs@users.sourceforge.net> | 2007-10-01 15:28:49 +0000 |
commit | 08584ae5069fdd4609424db99b7a0537112935ff (patch) | |
tree | c1506917f1974de4b2fcfb88c27297ba96c8e288 | |
parent | 6e5ba9347d78dfcf374c9d479bf50e01df53dd55 (diff) | |
download | libgpod-08584ae5069fdd4609424db99b7a0537112935ff.tar.gz libgpod-08584ae5069fdd4609424db99b7a0537112935ff.tar.xz libgpod-08584ae5069fdd4609424db99b7a0537112935ff.zip |
* src/itdb_itunesdb.c (mk_mhit): write extended mhit header for
new iPod Nanos and Classics so they display artwork (Christophe)
* src/db-artwork-writer (ipod_artwork_set_ids): modify the
assignment of IDs for artwork (Christophe)
* src/itdb_device.c: added artwork definition file (cover only)
for iPod Nano Videos (3G). Thanks to Simon Schulz.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1711 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | src/db-artwork-writer.c | 14 | ||||
-rw-r--r-- | src/itdb_device.c | 10 | ||||
-rw-r--r-- | src/itdb_itunesdb.c | 8 |
4 files changed, 34 insertions, 9 deletions
@@ -1,3 +1,14 @@ +2007-09-26 Jorg Schuler <jcsjcs at users.sourceforge.net> + + * src/itdb_itunesdb.c (mk_mhit): write extended mhit header for + new iPod Nanos and Classics so they display artwork (Christophe) + + * src/db-artwork-writer (ipod_artwork_set_ids): modify the + assignment of IDs for artwork (Christophe) + + * src/itdb_device.c: added artwork definition file (cover only) + for iPod Nano Videos (3G). Thanks to Simon Schulz. + 2007-09-30 Christophe Fergeau <teuf@gnome.org> * src/itdb_itunesdb.c: (itdb_write_checksum): remove debugging g_print diff --git a/src/db-artwork-writer.c b/src/db-artwork-writer.c index cbf67fe..e11d87d 100644 --- a/src/db-artwork-writer.c +++ b/src/db-artwork-writer.c @@ -999,20 +999,22 @@ static unsigned int ipod_artwork_db_set_ids (Itdb_iTunesDB *db) { GList *it; - unsigned int id; - - id = 64; + unsigned int max_id; + + max_id = 0; for (it = db->tracks; it != NULL; it = it->next) { Itdb_Track *song; song = (Itdb_Track *)it->data; + if (max_id <= song->id) { + max_id = song->id; + } if (song->artwork->thumbnails != NULL) { - song->artwork->id = id; - id++; + song->artwork->id = song->id; } } - return id; + return max_id; } int diff --git a/src/itdb_device.c b/src/itdb_device.c index e35cbaf..9da57ad 100644 --- a/src/itdb_device.c +++ b/src/itdb_device.c @@ -307,6 +307,14 @@ static const Itdb_ArtworkFormat ipod_iphone_1_artwork_info[] = { {-1, -1, -1, -1, -1} }; +static const Itdb_ArtworkFormat ipod_nano3_artwork_info[] = { + {ITDB_THUMB_COVER_SMALL, 56, 55, 1061, THUMB_FORMAT_RGB565_LE, 0x1810}, /*pad data to 0x1810 bytes*/ + {ITDB_THUMB_COVER_LARGE, 320, 320, 1062, THUMB_FORMAT_RGB565_LE}, + {ITDB_THUMB_COVER_MEDIUM, 128, 128, 1055, THUMB_FORMAT_RGB565_LE}, + {-1, -1, -1, -1, -1} +}; + + static const Itdb_ArtworkFormat ipod_classic_1_artwork_info[] = { /* officially 55x55 -- verify! */ {ITDB_THUMB_COVER_XSMALL, 56, 56, 1061, THUMB_FORMAT_RGB565_LE}, @@ -676,7 +684,7 @@ itdb_device_get_artwork_formats (Itdb_Device *device) case ITDB_IPOD_GENERATION_NANO_2: return ipod_nano_artwork_info; case ITDB_IPOD_GENERATION_NANO_3: - return NULL; /* FIXME: */ + return ipod_nano3_artwork_info; case ITDB_IPOD_GENERATION_VIDEO_1: case ITDB_IPOD_GENERATION_VIDEO_2: return ipod_video_artwork_info; diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index 0b944a0..0375177 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -3500,7 +3500,7 @@ static void mk_mhit (WContents *cts, Itdb_Track *track) g_return_if_fail (track); put_header (cts, "mhit"); - put32lint (cts, 0x148);/* header size */ + put32lint (cts, 0x184);/* header size */ put32lint (cts, -1); /* size of whole mhit -- fill in later */ put32lint (cts, -1); /* nr of mhods in this mhit -- later */ put32lint (cts, track->id); /* track index number */ @@ -3585,7 +3585,11 @@ static void mk_mhit (WContents *cts, Itdb_Track *track) put32lint (cts, track->unk252); put16lint (cts, track->gapless_track_flag); put16lint (cts, track->gapless_album_flag); - put32_n0 (cts, 17); /* padding */ + put32_n0 (cts, 23); + put32lint (cts, track->id); /* Needed on fat nanos/ipod classic to get art + * in the right sidepane + */ + put32_n0 (cts, 8); /* padding */ } |