Revision: 1639
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1639&view=rev
Author:   phantom_sf
Date:     2007-07-13 15:44:04 -0700 (Fri, 13 Jul 2007)

Log Message:
-----------
2007-07-13 P.G. Richardson <phantom_sf at users.sourceforge.net>

  * src/display_coverart.c
    src/display_coverart.h
    src/fetchcover.c
    Added parameter to coverart_get_track_thumb so that the default
    cover image can be provided with a default size if required.

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog_detailed
    gtkpod/trunk/src/display_coverart.c
    gtkpod/trunk/src/display_coverart.h
    gtkpod/trunk/src/fetchcover.c

Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed     2007-07-13 16:05:56 UTC (rev 1638)
+++ gtkpod/trunk/ChangeLog_detailed     2007-07-13 22:44:04 UTC (rev 1639)
@@ -1,3 +1,11 @@
+2007-07-13 P.G. Richardson <phantom_sf at users.sourceforge.net>
+
+  * src/display_coverart.c
+    src/display_coverart.h
+    src/fetchcover.c
+    Added parameter to coverart_get_track_thumb so that the default
+    cover image can be provided with a default size if required.
+
 2007-07-13 Jorg Schuler <jcsjcs at users.sourceforge.net>
 
        * src/display_tracks.c (tm_cell_edited, tm_cell_compare): add
@@ -21,20 +29,20 @@
 
 2007-07-04 P.G. Richardson <phantom_sf at users.sourceforge.net>
 
-        * src/details.c: tartwork_changed flag defined when a new
-         artwork file is selected from the filesystem.
+  * src/details.c: tartwork_changed flag defined when a new
+    artwork file is selected from the filesystem.
     
-       * src/fetchcover.c: tartwork_changed flag added for all
-         occurrences of artwork being changed.
+  * src/fetchcover.c: tartwork_changed flag added for all
+    occurrences of artwork being changed.
     
-       * src/display_coverart.c: reworking of the code to fix the
-         sizes of the covers according to the ipod thumbnail size.
-         When the pane is expanded, the coverart display's spacing is
-         widened rather than the individual covers being stretched.
-         Instead of the highlights, reflections and covers images
-         being redrawn as black when null, the containing items are
-         hidden. They are redisplayed when a new cover image is
-         required.
+  * src/display_coverart.c: reworking of the code to fix the
+    sizes of the covers according to the ipod thumbnail size.
+    When the pane is expanded, the coverart display's spacing is
+    widened rather than the individual covers being stretched.
+    Instead of the highlights, reflections and covers images
+    being redrawn as black when null, the containing items are
+    hidden. They are redisplayed when a new cover image is
+       required.
 
 2007-07-04  Todd Zullinger <tmzullinger at users.sourceforge.net>
 

Modified: gtkpod/trunk/src/display_coverart.c
===================================================================
--- gtkpod/trunk/src/display_coverart.c 2007-07-13 16:05:56 UTC (rev 1638)
+++ gtkpod/trunk/src/display_coverart.c 2007-07-13 22:44:04 UTC (rev 1639)
@@ -328,7 +328,7 @@
        if (album->albumart == NULL)
        {
                track = g_list_nth_data (album->tracks, 0);
-               album->albumart = coverart_get_track_thumb (track, 
track->itdb->device);                                
+               album->albumart = coverart_get_track_thumb (track, 
track->itdb->device, 0);                             
        }
        
        /* Set the x, y, height and width of the CD cover */
@@ -570,12 +570,15 @@
  * Retrieve the artwork pixbuf from the given track.
  * 
  * @track: Track from where the pixbuf is obtained.
+ * @device: Reference to the device upon which the track is located
+ * @default_img_size: If the default image must be used then this may contain 
a default value
+ *             for its size.
  * 
  * Returns:
  * pixbuf referenced by the provided track or the pixbuf of the
  * default file if track has no cover art.
  */
-GdkPixbuf *coverart_get_track_thumb (Track *track, Itdb_Device *device)
+GdkPixbuf *coverart_get_track_thumb (Track *track, Itdb_Device *device, gint 
default_img_size)
 {
        GdkPixbuf *pixbuf = NULL;       
        Thumb *thumb;
@@ -594,7 +597,7 @@
        if (pixbuf ==  NULL)
        {
                /* Could not get a viable thumbnail so get default pixbuf */
-               pixbuf = coverart_get_default_track_thumb ();
+               pixbuf = coverart_get_default_track_thumb (default_img_size);
        }
        
        return pixbuf;
@@ -670,7 +673,7 @@
        if (imgbuf ==  NULL)
        {
                /* Could not get a viable thumbnail so get default pixbuf */
-               imgbuf = coverart_get_default_track_thumb ();
+               imgbuf = coverart_get_default_track_thumb (256);
        }
        
        gint pixheight = gdk_pixbuf_get_height (imgbuf);
@@ -721,13 +724,16 @@
  * Returns:
  * pixbuf of the default file for tracks with no cover art.
  */
-GdkPixbuf *coverart_get_default_track_thumb (void)
+GdkPixbuf *coverart_get_default_track_thumb (gint default_img_size)
 {
        GdkPixbuf *pixbuf = NULL;
        GdkPixbuf *scaled = NULL;
        gdouble default_size = 140;
        GError *error = NULL;
        
+       if (default_img_size != 0)
+               default_size = (gdouble) default_img_size;
+       
        pixbuf = gdk_pixbuf_new_from_file(DEFAULT_FILE, &error);
        if (error != NULL)
        {

Modified: gtkpod/trunk/src/display_coverart.h
===================================================================
--- gtkpod/trunk/src/display_coverart.h 2007-07-13 16:05:56 UTC (rev 1638)
+++ gtkpod/trunk/src/display_coverart.h 2007-07-13 22:44:04 UTC (rev 1639)
@@ -80,7 +80,7 @@
 
 void coverart_display_big_artwork ();
 GList *coverart_get_displayed_tracks (void);
-GdkPixbuf *coverart_get_default_track_thumb (void);
+GdkPixbuf *coverart_get_default_track_thumb (gint default_img_size);
 void coverart_init (gchar *progpath);
 void force_update_covers ();
 void coverart_select_cover (Itdb_Track *track);
@@ -89,7 +89,7 @@
 void coverart_clear_images ();
 void coverart_block_change (gboolean val);
 void coverart_init_display ();
-GdkPixbuf *coverart_get_track_thumb (Track *track, Itdb_Device *device);
+GdkPixbuf *coverart_get_track_thumb (Track *track, Itdb_Device *device, gint 
default_img_size);
 void coverart_set_cover_from_file ();
 void coverart_set_cover_from_web ();
 #endif

Modified: gtkpod/trunk/src/fetchcover.c
===================================================================
--- gtkpod/trunk/src/fetchcover.c       2007-07-13 16:05:56 UTC (rev 1638)
+++ gtkpod/trunk/src/fetchcover.c       2007-07-13 22:44:04 UTC (rev 1639)
@@ -803,7 +803,7 @@
                if (error != NULL)
                {
                        /* Artwork failed to load from file so try loading 
default */
-                       imgbuf = coverart_get_track_thumb (track, device);
+                       imgbuf = coverart_get_track_thumb (track, device, 
IMGSCALE);
                        g_error_free (error);
                }
        }
@@ -812,7 +812,7 @@
                /* No thumb path available, fall back to getting the small 
thumbnail
                 * and if that fails, the default thumbnail image.
                 */
-               imgbuf = coverart_get_track_thumb (track, device);
+               imgbuf = coverart_get_track_thumb (track, device, IMGSCALE);
        }
                
        /* Add the cover to the image list */


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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to