summaryrefslogtreecommitdiffstats
path: root/src/ithumb-writer.c
diff options
context:
space:
mode:
authorjcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-06-01 15:45:28 +0000
committerjcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-06-01 15:45:28 +0000
commitc02567f020ce437fe5748f0abc628cda514e180e (patch)
tree357ea03987d9101f0cadb57d1906d4bebae99d36 /src/ithumb-writer.c
parent0bd5f189bd2fd3f24521b16b46344cef9fc8ca7e (diff)
downloadlibgpod-c02567f020ce437fe5748f0abc628cda514e180e.tar.gz
libgpod-c02567f020ce437fe5748f0abc628cda514e180e.tar.xz
libgpod-c02567f020ce437fe5748f0abc628cda514e180e.zip
* src/itdb.h:
src/itdb_private.h: moved Itdb_DB to private part. * src/itdb.h: src/itdb_private.h: src/itdb_itunesdb: New: db_get_itunesdb(), db_get_photodb() * src/db-artwork-parser.c src/db-artwork-writer.c src/db-image-parser.c src/db-image-parser.h src/db-parse-context.c src/db-parse-context.h src/itdb_endianness.h src/itdb_itunesdb.c src/ithumb-writer.c: Remove all direct access to Itdb_DB->db. enum git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1296 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/ithumb-writer.c')
-rw-r--r--src/ithumb-writer.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/ithumb-writer.c b/src/ithumb-writer.c
index a94c289..88e1b95 100644
--- a/src/ithumb-writer.c
+++ b/src/ithumb-writer.c
@@ -94,6 +94,7 @@ pack_RGB_565 (GdkPixbuf *pixbuf, iThumbWriter *writer )
horizontal_padding = (writer->img_info->width - width)/2;
vertical_padding = (writer->img_info->height - height)/2;
+
for (h = 0; h < height; h++) {
for (w = 0; w < width; w++) {
gint r;
@@ -589,7 +590,7 @@ ithmb_rearrange_existing_thumbnails (Itdb_DB *db,
allows to adjust the offset pointers */
switch (db->db_type) {
case DB_TYPE_ITUNES:
- for (gl=db->db.itdb->tracks; gl; gl=gl->next)
+ for (gl=db_get_itunesdb(db)->tracks; gl; gl=gl->next)
{
Itdb_Thumb *thumb;
Itdb_Track *track = gl->data;
@@ -599,8 +600,9 @@ ithmb_rearrange_existing_thumbnails (Itdb_DB *db,
info->type);
if (thumb && thumb->filename && (thumb->size != 0))
{
- filename = itdb_thumb_get_filename (db->db.itdb->device,
- thumb);
+ filename = itdb_thumb_get_filename (
+ db_get_device(db),
+ thumb);
if (filename)
{
thumbs = g_hash_table_lookup (filenamehash, filename);
@@ -609,8 +611,9 @@ ithmb_rearrange_existing_thumbnails (Itdb_DB *db,
}
}
}
+ break;
case DB_TYPE_PHOTO:
- for (gl=db->db.photodb->photos; gl; gl=gl->next)
+ for (gl=db_get_photodb(db)->photos; gl; gl=gl->next)
{
Itdb_Thumb *thumb;
Itdb_Artwork *artwork = gl->data;
@@ -619,8 +622,9 @@ ithmb_rearrange_existing_thumbnails (Itdb_DB *db,
info->type);
if (thumb && thumb->filename && (thumb->size != 0))
{
- filename = itdb_thumb_get_filename (db->db.photodb->device,
- thumb);
+ filename = itdb_thumb_get_filename (
+ db_get_device (db),
+ thumb);
if (filename)
{
thumbs = g_hash_table_lookup (filenamehash, filename);
@@ -629,6 +633,9 @@ ithmb_rearrange_existing_thumbnails (Itdb_DB *db,
}
}
}
+ break;
+ default:
+ g_return_val_if_reached (FALSE);
}
/* Check for files present on the iPod but no longer referenced by
@@ -714,7 +721,7 @@ itdb_write_ithumb_files (Itdb_DB *db)
}
switch (db->db_type) {
case DB_TYPE_ITUNES:
- for (it = db->db.itdb->tracks; it != NULL; it = it->next) {
+ for (it = db_get_itunesdb(db)->tracks; it != NULL; it = it->next) {
Itdb_Track *track;
track = it->data;
@@ -724,7 +731,7 @@ itdb_write_ithumb_files (Itdb_DB *db)
}
break;
case DB_TYPE_PHOTO:
- for (it = db->db.photodb->photos; it != NULL; it = it->next) {
+ for (it = db_get_photodb(db)->photos; it != NULL; it = it->next) {
Itdb_Artwork *photo;
photo = it->data;
@@ -733,6 +740,8 @@ itdb_write_ithumb_files (Itdb_DB *db)
g_list_foreach (writers, write_thumbnail, photo);
}
break;
+ default:
+ g_return_val_if_reached (-1);
}
g_list_foreach (writers, (GFunc)ithumb_writer_free, NULL);