[xiph-commits] r12082 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Fri Nov 10 18:35:10 PST 2006


Author: xiphmont
Date: 2006-11-10 18:35:07 -0800 (Fri, 10 Nov 2006)
New Revision: 12082

Modified:
   trunk/sushivision/main.c
   trunk/sushivision/panel-2d.c
   trunk/sushivision/panel-2d.h
   trunk/sushivision/plot.c
   trunk/sushivision/slice.c
Log:
Fix quit-while-render lockup

Fix one thread always awake bug cause by legend code

Add 'p' keybinding to find and snap to peaks in the window.



Modified: trunk/sushivision/main.c
===================================================================
--- trunk/sushivision/main.c	2006-11-11 01:39:32 UTC (rev 12081)
+++ trunk/sushivision/main.c	2006-11-11 02:35:07 UTC (rev 12082)
@@ -51,7 +51,7 @@
   pthread_cond_broadcast(&mc);
   pthread_mutex_unlock(&m);
 
-  signal(sig,SIG_IGN);
+  //signal(sig,SIG_IGN);
   if(sig!=SIGINT)
     fprintf(stderr,
             "\nTrapped signal %d; exiting!\n",sig);

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2006-11-11 01:39:32 UTC (rev 12081)
+++ trunk/sushivision/panel-2d.c	2006-11-11 02:35:07 UTC (rev 12082)
@@ -764,6 +764,8 @@
     panel2d_undo_push(p);
     panel2d_undo_suspend(p);
 
+    crosshairs_callback(p);
+
     slider_set_value(p2->x_scale,0,p2->oldbox[0]);
     slider_set_value(p2->x_scale,2,p2->oldbox[1]);
     slider_set_value(p2->y_scale,0,p2->oldbox[2]);
@@ -798,6 +800,11 @@
   sx = p2->x;
   sy = p2->y;
 
+  if(p2->last_line>h){
+    gdk_threads_leave ();
+    return 0;
+  }
+
   if(p2->last_line==h){
     p2->last_line++;
     gdk_threads_leave ();
@@ -998,12 +1005,15 @@
   }
 
   for(i=0;i<p->dimensions;i++){
-    if(slider_get_value(p2->dim_scales[i],0)!=u->dim_vals[0][i] ||
-       slider_get_value(p2->dim_scales[i],1)!=u->dim_vals[1][i] ||
+    /*if(slider_get_value(p2->dim_scales[i],0)!=u->dim_vals[0][i] ||
        slider_get_value(p2->dim_scales[i],2)!=u->dim_vals[2][i]){
       if(i==u->x_d || i==u->y_d)
 	recomp_flag=1;
     }
+    if(slider_get_value(p2->dim_scales[i],0)!=u->dim_vals[1][i]){
+      if(i!=u->x_d && i!=u->y_d)
+	recomp_flag=1;
+	}*/
     slider_set_value(p2->dim_scales[i],0,u->dim_vals[0][i]);
     slider_set_value(p2->dim_scales[i],1,u->dim_vals[1][i]);
     slider_set_value(p2->dim_scales[i],2,u->dim_vals[2][i]);
@@ -1135,21 +1145,21 @@
 	      }
 	    }
 	  }
+	}
+	 
+	count = inner_count;
+	if(count>p2->peak_count){
+	  int y = best_j/w;
+	  int x = best_j - y*w;
+	  double xv = scalespace_value(&p2->x,x);
+	  double yv = scalespace_value(&p2->y,h-y);
 	  
-	  count = inner_count;
-	  if(count>p2->peak_count){
-	    int y = best_j/w;
-	    int x = best_j - y*w;
-	    double xv = scalespace_value(&p2->x,x);
-	    double yv = scalespace_value(&p2->y,h-y);
-	    
-	    plot_set_crosshairs(plot,xv,yv);
-	    crosshairs_callback(p);
-	    
-	    p2->peak_count++;
-	    
-	    return;
-	  }
+	  plot_set_crosshairs(plot,xv,yv);
+	  crosshairs_callback(p);
+	  
+	  p2->peak_count++;
+	  
+	  return;
 	}
       }
     }

Modified: trunk/sushivision/panel-2d.h
===================================================================
--- trunk/sushivision/panel-2d.h	2006-11-11 01:39:32 UTC (rev 12081)
+++ trunk/sushivision/panel-2d.h	2006-11-11 02:35:07 UTC (rev 12082)
@@ -73,6 +73,7 @@
   int undo_level;
   int undo_suspend;
 
+  int peak_count;
 } sushiv_panel2d_t;
 
 extern void _sushiv_realize_panel2d(sushiv_panel_t *p);

Modified: trunk/sushivision/plot.c
===================================================================
--- trunk/sushivision/plot.c	2006-11-11 01:39:32 UTC (rev 12081)
+++ trunk/sushivision/plot.c	2006-11-11 02:35:07 UTC (rev 12082)
@@ -490,7 +490,7 @@
   int x = event->x;
   int y = event->y;
   int bx = scalespace_pixel(&p->x,p->box_x1);
-  int by = scalespace_pixel(&p->y,p->box_y1);
+  int by = widget->allocation.height-scalespace_pixel(&p->y,p->box_y1);
 
   if(p->button_down){
     if(abs(bx - x)>5 ||
@@ -526,8 +526,6 @@
     p->sely = scalespace_value(&p->y,widget->allocation.height-event->y);
     p->cross_active=1;
 
-    if(p->crosshairs_callback)
-      p->crosshairs_callback(p->cross_data);
     if(p->box_callback)
       p->box_callback(p->cross_data,1);
 

Modified: trunk/sushivision/slice.c
===================================================================
--- trunk/sushivision/slice.c	2006-11-11 01:39:32 UTC (rev 12081)
+++ trunk/sushivision/slice.c	2006-11-11 02:35:07 UTC (rev 12082)
@@ -248,10 +248,12 @@
 
 void slice_thumb_set(Slice *s,double v){
   GtkWidget *w=GTK_WIDGET(s);
-
-  s->thumb_val=v;
-  slider_vals_bound(s->slider,s->slicenum);
   
-  if(s->callback)s->callback(s->callback_data,5);
-  draw_and_expose(w);
+  if(s->thumb_val != v){
+    s->thumb_val=v;
+    slider_vals_bound(s->slider,s->slicenum);
+    
+    if(s->callback)s->callback(s->callback_data,5);
+    draw_and_expose(w);
+  }
 }



More information about the commits mailing list