-
Notifications
You must be signed in to change notification settings - Fork 0
/
edk.h
1141 lines (866 loc) · 35.1 KB
/
edk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Emotiv Development Kit (EDK) API
* Copyright (c) 2009 Emotiv Systems, Inc.
*
* The main interface that allows interactions between external programs and the Emotiv detection engine.
*
* None of the API functions are thread-safe.
*
* This header file is designed to be includable under C and C++ environment.
*
*/
#ifndef EDK_H
#define EDK_H
#include <string>
#include <sstream>
#include "edkErrorCode.h"
#include "EmoStateDLL.h"
#ifndef EDK_STATIC_LIB
#ifdef EDK_EXPORTS
#ifdef _WIN32
#define EDK_API __declspec(dllexport)
#else
#define EDK_API
#endif
#else
#ifdef _WIN32
#define EDK_API __declspec(dllimport)
#else
#define EDK_API
#endif
#endif
#else
#define EDK_API extern
#endif
extern "C"
{
//! Expressiv Suite threshold type enumerator
typedef enum EE_ExpressivThreshold_enum {
EXP_SENSITIVITY
} EE_ExpressivThreshold_t;
//! Expressiv Suite training control enumerator
typedef enum EE_ExpressivTrainingControl_enum {
EXP_NONE = 0, EXP_START, EXP_ACCEPT, EXP_REJECT, EXP_ERASE, EXP_RESET
} EE_ExpressivTrainingControl_t;
//! Expressiv Suite signature type enumerator
typedef enum EE_ExpressivSignature_enum {
EXP_SIG_UNIVERSAL = 0, EXP_SIG_TRAINED
} EE_ExpressivSignature_t;
//! Cognitiv Suite training control enumerator
typedef enum EE_CognitivTrainingControl_enum {
COG_NONE = 0, COG_START, COG_ACCEPT, COG_REJECT, COG_ERASE, COG_RESET
} EE_CognitivTrainingControl_t;
//! Handle to internal EmoState structure allocated by EE_EmoStateCreate()
typedef void* EmoStateHandle;
//! Handle to internal event structure allocated by EE_EmoEngineEventCreate()
typedef void* EmoEngineEventHandle;
//! Handle to internal event structure allocated by EE_OptimizationParamCreate()
typedef void* OptimizationParamHandle;
typedef void* DataHandle;
//! EmoEngine event types
typedef enum EE_Event_enum {
EE_UnknownEvent = 0x0000,
EE_EmulatorError = 0x0001,
EE_ReservedEvent = 0x0002,
EE_UserAdded = 0x0010,
EE_UserRemoved = 0x0020,
EE_EmoStateUpdated = 0x0040,
EE_ProfileEvent = 0x0080,
EE_CognitivEvent = 0x0100,
EE_ExpressivEvent = 0x0200,
EE_InternalStateChanged = 0x0400,
EE_AllEvent = EE_UserAdded | EE_UserRemoved | EE_EmoStateUpdated | EE_ProfileEvent |
EE_CognitivEvent | EE_ExpressivEvent | EE_InternalStateChanged
} EE_Event_t;
//! Expressiv-specific event types
typedef enum EE_ExpressivEvent_enum {
EE_ExpressivNoEvent = 0, EE_ExpressivTrainingStarted, EE_ExpressivTrainingSucceeded,
EE_ExpressivTrainingFailed, EE_ExpressivTrainingCompleted, EE_ExpressivTrainingDataErased,
EE_ExpressivTrainingRejected, EE_ExpressivTrainingReset
} EE_ExpressivEvent_t;
//! Cognitiv-specific event types
typedef enum EE_CognitivEvent_enum {
EE_CognitivNoEvent = 0, EE_CognitivTrainingStarted, EE_CognitivTrainingSucceeded,
EE_CognitivTrainingFailed, EE_CognitivTrainingCompleted, EE_CognitivTrainingDataErased,
EE_CognitivTrainingRejected, EE_CognitivTrainingReset,
EE_CognitivAutoSamplingNeutralCompleted, EE_CognitivSignatureUpdated
} EE_CognitivEvent_t;
typedef enum EE_DataChannels_enum {
ED_COUNTER = 0, ED_INTERPOLATED, ED_RAW_CQ,
ED_AF3, ED_F7, ED_F3, ED_FC5, ED_T7,
ED_P7, ED_O1, ED_O2, ED_P8, ED_T8,
ED_FC6, ED_F4, ED_F8, ED_AF4, ED_GYROX,
ED_GYROY, ED_TIMESTAMP, ED_ES_TIMESTAMP, ED_FUNC_ID, ED_FUNC_VALUE, ED_MARKER,
ED_SYNC_SIGNAL
} EE_DataChannel_t;
//! Input sensor description
typedef struct InputSensorDescriptor_struct {
EE_InputChannels_t channelId; // logical channel id
int fExists; // does this sensor exist on this headset model
const char* pszLabel; // text label identifying this sensor
double xLoc; // x coordinate from center of head towards nose
double yLoc; // y coordinate from center of head towards ears
double zLoc; // z coordinate from center of head toward top of skull
} InputSensorDescriptor_t;
//! Initializes the connection to EmoEngine. This function should be called at the beginning of programs that make use of EmoEngine, most probably in initialization routine or constructor.
/*!
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if a connection is established
\sa edkErrorCode.h
*/
EDK_API int
EE_EngineConnect(const char* strDevID = "Emotiv Systems-5");
//! Initializes the connection to a remote instance of EmoEngine.
/*!
Blocking call
\param szHost - A null-terminated string identifying the hostname or IP address of the remote EmoEngine server
\param port - The port number of the remote EmoEngine server
- If connecting to the Emotiv Control Panel, use port 3008
- If connecting to the EmoComposer, use port 1726
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if a connection is established
\sa edkErrorCode.h
*/
EDK_API int
EE_EngineRemoteConnect(const char* szHost, unsigned short port, const char* strDevID = "Emotiv Systems-5");
//! Terminates the connection to EmoEngine. This function should be called at the end of programs which make use of EmoEngine, most probably in clean up routine or destructor.
/*!
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if disconnection is achieved
\sa edkErrorCode.h
*/
EDK_API int
EE_EngineDisconnect();
//! Controls the output of logging information from EmoEngine (which is off by default). This should only be enabled if instructed to do so by Emotiv developer support for the purposes of collecting diagnostic information.
/*!
\param szFilename - The path of the logfile
\param fEnable - If non-zero, then diagnostic information will be written to logfile.
- If zero, then all diagnostic information is suppressed (default).
\param nReserved - Reserved for future use.
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if the command succeeded
*/
EDK_API int
EE_EnableDiagnostics(const char* szFilename, int fEnable, int nReserved);
//! Returns a handle to memory that can hold an EmoEngine event. This handle can be reused by the caller to retrieve subsequent events.
/*!
\return EmoEngineEventHandle
*/
EDK_API EmoEngineEventHandle
EE_EmoEngineEventCreate();
//! Returns a handle to memory that can hold a profile byte stream. This handle can be reused by the caller to retrieve subsequent profile bytes.
/*!
\return EmoEngineEventHandle
*/
EDK_API EmoEngineEventHandle
EE_ProfileEventCreate();
//! Frees memory referenced by an event handle.
/*!
\param hEvent - a handle returned by EE_EmoEngineEventCreate() or EE_ProfileEventCreate()
*/
EDK_API void
EE_EmoEngineEventFree(EmoEngineEventHandle hEvent);
//! Returns a handle to memory that can store an EmoState. This handle can be reused by the caller to retrieve subsequent EmoStates.
/*!
\return EmoStateHandle
*/
EDK_API EmoStateHandle
EE_EmoStateCreate();
//! Frees memory referenced by an EmoState handle.
/*!
\param hState - a handle returned by EE_EmoStateCreate()
*/
EDK_API void
EE_EmoStateFree(EmoStateHandle hState);
//! Returns the event type for an event already retrieved using EE_EngineGetNextEvent.
/*!
\param hEvent - a handle returned by EE_EmoEngineEventCreate()
\return EE_Event_t
*/
EDK_API EE_Event_t
EE_EmoEngineEventGetType(EmoEngineEventHandle hEvent);
//! Returns the Cognitiv-specific event type for an EE_CognitivEvent event already retrieved using EE_EngineGetNextEvent.
/*!
\param hEvent - a handle returned by EE_EmoEngineEventCreate()
\return EE_CognitivEvent_t
*/
EDK_API EE_CognitivEvent_t
EE_CognitivEventGetType(EmoEngineEventHandle hEvent);
//! Returns the Expressiv-specific event type for an EE_ExpressivEvent event already retrieved using EE_EngineGetNextEvent.
/*!
\param hEvent - a handle returned by EE_EmoEngineEventCreate()
\return EE_ExpressivEvent_t
*/
EDK_API EE_ExpressivEvent_t
EE_ExpressivEventGetType(EmoEngineEventHandle hEvent);
//! Retrieves the user ID for EE_UserAdded and EE_UserRemoved events.
/*!
\param hEvent - a handle returned by EE_EmoEngineEventCreate()
\param pUserIdOut - receives the user ID associated with the current event
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful.
\sa edkErrorCode.h
*/
EDK_API int
EE_EmoEngineEventGetUserId(EmoEngineEventHandle hEvent, unsigned int *pUserIdOut);
//! Copies an EmoState returned with a EE_EmoStateUpdate event to memory referenced by an EmoStateHandle.
/*!
\param hEvent - a handle returned by EE_EmoEngineEventCreate() and populated with EE_EmoEngineGetNextEvent()
\param hEmoState - a handle returned by EE_EmoStateCreate
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful.
\sa edkErrorCode.h
*/
EDK_API int
EE_EmoEngineEventGetEmoState(EmoEngineEventHandle hEvent, EmoStateHandle hEmoState);
//! Retrieves the next EmoEngine event
/*!
Non-blocking call
\param hEvent - a handle returned by EE_EmoEngineEventCreate()
\return EDK_ERROR_CODE
<ul>
<li> EDK_ERROR_CODE = EDK_OK if a new event has been retrieved
<li> EDK_ERROR_CODE = EDK_NO_EVENT if no new events have been generated by EmoEngine
</ul>
\sa edkErrorCode.h
*/
EDK_API int
EE_EngineGetNextEvent(EmoEngineEventHandle hEvent);
//! Clear a specific EmoEngine event type or all events currently inside the event queue. Event flags can be combined together as one argument except EE_UnknownEvent and EE_EmulatorError.
/*!
\param eventTypes - EmoEngine event type (EE_Event_t), multiple events can be combined such as (EE_UserAdded | EE_UserRemoved)
\return EDK_ERROR_CODE
<ul>
<li> EDK_ERROR_CODE = EDK_OK if the events have been cleared from the queue
<li> EDK_ERROR_CODE = EDK_INVALID_PARAMETER if input event types are invalid
</ul>
\sa EE_Event_t, edkErrorCode.h
*/
EDK_API int
EE_EngineClearEventQueue(int eventTypes);
//! Retrieves number of active users connected to the EmoEngine.
/*!
\param pNumUserOut - receives number of users
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful.
\sa edkErrorCode.h
*/
EDK_API int
EE_EngineGetNumUser(unsigned int* pNumUserOut);
//! Sets the player number displayed on the physical input device (currently the USB Dongle) that corresponds to the specified user
/*!
\param userId - EmoEngine user ID
\param playerNum - application assigned player number displayed on input device hardware (must be in the range 1-4)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_SetHardwarePlayerDisplay(unsigned int userId, unsigned int playerNum);
//! Loads an EmoEngine profile for the specified user.
/*!
\param userId - user ID
\param profileBuffer - pointer to buffer containing a serialized user profile previously returned from EmoEngine.
\param length - buffer size (number of bytes)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE if the function succeeds in loading this profile
\sa edkErrorCode.h
*/
EDK_API int
EE_SetUserProfile(unsigned int userId, const unsigned char profileBuffer[], unsigned int length);
//! Returns user profile data in a synchronous manner.
/*!
Fills in the event referred to by hEvent with an EE_ProfileEvent event
that contains the profile data for the specified user.
\param userId - user ID
\param hEvent - a handle returned by EE_EmoEngineEventCreate()
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_GetUserProfile(unsigned int userId, EmoEngineEventHandle hEvent);
//! Returns a serialized user profile for a default user in a synchronous manner.
/*!
Fills in the event referred to by hEvent with an EE_ProfileEvent event
that contains the profile data for the default user
\param hEvent - a handle returned by EE_EmoEngineEventCreate()
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_GetBaseProfile(EmoEngineEventHandle hEvent);
//! Returns the number of bytes required to store a serialized version of the requested user profile.
/*!
\param hEvt - an EmoEngineEventHandle of type EE_ProfileEvent
\param pProfileSizeOut - receives number of bytes required by the profile
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_GetUserProfileSize(EmoEngineEventHandle hEvt, unsigned int* pProfileSizeOut);
//! Copies a serialized version of the requested user profile into the caller's buffer.
/*!
\param hEvt - an EmoEngineEventHandle returned in a EE_ProfileEvent event
\param destBuffer - pointer to a destination buffer
\param length - the size of the destination buffer in bytes
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_GetUserProfileBytes(EmoEngineEventHandle hEvt, unsigned char destBuffer[], unsigned int length);
//! Loads a user profile from disk and assigns it to the specified user
/*!
\param userID - a valid user ID
\param szInputFilename - platform-dependent filesystem path of saved user profile
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_LoadUserProfile(unsigned int userID, const char* szInputFilename);
//! Saves a user profile for specified user to disk
/*!
\param userID - a valid user ID
\param szOutputFilename - platform-dependent filesystem path for output file
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_SaveUserProfile(unsigned int userID, const char* szOutputFilename);
//! Set threshold for Expressiv algorithms
/*!
\param userId - user ID
\param algoName - Expressiv algorithm type
\param thresholdName - Expressiv threshold type
\param value - threshold value (min: 0 max: 1000)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_ExpressivAlgo_t, EE_ExpressivThreshold_t
*/
EDK_API int
EE_ExpressivSetThreshold(unsigned int userId, EE_ExpressivAlgo_t algoName, EE_ExpressivThreshold_t thresholdName, int value);
//! Get threshold from Expressiv algorithms
/*!
\param userId - user ID
\param algoName - Expressiv algorithm type
\param thresholdName - Expressiv threshold type
\param pValueOut - receives threshold value
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_ExpressivAlgo_t, EE_ExpressivThreshold_t
*/
EDK_API int
EE_ExpressivGetThreshold(unsigned int userId, EE_ExpressivAlgo_t algoName, EE_ExpressivThreshold_t thresholdName, int *pValueOut);
//! Set the current facial expression for Expressiv training
/*!
Blocking call
\param userId - user ID
\param action - which facial expression would like to be trained
\return EDK_ERROR_CODE - current status of EmoEngine. If the query is successful, EDK_ERROR_CODE = OK.
\sa edkErrorCode.h, EE_ExpressivAlgo_t
*/
EDK_API int
EE_ExpressivSetTrainingAction(unsigned int userId, EE_ExpressivAlgo_t action);
//! Set the control flag for Expressiv training
/*!
Blocking call
\param userId - user ID
\param control - pre-defined control command
\return EDK_ERROR_CODE - current status of EmoEngine. If the query is successful, EDK_ERROR_CODE = OK.
\sa edkErrorCode.h, EE_ExpressivTrainingControl_t
*/
EDK_API int
EE_ExpressivSetTrainingControl(unsigned int userId, EE_ExpressivTrainingControl_t control);
//! Gets the facial expression currently selected for Expressiv training
/*!
Blocking call
\param userId - user ID
\param pActionOut - receives facial expression currently selected for training
\return EDK_ERROR_CODE - current status of EmoEngine. If the query is successful, EDK_ERROR_CODE = OK.
\sa EDK_ERROR_CODE, EE_ExpressivAlgo_t
*/
EDK_API int
EE_ExpressivGetTrainingAction(unsigned int userId, EE_ExpressivAlgo_t* pActionOut);
//! Return the duration of a Expressiv training session
/*!
\param userId - user ID
\param pTrainingTimeOut - receive the training time in ms
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_ExpressivGetTrainingTime(unsigned int userId, unsigned int* pTrainingTimeOut);
//! Gets a list of the actions that have been trained by the user
/*!
Blocking call
\param userId - user ID
\param pTrainedActionsOut - receives a bit vector composed of EE_ExpressivAlgo_t contants
\return EDK_ERROR_CODE - current status of EmoEngine. If the query is successful, EDK_ERROR_CODE = OK.
\sa EDK_ERROR_CODE, EE_ExpressivAlgo_t
*/
EDK_API int
EE_ExpressivGetTrainedSignatureActions(unsigned int userId, unsigned long* pTrainedActionsOut);
//! Gets a flag indicating if the user has trained sufficient actions to activate a trained signature
/*!
*pfAvailableOut will be set to 1 if the user has trained EXP_NEUTRAL and at least
one other Expressiv action. Otherwise, *pfAvailableOut == 0.
Blocking call
\param userId - user ID
\param pfAvailableOut - receives an int that is non-zero if a trained signature can be activated
\return EDK_ERROR_CODE - current status of EmoEngine. If the query is successful, EDK_ERROR_CODE = OK.
\sa EDK_ERROR_CODE
*/
EDK_API int
EE_ExpressivGetTrainedSignatureAvailable(unsigned int userId, int* pfAvailableOut);
//! Configures the Expressiv suite to use either the built-in, universal signature or a personal, trained signature
/*!
Note: Expressiv defaults to use its universal signature. This function will fail if EE_ExpressivGetTrainedSignatureAvailable returns false.
Blocking call
\param userId - user ID
\param sigType - signature type to use
\return EDK_ERROR_CODE - current status of EmoEngine. If the query is successful, EDK_ERROR_CODE = OK.
\sa EDK_ERROR_CODE, EE_ExpressivSignature_t
*/
EDK_API int
EE_ExpressivSetSignatureType(unsigned int userId, EE_ExpressivSignature_t sigType);
//! Indicates whether the Expressiv suite is currently using either the built-in, universal signature or a trained signature
/*!
Blocking call
\param userId - user ID
\param pSigTypeOut - receives the signature type currently in use
\return EDK_ERROR_CODE - current status of EmoEngine. If the query is successful, EDK_ERROR_CODE = OK.
\sa EDK_ERROR_CODE, EE_ExpressivSignature_t
*/
EDK_API int
EE_ExpressivGetSignatureType(unsigned int userId, EE_ExpressivSignature_t* pSigTypeOut);
//! Set the current Cognitiv active action types
/*!
\param userId - user ID
\param activeActions - a bit vector composed of EE_CognitivAction_t contants
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_CognitivAction_t
*/
EDK_API int
EE_CognitivSetActiveActions(unsigned int userId, unsigned long activeActions);
//! Get the current Cognitiv active action types
/*!
\param userId - user ID
\param pActiveActionsOut - receive a bit vector composed of EE_CognitivAction_t contants
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_CognitivAction_t
*/
EDK_API int
EE_CognitivGetActiveActions(unsigned int userId, unsigned long* pActiveActionsOut);
//! Return the duration of a Cognitiv training session
/*!
\param userId - user ID
\param pTrainingTimeOut - receive the training time in ms
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivGetTrainingTime(unsigned int userId, unsigned int* pTrainingTimeOut);
//! Set the training control flag for Cognitiv training
/*!
\param userId - user ID
\param control - pre-defined Cognitiv training control
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_CognitivTrainingControl_t
*/
EDK_API int
EE_CognitivSetTrainingControl(unsigned int userId, EE_CognitivTrainingControl_t control);
//! Set the type of Cognitiv action to be trained
/*!
\param userId - user ID
\param action - which action would like to be trained
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_CognitivAction_t
*/
EDK_API int
EE_CognitivSetTrainingAction(unsigned int userId, EE_CognitivAction_t action);
//! Get the type of Cognitiv action currently selected for training
/*!
\param userId - user ID
\param pActionOut - action that is currently selected for training
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_CognitivAction_t
*/
EDK_API int
EE_CognitivGetTrainingAction(unsigned int userId, EE_CognitivAction_t* pActionOut);
//! Gets a list of the Cognitiv actions that have been trained by the user
/*!
Blocking call
\param userId - user ID
\param pTrainedActionsOut - receives a bit vector composed of EE_CognitivAction_t contants
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_CognitivAction_t
*/
EDK_API int
EE_CognitivGetTrainedSignatureActions(unsigned int userId, unsigned long* pTrainedActionsOut);
//! Gets the current overall skill rating of the user in Cognitiv
/*!
Blocking call
\param userId - user ID
\param pOverallSkillRatingOut - receives the overall skill rating [from 0.0 to 1.0]
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivGetOverallSkillRating(unsigned int userId, float* pOverallSkillRatingOut);
//! Gets the current skill rating for particular Cognitiv actions of the user
/*!
Blocking call
\param userId - user ID
\param action - a particular action of EE_CognitivAction_t contant
\param pActionSkillRatingOut - receives the action skill rating [from 0.0 to 1.0]
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h, EE_CognitivAction_t
*/
EDK_API int
EE_CognitivGetActionSkillRating(unsigned int userId, EE_CognitivAction_t action, float* pActionSkillRatingOut);
//! Set the overall sensitivity for all Cognitiv actions
/*!
\param userId - user ID
\param level - sensitivity level of all actions (lowest: 1, highest: 7)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivSetActivationLevel(unsigned int userId, int level);
//! Set the sensitivity of Cognitiv actions
/*!
\param userId - user ID
\param action1Sensitivity - sensitivity of action 1 (min: 1, max: 10)
\param action2Sensitivity - sensitivity of action 2 (min: 1, max: 10)
\param action3Sensitivity - sensitivity of action 3 (min: 1, max: 10)
\param action4Sensitivity - sensitivity of action 4 (min: 1, max: 10)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivSetActionSensitivity(unsigned int userId,
int action1Sensitivity, int action2Sensitivity,
int action3Sensitivity, int action4Sensitivity);
//! Get the overall sensitivity for all Cognitiv actions
/*!
\param userId - user ID
\param pLevelOut - sensitivity level of all actions (min: 1, max: 10)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivGetActivationLevel(unsigned int userId, int *pLevelOut);
//! Query the sensitivity of Cognitiv actions
/*!
\param userId - user ID
\param pAction1SensitivityOut - sensitivity of action 1
\param pAction2SensitivityOut - sensitivity of action 2
\param pAction3SensitivityOut - sensitivity of action 3
\param pAction4SensitivityOut - sensitivity of action 4
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivGetActionSensitivity(unsigned int userId,
int* pAction1SensitivityOut, int* pAction2SensitivityOut,
int* pAction3SensitivityOut, int* pAction4SensitivityOut);
//! Start the sampling of Neutral state in Cognitiv
/*!
\param userId - user ID
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivStartSamplingNeutral(unsigned int userId);
//! Stop the sampling of Neutral state in Cognitiv
/*!
\param userId - user ID
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivStopSamplingNeutral(unsigned int userId);
//! Enable or disable signature caching in Cognitiv
/*!
\param userId - user ID
\param enabled - flag to set status of caching (1: enable, 0: disable)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivSetSignatureCaching(unsigned int userId, unsigned int enabled);
//! Query the status of signature caching in Cognitiv
/*!
\param userId - user ID
\param pEnabledOut - flag to get status of caching (1: enable, 0: disable)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivGetSignatureCaching(unsigned int userId, unsigned int* pEnabledOut);
//! Set the cache size for the signature caching in Cognitiv
/*!
\param userId - user ID
\param size - number of signatures to be kept in the cache (0: unlimited)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivSetSignatureCacheSize(unsigned int userId, unsigned int size);
//! Get the current cache size for the signature caching in Cognitiv
/*!
\param userId - user ID
\param pSizeOut - number of signatures to be kept in the cache (0: unlimited)
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_CognitivGetSignatureCacheSize(unsigned int userId, unsigned int* pSizeOut);
//! Returns a struct containing details about the specified EEG channel's headset
/*!
\param channelId - channel identifier (see EmoStateDll.h)
\param pDescriptorOut - provides detailed sensor location and other info
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa EmoStateDll.h, edkErrorCode.h
*/
EDK_API int
EE_HeadsetGetSensorDetails(EE_InputChannels_t channelId, InputSensorDescriptor_t* pDescriptorOut);
//! Returns the current hardware version of the headset and dongle for a particular user
/*!
\param userId - user ID for query
\param pHwVersionOut - hardware version for the user headset/dongle pair. hiword is headset version, loword is dongle version.
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa EmoStateDll.h, edkErrorCode.h
*/
EDK_API int
EE_HardwareGetVersion(unsigned int userId, unsigned long* pHwVersionOut);
//! Returns the current version of the Emotiv SDK software
/*!
\param pszVersionOut - SDK software version in X.X.X.X format. Note: current beta releases have a major version of 0.
\param nVersionChars - Length of char buffer pointed to by pszVersion argument.
\param pBuildNumOut - Build number. Unique for each release.
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa edkErrorCode.h
*/
EDK_API int
EE_SoftwareGetVersion(char* pszVersionOut, unsigned int nVersionChars, unsigned long* pBuildNumOut);
//! Returns the delta of the movement of the gyro since the previous call for a particular user
/*!
\param userId - user ID for query
\param pXOut - horizontal displacement
\param pYOut - vertical displacment
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa EmoStateDll.h
\sa edkErrorCode.h
*/
EDK_API int
EE_HeadsetGetGyroDelta(unsigned int userId, int* pXOut, int* pYOut);
//! Re-zero the gyro for a particular user
/*!
\param userId - user ID for query
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
\sa EmoStateDll.h
\sa edkErrorCode.h
*/
EDK_API int
EE_HeadsetGyroRezero(unsigned int userId);
//! Returns a handle to memory that can hold an optimization paramaeter which is used to configure the behaviour of optimization
/*!
\return OptimizationParamHandle
*/
EDK_API OptimizationParamHandle
EE_OptimizationParamCreate();
//! Frees memory referenced by an optimization parameter handle
/*!
\param hParam - a handle returned by EE_OptimizationParamCreate()
*/
EDK_API void
EE_OptimizationParamFree(OptimizationParamHandle hParam);
//! Enable optimization. EmoEngine will try to optimize its performance according to the information passed in with optimization parameter. EmoEngine guarantees the correctness of the results of vital algorithms. For algorithms that are not vital, results are undefined.
/*!
\param hParam - a handle returned by EE_OptimizationParamCreate()
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
*/
EDK_API int
EE_OptimizationEnable(OptimizationParamHandle hParam);
//! Determine whether optimization is on
/*!
\param pEnabledOut - receives information about whether optimization is on
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
*/
EDK_API int
EE_OptimizationIsEnabled(bool* pEnabledOut);
//! Disable optimization
/*!
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
*/
EDK_API int
EE_OptimizationDisable();
//! Get optimization parameter. If optimization is not enabled (this can be checked with EE_OptimmizationIsEnabled) then the results attached to the hParam parameter are undefined.
/*!
\param hParam - a handle returned by EE_OptimizationParamCreate()
\return EDK_ERROR_CODE
- EDK_ERROR_CODE = EDK_OK if successful
*/
EDK_API int
EE_OptimizationGetParam(OptimizationParamHandle hParam);
//! Get a list of vital algorithms of specific suite from optimization parameter