[xiph-commits] r12481 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Fri Feb 16 00:34:48 PST 2007


Author: xiphmont
Date: 2007-02-16 00:34:46 -0800 (Fri, 16 Feb 2007)
New Revision: 12481

Modified:
   trunk/sushivision/example_fractal.c
   trunk/sushivision/spinner.c
   trunk/sushivision/spinner.h
Log:
Previous timer fix had its own bug.  Such pedestrian irony.



Modified: trunk/sushivision/example_fractal.c
===================================================================
--- trunk/sushivision/example_fractal.c	2007-02-16 08:21:23 UTC (rev 12480)
+++ trunk/sushivision/example_fractal.c	2007-02-16 08:34:46 UTC (rev 12481)
@@ -54,12 +54,12 @@
 
   s=sushiv_new_instance();
 
-  sushiv_new_dimension(s,0,"Re(c)",
+  sushiv_new_dimension_discrete(s,0,"Re(c)",
 		       5,(double []){-2.25,-0.75,0,0.25,0.75},
-		       NULL,0);
-  sushiv_new_dimension(s,1,"Im(c)",
+				NULL,1,1000,0);
+  sushiv_new_dimension_discrete(s,1,"Im(c)",
 		       5,(double []){-2,-1,0,1,2},
-		       NULL,0);
+				NULL,1,1000,0);
 
   sushiv_new_dimension(s,2,"Re(z0)",
 		       5,(double []){-2.25,-1,0,1,2.25},

Modified: trunk/sushivision/spinner.c
===================================================================
--- trunk/sushivision/spinner.c	2007-02-16 08:21:23 UTC (rev 12480)
+++ trunk/sushivision/spinner.c	2007-02-16 08:34:46 UTC (rev 12481)
@@ -235,18 +235,18 @@
   
   if(!p->busy){
     p->busy=1;
-    p->begin_s = now.tv_sec;
+    p->last = now;
     spinner_expose(GTK_WIDGET(p),NULL); // do it now
   }else{
     
-    test = (now.tv_sec - p->begin_s)*1000 + now.tv_usec/1000;
-    if(p->last_busy_throttle + 100 < test) {
+    test = (now.tv_sec - p->last.tv_sec)*1000 + (now.tv_usec - p->last.tv_usec)/1000;
+    if(test>100) {
 
       p->busy_count++;
       
       if(p->busy_count>7)
 	p->busy_count=0;
-      p->last_busy_throttle = test;
+      p->last = now;
       spinner_expose(GTK_WIDGET(p),NULL); // do it now
     }
   }

Modified: trunk/sushivision/spinner.h
===================================================================
--- trunk/sushivision/spinner.h	2007-02-16 08:21:23 UTC (rev 12480)
+++ trunk/sushivision/spinner.h	2007-02-16 08:34:46 UTC (rev 12481)
@@ -44,8 +44,7 @@
 
   int busy;
   int busy_count;
-  int last_busy_throttle;
-  time_t begin_s;
+  struct timeval last;
 };
 
 struct _SpinnerClass{



More information about the commits mailing list