summaryrefslogtreecommitdiffstats
path: root/src/db-itunes-parser.h
diff options
context:
space:
mode:
authorFlavio Stanchina <fstanchina@users.sourceforge.net>2005-10-10 20:40:45 +0000
committerFlavio Stanchina <fstanchina@users.sourceforge.net>2005-10-10 20:40:45 +0000
commit5191d5305df522f29ebf112fdd0cdf89b6fcb870 (patch)
treec221a35f2709820cb0d26fb7dd4745167a5b2480 /src/db-itunes-parser.h
parentf532f816cc4e478523932dc3ce914b840f5c06bb (diff)
downloadlibgpod-5191d5305df522f29ebf112fdd0cdf89b6fcb870.tar.gz
libgpod-5191d5305df522f29ebf112fdd0cdf89b6fcb870.tar.xz
libgpod-5191d5305df522f29ebf112fdd0cdf89b6fcb870.zip
Added a few structures (notably MHBA and MHIA) to support the Photo Database.
Split 'gint32 image_dimensions' into 'gint16 image_height, image_width'. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1115 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/db-itunes-parser.h')
-rw-r--r--src/db-itunes-parser.h56
1 files changed, 54 insertions, 2 deletions
diff --git a/src/db-itunes-parser.h b/src/db-itunes-parser.h
index bf5f7f2..54ef6b5 100644
--- a/src/db-itunes-parser.h
+++ b/src/db-itunes-parser.h
@@ -61,12 +61,15 @@ typedef struct _MhliHeader MhliHeader;
typedef struct _MhiiHeader MhiiHeader;
typedef struct _MhniHeader MhniHeader;
typedef struct _MhlaHeader MhlaHeader;
+typedef struct _MhbaHeader MhbaHeader;
typedef struct _MhlfHeader MhlfHeader;
typedef struct _MhifHeader MhifHeader;
+typedef struct _MhiaHeader MhiaHeader;
typedef struct _MhitHeader471 MhitHeader471;
/* MHOD typedef mess */
typedef struct _MhodHeaderString MhodHeaderString;
+typedef struct _MhodHeaderArtworkType1 MhodHeaderArtworkType1;
typedef struct _MhodHeaderArtworkType3 MhodHeaderArtworkType3;
typedef struct _MhodHeaderSmartPlaylistData MhodHeaderSmartPlaylistData;
typedef struct _MhodHeaderSmartPlaylistRuleString MhodHeaderSmartPlaylistRuleString;
@@ -311,11 +314,35 @@ struct _MhodHeaderString {
gint32 unknown2;
gint32 position;
gint32 string_len;
- gint32 encoding;
+ gint32 unknown3; /* It was thought that this was string encoding:
+ * 0 == UTF-16, 1 == UTF-8, however, recent iTunesDB
+ * files have had this set to 1 even with UTF-16 strings.
+ * Therefore this is definitely incorrect, and the
+ * correct meaning has not yet been discovered yet. */
gint32 unknown4;
unsigned char string[];
};
+enum MhodArtworkType {
+ MHOD_ARTWORK_TYPE_ALBUM_NAME = 1, /* string: album name (in the Photo Database) */
+ MHOD_ARTWORK_TYPE_THUMBNAIL = 2, /* container: thumbnail image */
+ MHOD_ARTWORK_TYPE_FILE_NAME = 3, /* string: file name */
+ MHOD_ARTWORK_TYPE_IMAGE = 5 /* container: full resolution image (in the Photo Database) */
+};
+
+struct _MhodHeaderArtworkType1 {
+ unsigned char header_id[4];
+ gint32 header_len;
+ gint32 total_len;
+ gint32 type; /* low 3 bytes are type (always 1); high byte is padding length (0-3) */
+ gint32 unknown1;
+ gint32 unknown2;
+ gint32 string_len;
+ gint32 unknown3; /* might be the string encoding */
+ gint32 unknown4; /* always zero? */
+ unsigned char string[];
+};
+
struct _MhodHeaderArtworkType3 {
unsigned char header_id[4];
gint32 header_len;
@@ -507,7 +534,8 @@ struct _MhniHeader {
gint32 ithmb_offset;
gint32 image_size;
gint32 unknown3;
- gint32 image_dimensions;
+ gint16 image_height;
+ gint16 image_width;
unsigned char padding[];
};
@@ -518,6 +546,21 @@ struct _MhlaHeader {
unsigned char padding[];
};
+struct _MhbaHeader {
+ unsigned char header_id[4];
+ gint32 header_len;
+ gint32 total_len;
+ gint32 num_mhods; /* number of Data Objects in the List, probably always 1 */
+ gint32 num_mhias; /* number of pictures in the album */
+ gint32 playlist_id; /* starts out at $64 and increments by 1 */
+ gint32 unknown2; /* unknown, seems to be always 0 */
+ gint32 unknown3; /* unknown, but is 0x10000 for the Photo Library and 0x60000 for normal albums
+ * (maybe not a 4 byte field?) */
+ gint32 unknown[7]; /* more zeroes */
+ gint32 prev_playlist_id; /* the id of the previous playlist */
+ unsigned char padding[];
+};
+
struct _MhlfHeader {
unsigned char header_id[4];
gint32 header_len;
@@ -535,6 +578,15 @@ struct _MhifHeader {
unsigned char padding[];
};
+struct _MhiaHeader {
+ unsigned char header_id[4];
+ gint32 header_len;
+ gint32 total_len; /* probably the size of the header and all child records;
+ * as there aren't any child records this is equal to header length */
+ gint32 unknown1; /* seems to be zero */
+ gint32 image_id; /* the id of the mhii record this mhia refers to */
+ unsigned char padding[];
+};
#endif /* PARSE_DB_H */