[xiph-commits] r17687 - trunk/squishyball

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Nov 29 13:04:02 PST 2010


Author: xiphmont
Date: 2010-11-29 13:04:02 -0800 (Mon, 29 Nov 2010)
New Revision: 17687

Modified:
   trunk/squishyball/main.c
   trunk/squishyball/tty.c
Log:
Fix backspace
fix rounding of make_time_string
add -g, but doesn't do anything yet.



Modified: trunk/squishyball/main.c
===================================================================
--- trunk/squishyball/main.c	2010-11-29 16:58:33 UTC (rev 17686)
+++ trunk/squishyball/main.c	2010-11-29 21:04:02 UTC (rev 17687)
@@ -47,7 +47,7 @@
 #define MAXFILES 10
 int sb_verbose=0;
 
-char *short_options="abcd:De:hn:rRs:tvVxBMS";
+char *short_options="abcd:De:hn:rRs:tvVxBMSg";
 
 struct option long_options[] = {
   {"ab",no_argument,0,'a'},
@@ -57,6 +57,8 @@
   {"device",required_argument,0,'d'},
   {"force-dither",no_argument,0,'D'},
   {"end-time",no_argument,0,'e'},
+  {"gabbagabbahey",no_argument,0,'g'},
+  {"score-display",no_argument,0,'g'},
   {"help",no_argument,0,'h'},
   {"mark-flip",no_argument,0,'M'},
   {"trials",required_argument,0,'n'},
@@ -97,6 +99,10 @@
           "                           a dithered by default during down-\n"
           "                           conversion.\n"
           "  -e --end-time <time>   : Set sample end time for playback\n"
+          "  -g --gabbagabbahey     : Display a running trials score along\n"
+          "                           with indicating if each trial choice\n"
+          "                           was correct or incorrect.  Disables\n"
+          "                           undo/redo.\n"
           "  -h --help              : Print this usage information.\n"
           "  -M --mark-flip         : Mark transitions between samples with\n"
           "                           a short period of silence\n"
@@ -330,6 +336,7 @@
   char sample_list[MAXTRIALS];
   int  tests_cursor=0;
   int  tests_total=0;
+  int  running_score=0;
 
   /* parse options */
 
@@ -407,12 +414,20 @@
     case 'V':
       fprintf(stdout,"%s\n",VERSION);
       exit(0);
+    case 'g':
+      running_score=1;
+      break;
     default:
       usage(stderr);
       exit(1);
     }
   }
 
+  if(running_score && test_mode==3){
+    fprintf(stderr,"-g is meaningless in casual comparison mode.\n");
+    exit(1);
+  }
+
   /* Verify stdin is a tty! */
 
   test_files=argc-optind;
@@ -703,7 +718,7 @@
           do_seek=1;
           break;
         case KEY_BACKSPACE:
-          seek_to=start_pos;
+          seek_to=start_pos-current_pos;
           do_seek=1;
           break;
         case 'f':

Modified: trunk/squishyball/tty.c
===================================================================
--- trunk/squishyball/tty.c	2010-11-29 16:58:33 UTC (rev 17686)
+++ trunk/squishyball/tty.c	2010-11-29 21:04:02 UTC (rev 17687)
@@ -41,7 +41,8 @@
 static pcm_t **pcm_p;
 
 static char timebuffer[80];
-char *make_time_string(double s,int pad){
+char *make_time_string(double is,int pad){
+  double s=is+1e-6f;
   long hrs=s/60/60;
   long min=s/60-hrs*60;
   long sec=s-hrs*60*60-min*60;



More information about the commits mailing list