Revision: 1654
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1654&view=rev
Author:   phantom_sf
Date:     2007-07-23 15:04:58 -0700 (Mon, 23 Jul 2007)

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

        * src/details.c: set tartwork_changed flag to TRUE rather than relying 
on
          using force_update_cover function. Former picked up by 
pm_track_changed()

        * src/display_coverart.c: coverart_track_change responds to track 
changes
                and redisplays covers if tartwork_changed flag has been set.
        
        * src/display_playlists.c: KEY_DISPLAY_COVERART pref test removed from
          pm_track_changed and placed inside coverart_track_changed instead.
          
        * file.c: update_track_from_file function updates calls for redisplay 
of the
          coverart regardless of any file data changes to ensure that any 
coverart
          changes do not go unnoticed.

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog_detailed
    gtkpod/trunk/src/details.c
    gtkpod/trunk/src/display_coverart.c
    gtkpod/trunk/src/display_playlists.c
    gtkpod/trunk/src/file.c

Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed     2007-07-16 22:39:38 UTC (rev 1653)
+++ gtkpod/trunk/ChangeLog_detailed     2007-07-23 22:04:58 UTC (rev 1654)
@@ -1,3 +1,18 @@
+2007-07-23 P.G. Richardson <phantom_sf at users.sourceforge.net>
+
+       * src/details.c: set tartwork_changed flag to TRUE rather than relying 
on
+         using force_update_cover function. Former picked up by 
pm_track_changed()
+
+       * src/display_coverart.c: coverart_track_change responds to track 
changes
+               and redisplays covers if tartwork_changed flag has been set.
+       
+       * src/display_playlists.c: KEY_DISPLAY_COVERART pref test removed from
+         pm_track_changed and placed inside coverart_track_changed instead.
+         
+       * file.c: update_track_from_file function updates calls for redisplay 
of the
+         coverart regardless of any file data changes to ensure that any 
coverart
+         changes do not go unnoticed.
+
 2007-07-15 Michael Tiffany <tiffman at users.sourceforge.net>
 
        * src/mp3file.c (mp3_get_track_lame_gapless): wasn't properly closing
@@ -20,8 +35,8 @@
 2007-07-13 P.G. Richardson <phantom_sf at users.sourceforge.net>
 
        * src/display_coverart.c
-         src/display_coverart.h
-         src/fetchcover.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: gtkpod/trunk/src/details.c
===================================================================
--- gtkpod/trunk/src/details.c  2007-07-16 22:39:38 UTC (rev 1653)
+++ gtkpod/trunk/src/details.c  2007-07-23 22:04:58 UTC (rev 1654)
@@ -556,6 +556,7 @@
                g_free (toetr->thumb_path_utf8);
                toetr->thumb_path_locale = g_strdup (fretr->thumb_path_locale);
                toetr->thumb_path_utf8 = g_strdup (fretr->thumb_path_utf8);
+               toetr->tartwork_changed = TRUE;
                changed = TRUE;
        }
     /* make sure artwork gets removed, even if both thumb_paths were
@@ -564,12 +565,7 @@
     {
        changed |= gp_track_remove_thumbnails (totrack);
     }
-    
-    /* Since no data changes affect the coverart display.
-     * Need to force a change by calling set covers directly.
-     */
-     force_update_covers ();
-    
+        
     return changed;
 }
 

Modified: gtkpod/trunk/src/display_coverart.c
===================================================================
--- gtkpod/trunk/src/display_coverart.c 2007-07-16 22:39:38 UTC (rev 1653)
+++ gtkpod/trunk/src/display_coverart.c 2007-07-23 22:04:58 UTC (rev 1654)
@@ -119,11 +119,12 @@
 
 /**
  * 
+ * free_CDWidget
+ * 
  * destroy the CD Widget and free everything currently
  * in memory.
- * 
  */
- static void free_CDWidget()
+ static void free_CDWidget ()
  {
        gint i;
        g_signal_handler_disconnect (cdwidget->leftbutton, lbutton_signal_id);
@@ -819,16 +820,16 @@
   
   if (!DEFAULT_FILE)
   {
-      DEFAULT_FILE = g_build_filename (PACKAGE_DATA_DIR, PACKAGE, "data", 
"default-cover.png", NULL);
+               DEFAULT_FILE = g_build_filename (PACKAGE_DATA_DIR, PACKAGE, 
"data", "default-cover.png", NULL);
   }
   if (!HIGHLIGHT_FILE)
   {
-      HIGHLIGHT_FILE = g_build_filename (PACKAGE_DATA_DIR, PACKAGE, "data", 
"cdshine.png", NULL);
+               HIGHLIGHT_FILE = g_build_filename (PACKAGE_DATA_DIR, PACKAGE, 
"data", "cdshine.png", NULL);
   }
   if (!HIGHLIGHT_FILE_MAIN)
   {
-      HIGHLIGHT_FILE_MAIN = g_build_filename (PACKAGE_DATA_DIR, PACKAGE, 
"data", "cdshine_main.png", NULL);
-  }
+               HIGHLIGHT_FILE_MAIN = g_build_filename (PACKAGE_DATA_DIR, 
PACKAGE, "data", "cdshine_main.png", NULL);
+       }
 }
 
 /**
@@ -1447,6 +1448,10 @@
         * e) A track has been created and its artist and album are not in the 
displaylist
         */
 
+       /* If coverart not displayed then ignore */
+       if (! prefs_get_int (KEY_DISPLAY_COVERART))
+       return;
+               
        trk_key = g_strconcat (track->artist, "_", track->album, NULL);         
        /* Determine the index of the found album */
        keypos = g_list_find_custom (album_key_list, trk_key, (GCompareFunc) 
compare_album_keys);
@@ -1580,6 +1585,14 @@
                          if (index != -1)
                          {
                                /* Track exists in the album list so ignore the 
change and return */
+                               ExtraTrackData *etd;
+                               etd = track->userdata;
+                               if (etd->tartwork_changed == TRUE)
+                               {
+                                       etd->tartwork_changed = FALSE;
+                                       set_covers(TRUE);
+                               }
+                               
                                return;
                          }
                          else

Modified: gtkpod/trunk/src/display_playlists.c
===================================================================
--- gtkpod/trunk/src/display_playlists.c        2007-07-16 22:39:38 UTC (rev 
1653)
+++ gtkpod/trunk/src/display_playlists.c        2007-07-23 22:04:58 UTC (rev 
1654)
@@ -1174,8 +1174,7 @@
 {
   if (!current_playlist) return;
   
-  if (prefs_get_int (KEY_DISPLAY_COVERART))
-       coverart_track_changed (track, COVERART_CHANGE_SIGNAL);
+ coverart_track_changed (track, COVERART_CHANGE_SIGNAL);
   
   /* Check if track is member of current playlist */
   if (g_list_find (current_playlist->members, track))

Modified: gtkpod/trunk/src/file.c
===================================================================
--- gtkpod/trunk/src/file.c     2007-07-16 22:39:38 UTC (rev 1653)
+++ gtkpod/trunk/src/file.c     2007-07-23 22:04:58 UTC (rev 1654)
@@ -1761,6 +1761,9 @@
            g_free (name_on_ipod);
        }
 
+       /* Set this flag to true to ensure artwork is reread from file */
+       netr->tartwork_changed = TRUE;
+       
        /* notify display model */
        if (netr->tchanged)
        {
@@ -1768,6 +1771,14 @@
            data_changed (itdb);
            netr->tchanged = FALSE;
        }
+       else
+       {
+               /* Rather than depend on the track data being changed, only the 
artwork may have changed
+                * hence the reason for the user updating from file
+                */
+               coverart_track_changed (track, COVERART_CHANGE_SIGNAL);
+       }
+       
        display_updated (track, NULL);
         g_free (oldhash);
     }


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to