SR Research Support Site
Functions
Playback and data acquisition.

Functions

INT16 eyelink_playback_start (void)
 
INT16 eyelink_playback_stop (void)
 

Detailed Description

Function Documentation

INT16 eyelink_playback_start ( void  )

Flushes data from queue and starts data playback. An EDF file must be open and have at least one recorded trial. Use eyelink_wait_for_data() to wait for data: this will time out if the playback failed. Playback begins from start of file or from just after the end of the next-but-last recording block. Link data is determined by file contents, not by link sample and event settings.

Returns
0 if command sent OK, else link error.

Example:

1 // This program illustrates the use of eyelink_playback_start() and eyelink_playback_stop()
2 // functions for trial data playback. See EYEDATA template for a complete example
3 
4 #include <eyelink.h>
5 #include <stdio.h>
6 
7 set_offline_mode(); // set up eye tracker for playback
8 eyelink_playback_start(); // start data playback
9 
10 // wait for first data to arrive
11 if(!eyelink_wait_for_block_start(2000, 1, 1))
12 {
13  printf("ERROR: playback data did not start!");
14  return -1;
15 }
16 
17 while(1) // Loop while data available
18 {
19  // Exit if ESC, ALT-F4, CTRL-C, or tracker button pressed
20  if(escape_pressed() || break_pressed() ||
21  eyelink_last_button_press(NULL))
22  {
23  eyelink_playback_stop(); // stop playback
24  return 0;
25  }
26 
27  // Process playback data from the link
28  i = eyelink_get_next_data(NULL); // check for new data item
29  if(i==0) // 0: no new data
30  { // Checks if playback has completed
31  if((eyelink_current_mode() & IN_PLAYBACK_MODE)==0) break;
32  }
33  ...
34  // Code for processing data and delay handling here
35  ...
36 }
37 
38 // End of playback loop
39 eyelink_playback_stop();
See also
eyelink_playback_stop() and eyelink_wait_for_block_start()
INT16 eyelink_playback_stop ( void  )

Stops playback if in progress. Flushes any data in queue.

Returns
0 if mode switched, else link error.

Example: See eyelink_playback_start()

See also
eyelink_playback_start() and eyelink_wait_for_block_start()

Copyright ©2002-2024, SR Research Ltd.