/* program to test blocking and non-blocking combinations
   for both image display and motion
*/

#include "MyroC.h"
#include <unistd.h>
#include <stdio.h>

int main ()
{
  printf ("Test of blocking and non-blocking for image display and motion\n");
  rConnect ("/dev/tty.Fluke2-091B-Fluke2");

  printf ("loading four pictures\n");
  Picture pic1 = rLoadPicture ("one.jpg");
  Picture pic2 = rLoadPicture ("two.jpg");
  Picture pic3 = rLoadPicture ("three.jpg");
  Picture pic4 = rLoadPicture ("four.jpg");

  printf ("starting forward motion\n");
  rFastForward (-6);

  printf ("displaying images\n");
  rDisplayPicture (&pic1, -6.0, "6 seconds, non-blocking"); 
  rDisplayPicture (&pic2, -8.0, "8 seconds, non-blocking"); 
  rDisplayPicture (&pic3,  3.0, "3 seconds, blocking"); 
  rDisplayPicture (&pic4,  1.0, "1 seconds, blocking"); 

  printf ("sleeping 10 seconds\n");
  sleep (10);
  printf ("end of test\n");

  rDisconnect ();

  return 0;
}
