Revision: 1981
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1981&view=rev
Author: teuf
Date: 2008-05-25 03:46:13 -0700 (Sun, 25 May 2008)
Log Message:
-----------
* src/db-artwork-debug.c:
* src/db-artwork-writer.c:
* src/db-image-parser.c:
* src/db-itunes-parser.h:
* src/itdb_device.h:
* src/ithumb-writer.c: rename correlation_id to format_id (this is
how that value is called in SysInfoExtended)
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/db-artwork-debug.c
libgpod/trunk/src/db-artwork-writer.c
libgpod/trunk/src/db-image-parser.c
libgpod/trunk/src/db-itunes-parser.h
libgpod/trunk/src/itdb_device.h
libgpod/trunk/src/ithumb-writer.c
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2008-05-25 10:38:09 UTC (rev 1980)
+++ libgpod/trunk/ChangeLog 2008-05-25 10:46:13 UTC (rev 1981)
@@ -1,5 +1,15 @@
2008-05-25 Christophe Fergeau <teuf at gnome.org>
+ * src/db-artwork-debug.c:
+ * src/db-artwork-writer.c:
+ * src/db-image-parser.c:
+ * src/db-itunes-parser.h:
+ * src/itdb_device.h:
+ * src/ithumb-writer.c: rename correlation_id to format_id (this is
+ how that value is called in SysInfoExtended)
+
+2008-05-25 Christophe Fergeau <teuf at gnome.org>
+
* configure.ac: check libxml presence
* src/Makefile.am: add new files, remove obsolete ones
* src/itdb_plist.h:
Modified: libgpod/trunk/src/db-artwork-debug.c
===================================================================
--- libgpod/trunk/src/db-artwork-debug.c 2008-05-25 10:38:09 UTC (rev
1980)
+++ libgpod/trunk/src/db-artwork-debug.c 2008-05-25 10:46:13 UTC (rev
1981)
@@ -35,9 +35,9 @@
g_print ("\tHeader length: %d\n", GINT_FROM_LE (mhif->header_len));
g_print ("\tTotal length: %d\n", GINT_FROM_LE (mhif->total_len));
g_print ("\tUnknown1: %08x\n", GINT_FROM_LE (mhif->unknown1));
- g_print ("\tCorrelation ID: %d (=> F%d_1.ithmb)\n",
- GINT_FROM_LE (mhif->correlation_id),
- GINT_FROM_LE (mhif->correlation_id));
+ g_print ("\tFormat ID: %d (=> F%d_1.ithmb)\n",
+ GINT_FROM_LE (mhif->format_id),
+ GINT_FROM_LE (mhif->format_id));
g_print ("\tImage size: %d bytes\n", GINT_FROM_LE (mhif->image_size));
}
@@ -100,9 +100,9 @@
g_print ("\tHeader length: %d\n", GINT_FROM_LE (mhni->header_len));
g_print ("\tTotal length: %d\n", GINT_FROM_LE (mhni->total_len));
g_print ("\tNumber of children: %08x\n", GINT_FROM_LE
(mhni->num_children));
- g_print ("\tCorrelation ID: %d (=> F%d_1.ithmb)\n",
- GINT_FROM_LE (mhni->correlation_id),
- GINT_FROM_LE (mhni->correlation_id));
+ g_print ("\tFormat ID: %d (=> F%d_1.ithmb)\n",
+ GINT_FROM_LE (mhni->format_id),
+ GINT_FROM_LE (mhni->format_id));
g_print ("\tithmb offset: %u bytes\n", GINT_FROM_LE
(mhni->ithmb_offset));
g_print ("\tImage size: %u bytes\n", GINT_FROM_LE (mhni->image_size));
g_print ("\tVertical padding: %d\n", GINT16_FROM_LE
(mhni->vertical_padding));
Modified: libgpod/trunk/src/db-artwork-writer.c
===================================================================
--- libgpod/trunk/src/db-artwork-writer.c 2008-05-25 10:38:09 UTC (rev
1980)
+++ libgpod/trunk/src/db-artwork-writer.c 2008-05-25 10:46:13 UTC (rev
1981)
@@ -357,7 +357,7 @@
}
static int
-write_mhni (Itdb_DB *db, Itdb_Thumb *thumb, int correlation_id, iPodBuffer
*buffer)
+write_mhni (Itdb_DB *db, Itdb_Thumb *thumb, int format_id, iPodBuffer *buffer)
{
MhniHeader *mhni;
unsigned int total_bytes;
@@ -377,16 +377,11 @@
buffer->byte_order);
mhni->total_len = get_gint32 (total_bytes,
buffer->byte_order);
- mhni->correlation_id = get_gint32 (correlation_id,
- buffer->byte_order);
- mhni->image_width = get_gint16 (thumb->width,
- buffer->byte_order);
- mhni->image_height = get_gint16 (thumb->height,
- buffer->byte_order);
- mhni->image_size = get_gint32 (thumb->size,
- buffer->byte_order);
- mhni->ithmb_offset = get_gint32 (thumb->offset,
- buffer->byte_order);
+ mhni->format_id = get_gint32 (format_id, buffer->byte_order);
+ mhni->image_width = get_gint16 (thumb->width, buffer->byte_order);
+ mhni->image_height = get_gint16 (thumb->height, buffer->byte_order);
+ mhni->image_size = get_gint32 (thumb->size, buffer->byte_order);
+ mhni->ithmb_offset = get_gint32 (thumb->offset, buffer->byte_order);
mhni->vertical_padding = get_gint16 (thumb->vertical_padding,
buffer->byte_order);
mhni->horizontal_padding = get_gint16 (thumb->horizontal_padding,
@@ -415,7 +410,7 @@
}
static int
-write_mhod (Itdb_DB *db, Itdb_Thumb *thumb, int correlation_id, iPodBuffer
*buffer)
+write_mhod (Itdb_DB *db, Itdb_Thumb *thumb, int format_id, iPodBuffer *buffer)
{
ArtworkDB_MhodHeader *mhod;
unsigned int total_bytes;
@@ -439,7 +434,7 @@
if (sub_buffer == NULL) {
return -1;
}
- bytes_written = write_mhni (db, thumb, correlation_id, sub_buffer);
+ bytes_written = write_mhni (db, thumb, format_id, sub_buffer);
ipod_buffer_destroy (sub_buffer);
if (bytes_written == -1) {
return -1;
@@ -519,7 +514,7 @@
if (sub_buffer == NULL) {
return -1;
}
- bytes_written = write_mhod (db, thumb, img_info->correlation_id,
+ bytes_written = write_mhod (db, thumb, img_info->format_id,
sub_buffer);
ipod_buffer_destroy (sub_buffer);
if (bytes_written == -1) {
@@ -737,8 +732,8 @@
}
mhif->total_len = mhif->header_len;
- mhif->correlation_id = get_gint32 (img_info->correlation_id,
- buffer->byte_order);
+ mhif->format_id = get_gint32 (img_info->format_id,
+ buffer->byte_order);
mhif->image_size = get_gint32 (img_info->height * img_info->width * 2,
buffer->byte_order);
Modified: libgpod/trunk/src/db-image-parser.c
===================================================================
--- libgpod/trunk/src/db-image-parser.c 2008-05-25 10:38:09 UTC (rev 1980)
+++ libgpod/trunk/src/db-image-parser.c 2008-05-25 10:46:13 UTC (rev 1981)
@@ -36,7 +36,7 @@
#include <glib/gi18n-lib.h>
static int
-image_type_from_corr_id (Itdb_Device *device, gint16 corr_id)
+image_type_from_format_id (Itdb_Device *device, gint16 format_id)
{
const Itdb_ArtworkFormat *formats;
@@ -51,7 +51,7 @@
}
while (formats->type != -1) {
- if (formats->correlation_id == corr_id) {
+ if (formats->format_id == format_id) {
return formats->type;
}
formats++;
@@ -91,7 +91,7 @@
ipod_image_new_from_mhni (MhniHeader *mhni, Itdb_DB *db)
{
Itdb_Thumb *img;
- gint16 corr_id;
+ gint16 format_id;
Itdb_Device *device = NULL;
img = g_new0 (Itdb_Thumb, 1);
@@ -110,19 +110,19 @@
device = db_get_device (db);
g_return_val_if_fail (device, NULL);
- corr_id = get_gint32_db (db, mhni->correlation_id);
- img->type = image_type_from_corr_id (device, corr_id);
+ format_id = get_gint32_db (db, mhni->format_id);
+ img->type = image_type_from_format_id (device, format_id);
#if DEBUG_ARTWORK
- printf ("corr_id: %d, of: %6d sz: %6d, x: %3d, y: %3d, xpad: %3d, ypad:
%3d\n",
- corr_id, img->offset, img->size, img->width, img->height,
img->horizontal_padding, img->vertical_padding);
+ printf ("format_id: %d, of: %6d sz: %6d, x: %3d, y: %3d, xpad: %3d,
ypad: %3d\n",
+ format_id, img->offset, img->size, img->width, img->height,
img->horizontal_padding, img->vertical_padding);
#endif
if (img->type == -1)
{
g_warning (_("Unexpected image type in mhni: size: %ux%u (%d),
offset: %d\n"),
img->width, img->height,
- corr_id, img->offset);
+ format_id, img->offset);
g_free (img);
return NULL;
}
Modified: libgpod/trunk/src/db-itunes-parser.h
===================================================================
--- libgpod/trunk/src/db-itunes-parser.h 2008-05-25 10:38:09 UTC (rev
1980)
+++ libgpod/trunk/src/db-itunes-parser.h 2008-05-25 10:46:13 UTC (rev
1981)
@@ -156,7 +156,7 @@
gint32 header_len;
gint32 total_len;
gint32 unknown1;
- gint32 correlation_id;
+ gint32 format_id;
gint32 unknown2;
gint32 track_id;
gint32 timestamp;
@@ -562,7 +562,7 @@
gint32 header_len;
gint32 total_len;
gint32 num_children;
- gint32 correlation_id;
+ gint32 format_id;
gint32 ithmb_offset;
gint32 image_size;
gint16 vertical_padding;
@@ -621,7 +621,7 @@
gint32 header_len;
gint32 total_len;
gint32 unknown1;
- gint32 correlation_id;
+ gint32 format_id;
gint32 image_size;
unsigned char padding[];
};
Modified: libgpod/trunk/src/itdb_device.h
===================================================================
--- libgpod/trunk/src/itdb_device.h 2008-05-25 10:38:09 UTC (rev 1980)
+++ libgpod/trunk/src/itdb_device.h 2008-05-25 10:46:13 UTC (rev 1981)
@@ -101,7 +101,7 @@
ItdbThumbType type;
gint16 width;
gint16 height;
- gint16 correlation_id;
+ gint16 format_id;
ItdbThumbFormat format;
gint32 padding;
/* If true, crop the artwork to completely fill the target size,
Modified: libgpod/trunk/src/ithumb-writer.c
===================================================================
--- libgpod/trunk/src/ithumb-writer.c 2008-05-25 10:38:09 UTC (rev 1980)
+++ libgpod/trunk/src/ithumb-writer.c 2008-05-25 10:46:13 UTC (rev 1981)
@@ -486,7 +486,7 @@
static char *
-ipod_image_get_ithmb_filename (const char *mount_point, gint correlation_id,
gint index, DbType db_type )
+ipod_image_get_ithmb_filename (const char *mount_point, gint format_id, gint
index, DbType db_type )
{
gchar *artwork_dir = NULL, *filename, *buf;
@@ -541,7 +541,7 @@
}
}
- buf = g_strdup_printf ("F%d_%d.ithmb", correlation_id, index);
+ buf = g_strdup_printf ("F%d_%d.ithmb", format_id, index);
filename = itdb_get_path (artwork_dir, buf);
@@ -769,7 +769,7 @@
case ITDB_THUMB_PHOTO_FULL_SCREEN:
case ITDB_THUMB_PHOTO_TV_SCREEN:
return g_strdup_printf (":Thumbs:F%d_%d.ithmb",
- writer->img_info->correlation_id,
+ writer->img_info->format_id,
writer->current_file_index);
break;
case ITDB_THUMB_COVER_LARGE:
@@ -779,7 +779,7 @@
case ITDB_THUMB_COVER_SMEDIUM:
case ITDB_THUMB_COVER_XSMALL:
return g_strdup_printf (":F%d_%d.ithmb",
- writer->img_info->correlation_id,
+ writer->img_info->format_id,
writer->current_file_index);
break;
}
@@ -942,7 +942,7 @@
writer->filename =
ipod_image_get_ithmb_filename (writer->mountpoint,
- writer->img_info->correlation_id,
+ writer->img_info->format_id,
writer->current_file_index,
writer->db_type);
if (writer->filename == NULL)
@@ -1319,7 +1319,7 @@
for (i=0; i<50; ++i)
{
filename = ipod_image_get_ithmb_filename (mountpoint,
- info->correlation_id,
+ info->format_id,
i,
db->db_type);
if (g_file_test (filename, G_FILE_TEST_EXISTS))
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2