
	/*
	** This program converts one of Yujie's GT files into the cafeteria
	** format.  Yujie's format was index bite-type, where bite-type=1
	** was food bite and bite-type=2 was drink bite, and the index was
	** at 60 Hz.
	*/

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])

{
FILE	*fpt;
int	i,total_bites,type,index;
int	last_index;

if (argc != 2)
  {
  printf("Usage:  conv-gt [filename]\n");
  exit(0);
  }
if ((fpt=fopen(argv[1],"r")) == NULL)
  {
  printf("Unable to open %s for reading\n",argv[1]);
  exit(0);
  }
total_bites=1;
last_index=-1;
while (1)
  {
  i=fscanf(fpt,"%d %d",&index,&type);
  if (i != 2)
    break;
  if (0) // index < last_index)
    { printf("%s\n",argv[1]); break; }
  last_index=index;
  if (1)
    printf("%d\t%d\tright\thand\tplate\tunknown\n",total_bites,index/4);
  total_bites++;
  }
fclose(fpt);


}
