示例#1
0
void VideoPlayer::play()
{
    if (isRunning()) return;
    if (pFormatCtx != NULL)
    {
        openSDL();
        start();
        curState = PlayingState;
        emit stateChanged(curState);
    }
}
示例#2
0
// ######################################################################
void EyeTrackerEyeLink::start1()
{
#ifndef HAVE_EYELINK
  LFATAL("Proprietary EyeLink developer API not installed");
#else
  // get the link to the eye-tracker going:
  if (open_eyelink_connection(0))
    LFATAL("Cannot open link to EyeLink tracker - make sure your "
           "hostname resolves to 100.1.1.2 (check /etc/hosts)");

  // Basic initializations:
  set_offline_mode();
  flush_getkey_queue();/* initialize getkey() system */

  // Open EyeLink version of SDL
  openSDL();

  // set the display characteristics: 
  DISPLAYINFO di; // defined in eyelink/core_expt.h
  di.width = itsDims.getVal().w(); di.height = itsDims.getVal().h();
  di.left = 0; di.top = 0; di.right = di.width-1; di.bottom = di.height-1;
  di.bits = 24; di.palsize = 0; di.pages = 0; di.refresh = 60.0F;
  di.winnt = 0;

  set_calibration_colors(&target_foreground_color, &target_background_color);

	// open EDF file if set:
  if (itsEDFfname.getVal().empty() == false)
    {
      if (open_data_file((char *)(itsEDFfname.getVal().c_str())) != 0)
        LFATAL("Cannot open EDF file '%s'", itsEDFfname.getVal().c_str());

      eyecmd_printf(const_cast<char*>("add_file_preamble_text 'RECORDED BY iLab code' "));
    }

  // Add resolution to EDF file:
  eyemsg_printf(const_cast<char*>("DISPLAY_COORDS %ld %ld %ld %ld"),
                di.left, di.top, di.right, di.bottom);

  /* SET UP TRACKER CONFIGURATION */
  /* set parser saccade thresholds (conservative settings) */
  /* 0 = standard sensitivity */
  eyecmd_printf(const_cast<char*>("select_parser_configuration 0"));

  // set EDF file contents:
  eyecmd_printf(const_cast<char*>("file_event_filter = LEFT,RIGHT,FIXATION,SACCADE,"
                                  "BLINK,MESSAGE,BUTTON"));
  eyecmd_printf(const_cast<char*>("file_sample_data = LEFT,RIGHT,GAZE,AREA,GAZERES,STATUS"));

  // set link data (used for gaze cursor):
  eyecmd_printf(const_cast<char*>("link_event_filter = LEFT,RIGHT,FIXATION,FIXUPDATE,SACCADE,BLINK,BUTTON"));
  eyecmd_printf(const_cast<char*>("link_sample_data = LEFT,RIGHT,GAZE,GAZERES,AREA,STATUS"));

  // Program button #5 for use in drift correction:
  eyecmd_printf(const_cast<char*>("button_function 5 'accept_target_fixation'"));
  
	// setup eyelink filtering: default is "1 2"
	eyecmd_printf(const_cast<char*>("heuristic_filter = 1 2"));
	eyelink_wait_for_mode_ready(500);

  // make sure we're still alive:
  if (!eyelink_is_connected() || break_pressed())
    LFATAL("Connection to EyeLink broken or aborted");

  /* TRIAL_VAR_LABELS message is recorded for EyeLink Data Viewer analysis
     It specifies the list of trial variables for the trial
     This should be written once only and put before the recording of
     individual trials */
  eyemsg_printf(const_cast<char*>("TRIAL_VAR_LABELS CONDITION"));

  // Configure EyeLink to send fixation updates every 50 msec:
  //eyecmd_printf("link_event_filter = LEFT,RIGHT,FIXUPDATE");
  //eyecmd_printf("fixation_update_interval = 50");
  //eyecmd_printf("fixation_update_accumulate = 50");

  EyeTracker::start1();
#endif
}