Update of /cvsroot/gtkpod/libgpod/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17627/tests

Modified Files:
        test-covers.c test-write-covers.c 
Log Message:
        New API for thumbnail support: see src/itdb.h for details.

        * src/itdb.h: Introduced Itdb_Artwork and ItdbThumbType and
        changed Itdb_Image to Itdb_Thumb throughout the source.

        * src/itdb_artwork.c: new file as backend for Itdb_Artwork support
        (new, free, duplicate, get_thumb_by_type, add_thumbnail,
        remove_thumbnail, remove_thumbnails), as well as for the
        Itdb_Thumb support (new, free, duplicate, get_gdk_pixbuf,
        get_filename)

        * src/itdb_track.c: new functions for artwork support
        (set_thumbnails, remove_thumbnails)

        * src/ithumb-writer.c: added support to write thumbnails in
        addition to existing thumbnails

        * src/db-artwork-parcer.c: (mhod3_get_ithmb_filename)

        * src/itdb_itunesdb.c: (update_artwork_info)

        * tests/test-covers.c: updated to new API.

        * tests/test-write-covers.c: updated to new API.

        Known issues: iTunes wipes off our thumbnails.



Index: test-covers.c
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/tests/test-covers.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- test-covers.c       24 Nov 2005 13:31:24 -0000      1.9
+++ test-covers.c       28 Nov 2005 16:20:40 -0000      1.10
@@ -33,14 +33,14 @@
 
 
 static void
-save_itdb_image (Itdb_iTunesDB *itdb, Itdb_Image *image, const char *filename)
+save_itdb_thumb (Itdb_iTunesDB *itdb, Itdb_Thumb *thumb, const char *filename)
 {
-       GdkPixbuf *thumb;
+       GdkPixbuf *pixbuf;
        
-       thumb = itdb_image_get_gdk_pixbuf (itdb, image);
-       if (thumb != NULL) {
-               gdk_pixbuf_save (thumb, filename, "png", NULL, NULL);
-               gdk_pixbuf_unref (thumb);
+       pixbuf = itdb_thumb_get_gdk_pixbuf (itdb->device, thumb);
+       if (pixbuf != NULL) {
+               gdk_pixbuf_save (pixbuf, filename, "png", NULL, NULL);
+               gdk_pixbuf_unref (pixbuf);
 /*             g_print ("Saved %s\n", filename); */
        }
 }
@@ -49,20 +49,20 @@
 {
        GList *it;
        
-       for (it = song->thumbnails; it != NULL; it = it->next) {
-               Itdb_Image *image;
+       for (it = song->artwork->thumbnails; it != NULL; it = it->next) {
+               Itdb_Thumb *thumb;
                gchar *filename;
 
-               image = (Itdb_Image *)it->data;
-               g_return_if_fail (image);
+               thumb = (Itdb_Thumb *)it->data;
+               g_return_if_fail (thumb);
 
                filename = NULL;
                filename = g_strdup_printf 
("%s-%s-%s-%d-%016"G_GINT64_MODIFIER"x.png",
                                            song->artist, song->album, 
-                                           song->title, image->type, 
+                                           song->title, thumb->type, 
                                            song->dbid);
                if (filename != NULL) {
-                       save_itdb_image (song->itdb, image, filename);
+                       save_itdb_thumb (song->itdb, thumb, filename);
                        g_free (filename);
                }
        }

Index: test-write-covers.c
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/tests/test-write-covers.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test-write-covers.c 23 Oct 2005 15:20:36 -0000      1.2
+++ test-write-covers.c 28 Nov 2005 16:20:40 -0000      1.3
@@ -97,11 +97,11 @@
                const char *coverpath;
 
                song = (Itdb_Track*)it->data;
-               itdb_track_remove_thumbnail (song);
+               itdb_artwork_remove_thumbnails (song->artwork);
 
                coverpath = g_list_nth_data (covers, 
                                             g_random_int_range (0, nb_covers));
-               itdb_track_set_thumbnail (song, coverpath);
+               itdb_track_set_thumbnails (song, coverpath);
 /*             g_print ("%s - %s - %s gets %s\n",  
                song->artist, song->album, song->title, coverpath);*/
 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to