Revision: 1516
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1516&view=rev
Author:   phantom_sf
Date:     2007-06-01 13:18:55 -0700 (Fri, 01 Jun 2007)

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

  * display_coverart.c

                Added callback on display_coverart content panel for acting
                on scroll events with the mouse wheel. Result is that moving
                the scroll wheel while the mouse is over the coverart display
                will scroll the covers in the respective direction.
                
                Avoided possible null pointer in track_changed function.
                Thanks to Daniele Forsi for raising it. May need further work
                if this does not solve it.

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

Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed     2007-06-01 14:19:21 UTC (rev 1515)
+++ gtkpod/trunk/ChangeLog_detailed     2007-06-01 20:18:55 UTC (rev 1516)
@@ -1,5 +1,19 @@
-2007-05-16 Jorg Schuler <jcsjcs at users.sourceforge.net>
+2007-06-01  P.G. Richardson <phantom_sf at users.sourceforge.net>
 
+  * display_coverart.c
+
+               Added callback on display_coverart content panel for acting
+               on scroll events with the mouse wheel. Result is that moving
+               the scroll wheel while the mouse is over the coverart display
+               will scroll the covers in the respective direction.
+               
+               Avoided possible null pointer in track_changed function.
+               Thanks to Daniele Forsi for raising it. May need further work
+               if this does not solve it.
+
+
+2007-05-31 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
        * src/autodetection.c: fix non-responsive buttons introduced
           with automounting.
 

Modified: gtkpod/trunk/src/display_coverart.c
===================================================================
--- gtkpod/trunk/src/display_coverart.c 2007-06-01 14:19:21 UTC (rev 1515)
+++ gtkpod/trunk/src/display_coverart.c 2007-06-01 20:18:55 UTC (rev 1516)
@@ -90,6 +90,7 @@
 static gulong rbutton_signal_id;
 static gulong lbutton_signal_id;
 static gulong window_signal_id;
+static gulong contentpanel_signal_id;
 
 #if 0
 static void debug_albums ()
@@ -948,6 +949,32 @@
        return FALSE;
 }
 
+static gboolean on_contentpanel_scroll_wheel_turned (GtkWidget *widget, 
GdkEventScroll *event, gpointer user_data)
+{
+       gint displaytotal;
+       
+       if (event->direction == GDK_SCROLL_DOWN)
+               cdwidget->first_imgindex++;
+  else
+       cdwidget->first_imgindex--;
+       
+  displaytotal = g_list_length(album_key_list) - 8;
+  
+  if (displaytotal <= 0)
+       return TRUE;
+  
+  /* Use the index value from the slider for the main image index */
+  if (cdwidget->first_imgindex < 0)
+       cdwidget->first_imgindex = 0;
+  else if (cdwidget->first_imgindex > (displaytotal - 1))
+       cdwidget->first_imgindex = displaytotal - 1;
+       
+       /* Change the value of the slider to do the work of scrolling the 
covers */
+       gtk_range_set_value (GTK_RANGE (cdwidget->cdslider), 
cdwidget->first_imgindex);
+       
+       return TRUE;    
+}
+      
 /**
  * gtkpod_window_configure_callback:
  *
@@ -1296,6 +1323,9 @@
        
        gtk_box_pack_start_defaults (GTK_BOX(cdwidget->canvasbox), 
GTK_WIDGET(cdwidget->canvas));
                        
+       contentpanel_signal_id = g_signal_connect 
(G_OBJECT(cdwidget->contentpanel), "scroll-event",
+                                       
G_CALLBACK(on_contentpanel_scroll_wheel_turned), NULL);
+                                       
        lbutton_signal_id = g_signal_connect (G_OBJECT(cdwidget->leftbutton), 
"clicked",
                      G_CALLBACK(on_cover_display_button_clicked), NULL);
                      
@@ -1569,6 +1599,8 @@
                          * album items track list. If it does then b) is true 
and nothing more is required.
                          */
                          album = g_hash_table_lookup (album_hash, trk_key);
+                         g_return_if_fail (album);
+                         
                          index = g_list_index (album->tracks, track);
                          if (index != -1)
                          {

Modified: gtkpod/trunk/src/display_playlists.c
===================================================================
--- gtkpod/trunk/src/display_playlists.c        2007-06-01 14:19:21 UTC (rev 
1515)
+++ gtkpod/trunk/src/display_playlists.c        2007-06-01 20:18:55 UTC (rev 
1516)
@@ -1493,10 +1493,10 @@
 
     for (gl_pl=itdb->playlists; gl_pl; gl_pl=gl_pl->next)
     {
-       Playlist *pl = gl_pl->data;
-       g_return_if_fail (pl);
-       if (itdb_playlist_is_mpl (pl))     pm_add_playlist (pl, pos);
-       else                               pm_add_playlist (pl, -1);
+                       Playlist *pl = gl_pl->data;
+                       g_return_if_fail (pl);
+                       if (itdb_playlist_is_mpl (pl))     pm_add_playlist (pl, 
pos);
+                       else                               pm_add_playlist (pl, 
-1);
     }
 }
 


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