main class for communication with the EyeLogic server More...
#include "ELApi.h"
Classes | |
struct | DeviceConfig |
Device configuration. More... | |
struct | DeviceGeometry |
Geometric position of the device related to the active monitor. More... | |
class | ELEventCallback |
Callback interface for events related to the eye tracker. More... | |
class | ELGazeSampleCallback |
Callback interface for GazeSamples. More... | |
struct | ELValidationPointResult |
ValidationPointResult holds the results of the validation ( total deviation between true point position and calculated POR of the left and right eye POR in [px] and [deg] ) of the validation point at position ( validationPointPxX, validationPointPxY ) [px]. More... | |
struct | ELValidationResult |
ValidationResult contains one ValidationPointResult struct per validation stimulus point of the performed valdation. More... | |
struct | ScreenConfig |
Screen configuration. More... | |
struct | ServerInfo |
connection information for an EyeLogic server More... | |
Public Types | |
enum | Event { SCREEN_CHANGED, CONNECTION_CLOSED, DEVICE_CONNECTED, DEVICE_DISCONNECTED, TRACKING_STOPPED } |
eye tracking event More... | |
enum | ReturnConnect { SUCCESS, FAILURE, VERSION_MISMATCH } |
return values of connect( ) More... | |
enum | ReturnSetActiveScreen { SUCCESS, NOT_FOUND, FAILURE } |
return values of setActiveScreen( ) More... | |
enum | ReturnNextData { SUCCESS, SUCCESS, SUCCESS, TIMEOUT, CONNECTION_CLOSED, CONNECTION_CLOSED } |
Return values of the getNextEvent/getNextGazeSample functions. More... | |
enum | ReturnStart { SUCCESS, NOT_CONNECTED, DEVICE_MISSING, INVALID_FRAMERATE_MODE, ALREADY_RUNNING_DIFFERENT_FRAMERATE, FAILURE } |
return values of requestTracking( ) More... | |
enum | ReturnCalibrate { SUCCESS, NOT_CONNECTED, NOT_TRACKING, INVALID_CALIBRATION_MODE, ALREADY_BUSY, FAILURE } |
return values of calibrate( ) More... | |
enum | ReturnValidate { SUCCESS, NOT_CONNECTED, NOT_TRACKING, NOT_CALIBRATED, ALREADY_BUSY, FAILURE } |
return values of validate( ) More... | |
Public Member Functions | |
EL_EXPORT STDCALL | ELApi (const char *clientName) |
constructor More... | |
EL_EXPORT STDCALL | ~ELApi () |
destructor | |
ELApi (const ELApi &)=delete | |
ELApi & | operator= (const ELApi &)=delete |
ELApi (ELApi &&)=delete | |
ELApi & | operator= (ELApi &&)=delete |
EL_EXPORT void STDCALL | registerEventListener (ELEventCallback *callback) |
Registers the event listener. An existing listener will be overwritten. More... | |
EL_EXPORT void STDCALL | registerGazeSampleListener (ELGazeSampleCallback *callback) |
Registers the gaze sample listener. An existing listener will be overwritten. More... | |
EL_EXPORT ReturnConnect STDCALL | connect () |
initialize connection to the server (method is blocking until connection established). The connection is only established for a local server (running on this machine). For connections to a remote server, More... | |
EL_EXPORT ReturnConnect STDCALL | connectRemote (ServerInfo server) |
initialize connection to a remote server (method is blocking until connection established) More... | |
EL_EXPORT int32_t STDCALL | requestServerList (int32_t blockingDurationMS, ServerInfo *serverList, int32_t serverListLength) |
Ping all running EyeLogic servers in the local network and wait some time for their response. More... | |
EL_EXPORT void STDCALL | disconnect () |
closes connection to the server | |
EL_EXPORT bool STDCALL | isConnected () const |
whether a connection to the server is established | |
EL_EXPORT void STDCALL | getActiveScreen (ScreenConfig &screenConfig) const |
obtain configuration of active screen | |
EL_EXPORT int32_t STDCALL | getAvailableScreens (ScreenConfig *screenConfig, int32_t numScreenConfigs) const |
Get a list of screens connected to the local machine. If there are more screens than 'numScreenConfigs' found, then only the first 'numScreenConfigs' ones are filled. More... | |
EL_EXPORT ReturnSetActiveScreen STDCALL | setActiveScreen (const char *screenID, DeviceGeometry deviceGeometry) |
Make a screen connected to this machine to the active screen. More... | |
EL_EXPORT void STDCALL | getDeviceConfig (DeviceConfig &deviceConfig) const |
obtain configuration of active device | |
EL_EXPORT ReturnNextData STDCALL | getNextEvent (Event &event, int32_t timeoutMillis) |
Obtains the next unread event or blocks until a new event occurs or the given timeout is reached. More... | |
EL_EXPORT ReturnNextData STDCALL | getNextGazeSample (ELGazeSample &gazeSample, int32_t timeoutMillis) |
Obtains the next unread gazeSample or blocks until a new GazeSample is received or the given timeout is reached. More... | |
EL_EXPORT ReturnStart STDCALL | requestTracking (int32_t frameRateModeInd) |
request tracking More... | |
EL_EXPORT void STDCALL | unrequestTracking () |
unrequest tracking More... | |
EL_EXPORT ReturnCalibrate STDCALL | calibrate (int32_t calibrationModeInd) |
perform calibration (method is blocking until calibration finished) More... | |
EL_EXPORT void STDCALL | abortCalibValidation () |
abort a running calibration | |
EL_EXPORT ReturnValidate STDCALL | validate (ELValidationResult &validationResult) |
perform validation (method is blocking until validation finished) More... | |
main class for communication with the EyeLogic server
|
strong |
|
strong |
return values of calibrate( )
|
strong |
return values of connect( )
enum ReturnNextData |
Return values of the getNextEvent/getNextGazeSample functions.
|
strong |
return values of setActiveScreen( )
Enumerator | |
---|---|
SUCCESS | active screen was set |
NOT_FOUND | specified screen name was not found as a name of an available monitor |
FAILURE | active screen could not be changed |
|
strong |
return values of requestTracking( )
|
strong |
return values of validate( )
EL_EXPORT STDCALL ELApi | ( | const char * | clientName | ) |
constructor
clientName | string identifier of the client (shown in the server tool window), may be null |
EL_EXPORT ReturnCalibrate STDCALL calibrate | ( | int32_t | calibrationModeInd | ) |
perform calibration (method is blocking until calibration finished)
calibrationModeInd | index of the requested calibration method (0 ... #calibrationMethods-1) |
EL_EXPORT ReturnConnect STDCALL connect | ( | ) |
initialize connection to the server (method is blocking until connection established). The connection is only established for a local server (running on this machine). For connections to a remote server,
EL_EXPORT ReturnConnect STDCALL connectRemote | ( | ServerInfo | server | ) |
initialize connection to a remote server (method is blocking until connection established)
server | Server to connect to |
EL_EXPORT int32_t STDCALL getAvailableScreens | ( | ScreenConfig * | screenConfig, |
int32_t | numScreenConfigs | ||
) | const |
Get a list of screens connected to the local machine. If there are more screens than 'numScreenConfigs' found, then only the first 'numScreenConfigs' ones are filled.
screenConfig | pre-allocated array, will be filled with screen configurations |
numScreenConfigs | number of entries of screenConfig |
EL_EXPORT ReturnNextData STDCALL getNextEvent | ( | Event & | event, |
int32_t | timeoutMillis | ||
) |
Obtains the next unread event or blocks until a new event occurs or the given timeout is reached.
The last incoming event is buffered internally and can be obtained by calling this method in a consecutive order. If there is no new event, the method blocks until an event occurs or the given timeout is reached. The method returns SUCCESS if and only if a new event is provided which was not returned before. Therefore, by checking the return value, you can assure to not handle any event twice.
If you want to catch events in a loop, be careful to not wait too long between the calls to this method. Otherwise, you may miss events. If you want to be 100% sure to not miss any event, consider to use the ELEventCallback mechanism.
event | If this method returns SUCCESS, this data structure is filled with the new (yet unhandled) event. In all other cases, this data structure is filled with the event which was returned last. |
timeoutMillis | duration in milliseconds, method returns at the latest after this time. May be 0 if the method should return immediatly. |
EL_EXPORT ReturnNextData STDCALL getNextGazeSample | ( | ELGazeSample & | gazeSample, |
int32_t | timeoutMillis | ||
) |
Obtains the next unread gazeSample or blocks until a new GazeSample is received or the given timeout is reached.
The last incoming GazeSample is buffered internally and can be obtained by calling this method in a consecutive order. If there is no new GazeSample, the method blocks until a GazeSample arrives or the given timeout is reached. The method returns SUCCESS if and only if a new GazeSample is provided which was not returned before. Therefore, by checking the return value, you can assure to not handle any GazeSample twice.
If you want to catch GazeSamples in a loop, be careful to not wait too long between the calls to this method (at least once per frame). Otherwise, you may miss GazeSamples. If you want to be 100% sure to not miss any GazeSample, consider to use the ELGazeSampleCallback mechanism.
gazeSample | If this method returns SUCCESS, this data structure is filled with the new (yet unhandled) GazeSample. In all other cases, this data structure is filled with the GazeSample which was returned last. |
timeoutMillis | duration in milliseconds, method returns at the latest after this time. May be 0 if the method should return immediatly. |
EL_EXPORT void STDCALL registerEventListener | ( | ELEventCallback * | callback | ) |
Registers the event listener. An existing listener will be overwritten.
callback | this instance will be notified of all events published by the ELApi. If null, the current callback is removed/unregistered. Ensure that the listener is unregistered before its destruction. |
EL_EXPORT void STDCALL registerGazeSampleListener | ( | ELGazeSampleCallback * | callback | ) |
Registers the gaze sample listener. An existing listener will be overwritten.
callback | this instance will be notified of all gaze samples published by the ELApi. If null, the current callback is removed/unregistered. Ensure that the listener is unregistered before its destruction. |
EL_EXPORT int32_t STDCALL requestServerList | ( | int32_t | blockingDurationMS, |
ServerInfo * | serverList, | ||
int32_t | serverListLength | ||
) |
Ping all running EyeLogic servers in the local network and wait some time for their response.
blockingDurationMS | waiting duration in milliseconds. Method returns after this time, or if 'serverListLength' many servers responded. |
serverList | pre-allocated array of length 'serverListLength'. Will be filled with responding EyeLogic servers. |
serverListLength | Lenght of pre-allocated serverList array |
EL_EXPORT ReturnStart STDCALL requestTracking | ( | int32_t | frameRateModeInd | ) |
request tracking
If tracking is not yet ongoing, tracking is started in the device. If tracking is already running (e.g. started from another client) with the same frame-rate as requested, all gaze samples are reported to this client as well.
frameRateModeInd | index of the requested frame rate mode (0 ... #frameRateModes-1) |
EL_EXPORT ReturnSetActiveScreen STDCALL setActiveScreen | ( | const char * | screenID, |
DeviceGeometry | deviceGeometry | ||
) |
Make a screen connected to this machine to the active screen.
Recording is from now on performed on the new active screen. Remember to perform a calibration on the new screen, otherwise it remains in an uncalibrated state.
screenID | ID of the new active screen on this machine (even works if the connection to the server is remote). If null, the primary screen of this machine is set as active. |
deviceGeometry | Geometry of the device which is mounted to the screen. |
EL_EXPORT void STDCALL unrequestTracking | ( | ) |
unrequest tracking
Note that the tracking device may continue if other processes still request tracking. Check the EyeLogic server window to observe the actual state.
EL_EXPORT ReturnValidate STDCALL validate | ( | ELValidationResult & | validationResult | ) |
perform validation (method is blocking until validation finished)
validationResult | upon ReturnValidate::SUCCESS this struct will be filled with the validation results - may contain ELInvalidValues. Contains all ELInvalidValues for all other return values. |