Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv7147/src

Modified Files:
      Tag: coverart_display_development_branch
        display.c display_coverart.c display_playlists.c 
Log Message:
- minor reformatting
- added NULL pointer to the end of _set_item() calls.



Index: display.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display.c,v
retrieving revision 1.149.2.1
retrieving revision 1.149.2.2
diff -u -d -r1.149.2.1 -r1.149.2.2
--- display.c   8 Jan 2007 21:47:07 -0000       1.149.2.1
+++ display.c   20 Feb 2007 13:02:21 -0000      1.149.2.2
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-01-04 19:37:09 jcs>
+/* Time-stamp: <2007-02-20 22:01:01 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.

Index: display_coverart.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/Attic/display_coverart.c,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -d -r1.1.2.9 -r1.1.2.10
--- display_coverart.c  20 Feb 2007 12:04:54 -0000      1.1.2.9
+++ display_coverart.c  20 Feb 2007 13:02:21 -0000      1.1.2.10
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-20 21:04:01 jcs>
+/* Time-stamp: <2007-02-20 22:00:53 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -153,23 +153,23 @@
  */
 static void set_highlight (Cover_Item *cover)
 {
-       GdkPixbuf *image;
-  GError *error = NULL;
-       
-       image = gdk_pixbuf_new_from_file(HIGHLIGHT_FILE, &error);
-       if(error != NULL)
-       {       
-               printf("Error occurred loading file - \nCode: %d\nMessage: 
%s\n", error->code, error->message); 
-               g_return_if_fail (image);
-       }
+    GdkPixbuf *image;
+    GError *error = NULL;
        
-       image = gdk_pixbuf_scale_simple(image, cover->img_width, 
((cover->img_height * 2) + 6), GDK_INTERP_NEAREST);
+    image = gdk_pixbuf_new_from_file(HIGHLIGHT_FILE, &error);
+    if(error != NULL)
+    {  
+       printf("Error occurred loading file - \nCode: %d\nMessage: %s\n", 
error->code, error->message); 
+       g_return_if_fail (image);
+    }
+
+    image = gdk_pixbuf_scale_simple(image, cover->img_width, 
((cover->img_height * 2) + 6), GDK_INTERP_NEAREST);
                
-  gnome_canvas_item_set (cover->highlight,
-                                                                               
                                                                                
        "pixbuf", image,
-                                                                               
                                                                                
        NULL);
-                                                                               
                                                                                
        
-       gnome_canvas_item_hide (cover->highlight);                              
+    gnome_canvas_item_set (cover->highlight,
+                          "pixbuf", image,
+                          NULL);
+
+    gnome_canvas_item_hide (cover->highlight);                         
 }
 
 /**
@@ -213,50 +213,54 @@
  */
 static void set_covers ()
 {
-       GdkPixbuf *imgbuf, *reflection; 
-       gint i, dataindex;
-       Itdb_Track *track;
-  Cover_Item *cover;
+    GdkPixbuf *imgbuf, *reflection; 
+    gint i, dataindex;
+    Itdb_Track *track;
+    Cover_Item *cover;
+
   
-       for(i = 0; i < IMG_TOTAL; ++i)
-  {
-       cover = g_ptr_array_index(cdwidget->cdcovers, i);
-       dataindex = cdwidget->first_imgindex + i;
-       
-       track = g_list_nth_data (cdwidget->displaytracks, dataindex);
-       if (track == NULL)
-       {
-                       imgbuf = draw_blank_cdimage ();
-                       gnome_canvas_item_hide (cover->highlight);
-       }
-               else
-               {
-                       imgbuf = get_thumb (track);
-                       gnome_canvas_item_show (cover->highlight);      
-               }
-       
-       if (imgbuf != NULL)
-               {
-                       /* Set the pixbuf into the cd image */
-                       cover->track = track;
-                       imgbuf = gdk_pixbuf_scale_simple(imgbuf, 
cover->img_width, cover->img_height, GDK_INTERP_NEAREST);
-                       gnome_canvas_item_set (cover->cdimage, "pixbuf", 
imgbuf);
-                       
-                       /* flip image vertically to create reflection */
-                       reflection = gdk_pixbuf_flip (imgbuf, FALSE);
-                       gnome_canvas_item_set (cover->cdreflection, "pixbuf", 
reflection);
-               }
-               
-               if (i == IMG_MAIN)
-               {
-                       /* Set the text to display details of the main image */
-                       gnome_canvas_item_set ( GNOME_CANVAS_ITEM 
(cdwidget->cvrtext),
-                                                                               
                        "text", g_strconcat (track->artist, "\n", track->album, 
NULL),
-                                                                               
                        "fill_color", "white",
-                                                                               
                        "justification", GTK_JUSTIFY_CENTER,
-                                                                               
                        NULL);
-               }               
-  }
+    for(i = 0; i < IMG_TOTAL; ++i)
+    {
+       cover = g_ptr_array_index(cdwidget->cdcovers, i);
+       dataindex = cdwidget->first_imgindex + i;
+
+       track = g_list_nth_data (cdwidget->displaytracks, dataindex);
+       if (track == NULL)
+       {
+           imgbuf = draw_blank_cdimage ();
+           gnome_canvas_item_hide (cover->highlight);
+       }
+       else
+       {
+           imgbuf = get_thumb (track);
+           gnome_canvas_item_show (cover->highlight);  
+       }
+
+       if (imgbuf != NULL)
+       {
+           /* Set the pixbuf into the cd image */
+           cover->track = track;
+           imgbuf = gdk_pixbuf_scale_simple (imgbuf, cover->img_width, 
cover->img_height, GDK_INTERP_NEAREST);
+           gnome_canvas_item_set (cover->cdimage,
+                                  "pixbuf", imgbuf,
+                                  NULL);
+           /* flip image vertically to create reflection */
+           reflection = gdk_pixbuf_flip (imgbuf, FALSE);
+           gnome_canvas_item_set (cover->cdreflection,
+                                  "pixbuf", reflection,
+                                  NULL);
+       }
+
+       if (i == IMG_MAIN)
+       {
+           /* Set the text to display details of the main image */
+           gnome_canvas_item_set (GNOME_CANVAS_ITEM (cdwidget->cvrtext),
+                                  "text", g_strconcat (track->artist, "\n", 
track->album, NULL),
+                                  "fill_color", "white",
+                                  "justification", GTK_JUSTIFY_CENTER,
+                                  NULL);
+       }
+    }
 }
 
 #if 0
@@ -438,10 +442,10 @@
                if (i == IMG_MAIN)
                {
                        /* Set the text to display details of the main image */
-                       gnome_canvas_item_set ( GNOME_CANVAS_ITEM 
(cdwidget->cvrtext),
-                                                                               
                        "text", "No Artist",
-                                                                               
                        "fill_color", "black",
-                                                                               
                        NULL);
+                   gnome_canvas_item_set (GNOME_CANVAS_ITEM 
(cdwidget->cvrtext),
+                                          "text", "No Artist",
+                                          "fill_color", "black",
+                                          NULL);
                }
        }
        g_object_unref(buf);
@@ -638,8 +642,8 @@
        {
                WIDTH = width;
                gnome_canvas_item_set (GNOME_CANVAS_ITEM(cdwidget->cvrtext), 
-                                                                               
                                                                                
                                        "x", (gdouble) WIDTH / 2,
-                                                                               
                                                                                
                                        NULL);
+                                      "x", (gdouble) WIDTH / 2,
+                                      NULL);
                
                for(i = 0; i < IMG_TOTAL; ++i)
        {
@@ -680,11 +684,11 @@
 static gboolean gtkpod_window_configure_callback (GtkWidget *widget, 
GdkEventConfigure *event, gpointer data)
 {                              
        gnome_canvas_item_set (cdwidget->bground, 
-                                                                               
                                                                                
                                "x1",(double) 0, 
-                                                                               
                                                                                
                "y1",(double) 0,
-                                                                               
                                                                                
                "x2",(double) event->width,
-                                                                               
                                                                                
                "y2",(double) event->height,
-                                                                               
                                                                                
                                NULL);
+                              "x1",(double) 0, 
+                              "y1",(double) 0,
+                              "x2",(double) event->width,
+                              "y2",(double) event->height,
+                              NULL);
        gnome_canvas_item_request_update (cdwidget->bground);
                                
        return FALSE;
@@ -806,13 +810,13 @@
                cover->img_width = img_width;
                
                gnome_canvas_item_set (cover->cdcvrgrp,
-                                                                               
                                                                                
                        "x", (gdouble) cover->img_x,
-                                                                               
                                                                                
                        "y", (gdouble) cover->img_y,
-                                                                               
                                                                                
                        NULL);
+                                      "x", (gdouble) cover->img_x,
+                                      "y", (gdouble) cover->img_y,
+                                      NULL);
                
                gnome_canvas_item_set (cover->cdreflection,
-                                                                               
                                                                                
                        "y", (gdouble) (cover->img_height + 4),
-                                                                               
                                                                                
                        NULL);
+                                      "y", (gdouble) (cover->img_height + 4),
+                                      NULL);
 }
 
 /**

Index: display_playlists.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_playlists.c,v
retrieving revision 1.94.2.3
retrieving revision 1.94.2.4
diff -u -d -r1.94.2.3 -r1.94.2.4
--- display_playlists.c 20 Feb 2007 12:04:55 -0000      1.94.2.3
+++ display_playlists.c 20 Feb 2007 13:02:21 -0000      1.94.2.4
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-20 21:04:02 jcs>
+/* Time-stamp: <2007-02-20 21:28:04 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -1362,10 +1362,6 @@
       st_init (-1, 0);
 
       current_playlist = new_playlist;
-    
-       /* Set the coverart display based on the selected playlist */
-       coverart_set_images (new_playlist->members);
-    
       if (new_playlist->is_spl && new_playlist->splpref.liveupdate)
          itdb_spl_update (new_playlist);
       if (new_playlist->members)
@@ -1414,6 +1410,10 @@
       }
       gtkpod_tracks_statusbar_update();
   }
+    
+  /* Set the coverart display based on the selected playlist */
+  coverart_set_images (new_playlist->members);
+    
 #if DEBUG_TIMING
   g_get_current_time (&time);
   printf ("pm_selection_changed_cb exit:  %ld.%06ld sec\n",


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to