|
Emotiv EPOC plugin 1.0
|
00001 00014 #ifndef EDK_H 00015 #define EDK_H 00016 00017 #include "edkErrorCode.h" 00018 #include "EmoStateDLL.h" 00019 00020 00021 #ifndef EDK_STATIC_LIB 00022 00023 #ifdef EDK_EXPORTS 00024 #ifdef _WIN32 00025 #define EDK_API __declspec(dllexport) 00026 #else 00027 #define EDK_API __declspec(dllimport) 00028 #endif 00029 #else 00030 #define EDK_API 00031 #endif 00032 00033 #else 00034 00035 #define EDK_API extern 00036 00037 #endif 00038 00039 00040 extern "C" 00041 { 00043 typedef enum EE_ExpressivThreshold_enum { 00044 EXP_SENSITIVITY 00045 } EE_ExpressivThreshold_t; 00046 00048 typedef enum EE_ExpressivTrainingControl_enum { 00049 EXP_NONE = 0, EXP_START, EXP_ACCEPT, EXP_REJECT, EXP_ERASE, EXP_RESET 00050 } EE_ExpressivTrainingControl_t; 00051 00053 typedef enum EE_ExpressivSignature_enum { 00054 EXP_SIG_UNIVERSAL = 0, EXP_SIG_TRAINED 00055 } EE_ExpressivSignature_t; 00056 00058 typedef enum EE_CognitivTrainingControl_enum { 00059 COG_NONE = 0, COG_START, COG_ACCEPT, COG_REJECT, COG_ERASE, COG_RESET 00060 } EE_CognitivTrainingControl_t; 00061 00062 00064 typedef void* EmoStateHandle; 00065 00067 typedef void* EmoEngineEventHandle; 00068 00070 typedef void* OptimizationParamHandle; 00071 00072 typedef void* DataHandle; 00073 00075 typedef enum EE_Event_enum { 00076 EE_UnknownEvent = 0x0000, 00077 EE_EmulatorError = 0x0001, 00078 EE_ReservedEvent = 0x0002, 00079 EE_UserAdded = 0x0010, 00080 EE_UserRemoved = 0x0020, 00081 EE_EmoStateUpdated = 0x0040, 00082 EE_ProfileEvent = 0x0080, 00083 EE_CognitivEvent = 0x0100, 00084 EE_ExpressivEvent = 0x0200, 00085 EE_InternalStateChanged = 0x0400, 00086 EE_AllEvent = EE_UserAdded | EE_UserRemoved | EE_EmoStateUpdated | EE_ProfileEvent | 00087 EE_CognitivEvent | EE_ExpressivEvent | EE_InternalStateChanged 00088 } EE_Event_t; 00089 00091 typedef enum EE_ExpressivEvent_enum { 00092 EE_ExpressivNoEvent = 0, EE_ExpressivTrainingStarted, EE_ExpressivTrainingSucceeded, 00093 EE_ExpressivTrainingFailed, EE_ExpressivTrainingCompleted, EE_ExpressivTrainingDataErased, 00094 EE_ExpressivTrainingRejected, EE_ExpressivTrainingReset 00095 } EE_ExpressivEvent_t; 00096 00098 typedef enum EE_CognitivEvent_enum { 00099 EE_CognitivNoEvent = 0, EE_CognitivTrainingStarted, EE_CognitivTrainingSucceeded, 00100 EE_CognitivTrainingFailed, EE_CognitivTrainingCompleted, EE_CognitivTrainingDataErased, 00101 EE_CognitivTrainingRejected, EE_CognitivTrainingReset, 00102 EE_CognitivAutoSamplingNeutralCompleted, EE_CognitivSignatureUpdated 00103 } EE_CognitivEvent_t; 00104 00105 typedef enum EE_DataChannels_enum { 00106 ED_COUNTER = 0, ED_INTERPOLATED, ED_RAW_CQ, 00107 ED_AF3, ED_F7, ED_F3, ED_FC5, ED_T7, 00108 ED_P7, ED_O1, ED_O2, ED_P8, ED_T8, 00109 ED_FC6, ED_F4, ED_F8, ED_AF4, ED_GYROX, 00110 ED_GYROY, ED_TIMESTAMP, ED_ES_TIMESTAMP, ED_FUNC_ID, ED_FUNC_VALUE, ED_MARKER, 00111 ED_SYNC_SIGNAL 00112 } EE_DataChannel_t; 00113 00115 typedef struct InputSensorDescriptor_struct { 00116 EE_InputChannels_t channelId; // logical channel id 00117 int fExists; // does this sensor exist on this headset model 00118 const char* pszLabel; // text label identifying this sensor 00119 double xLoc; // x coordinate from center of head towards nose 00120 double yLoc; // y coordinate from center of head towards ears 00121 double zLoc; // z coordinate from center of head toward top of skull 00122 } InputSensorDescriptor_t; 00123 00124 00126 00132 EDK_API int 00133 EE_EngineConnect(); 00134 00135 00137 00150 EDK_API int 00151 EE_EngineRemoteConnect(const char* szHost, unsigned short port); 00152 00153 00155 00161 EDK_API int 00162 EE_EngineDisconnect(); 00163 00164 00166 00175 EDK_API int 00176 EE_EnableDiagnostics(const char* szFilename, int fEnable, int nReserved); 00177 00178 00180 00183 EDK_API EmoEngineEventHandle 00184 EE_EmoEngineEventCreate(); 00185 00186 00188 00191 EDK_API EmoEngineEventHandle 00192 EE_ProfileEventCreate(); 00193 00194 00196 00199 EDK_API void 00200 EE_EmoEngineEventFree(EmoEngineEventHandle hEvent); 00201 00202 00204 00207 EDK_API EmoStateHandle 00208 EE_EmoStateCreate(); 00209 00210 00212 00215 EDK_API void 00216 EE_EmoStateFree(EmoStateHandle hState); 00217 00218 00220 00225 EDK_API EE_Event_t 00226 EE_EmoEngineEventGetType(EmoEngineEventHandle hEvent); 00227 00228 00230 00235 EDK_API EE_CognitivEvent_t 00236 EE_CognitivEventGetType(EmoEngineEventHandle hEvent); 00237 00238 00240 00245 EDK_API EE_ExpressivEvent_t 00246 EE_ExpressivEventGetType(EmoEngineEventHandle hEvent); 00247 00248 00250 00259 EDK_API int 00260 EE_EmoEngineEventGetUserId(EmoEngineEventHandle hEvent, unsigned int *pUserIdOut); 00261 00262 00264 00273 EDK_API int 00274 EE_EmoEngineEventGetEmoState(EmoEngineEventHandle hEvent, EmoStateHandle hEmoState); 00275 00276 00278 00291 EDK_API int 00292 EE_EngineGetNextEvent(EmoEngineEventHandle hEvent); 00293 00294 00296 00307 EDK_API int 00308 EE_EngineClearEventQueue(int eventTypes); 00309 00310 00312 00320 EDK_API int 00321 EE_EngineGetNumUser(unsigned int* pNumUserOut); 00322 00323 00325 00333 EDK_API int 00334 EE_SetHardwarePlayerDisplay(unsigned int userId, unsigned int playerNum); 00335 00336 00338 00348 EDK_API int 00349 EE_SetUserProfile(unsigned int userId, const unsigned char profileBuffer[], unsigned int length); 00350 00351 00353 00365 EDK_API int 00366 EE_GetUserProfile(unsigned int userId, EmoEngineEventHandle hEvent); 00367 00368 00370 00381 EDK_API int 00382 EE_GetBaseProfile(EmoEngineEventHandle hEvent); 00383 00384 00386 00395 EDK_API int 00396 EE_GetUserProfileSize(EmoEngineEventHandle hEvt, unsigned int* pProfileSizeOut); 00397 00398 00400 00410 EDK_API int 00411 EE_GetUserProfileBytes(EmoEngineEventHandle hEvt, unsigned char destBuffer[], unsigned int length); 00412 00414 00423 EDK_API int 00424 EE_LoadUserProfile(unsigned int userID, const char* szInputFilename); 00425 00427 00436 EDK_API int 00437 EE_SaveUserProfile(unsigned int userID, const char* szOutputFilename); 00438 00440 00451 EDK_API int 00452 EE_ExpressivSetThreshold(unsigned int userId, EE_ExpressivAlgo_t algoName, EE_ExpressivThreshold_t thresholdName, int value); 00453 00454 00456 00467 EDK_API int 00468 EE_ExpressivGetThreshold(unsigned int userId, EE_ExpressivAlgo_t algoName, EE_ExpressivThreshold_t thresholdName, int *pValueOut); 00469 00470 00472 00482 EDK_API int 00483 EE_ExpressivSetTrainingAction(unsigned int userId, EE_ExpressivAlgo_t action); 00484 00485 00487 00497 EDK_API int 00498 EE_ExpressivSetTrainingControl(unsigned int userId, EE_ExpressivTrainingControl_t control); 00499 00500 00502 00512 EDK_API int 00513 EE_ExpressivGetTrainingAction(unsigned int userId, EE_ExpressivAlgo_t* pActionOut); 00514 00515 00517 00526 EDK_API int 00527 EE_ExpressivGetTrainingTime(unsigned int userId, unsigned int* pTrainingTimeOut); 00528 00529 00531 00541 EDK_API int 00542 EE_ExpressivGetTrainedSignatureActions(unsigned int userId, unsigned long* pTrainedActionsOut); 00543 00544 00546 00559 EDK_API int 00560 EE_ExpressivGetTrainedSignatureAvailable(unsigned int userId, int* pfAvailableOut); 00561 00563 00575 EDK_API int 00576 EE_ExpressivSetSignatureType(unsigned int userId, EE_ExpressivSignature_t sigType); 00577 00579 00589 EDK_API int 00590 EE_ExpressivGetSignatureType(unsigned int userId, EE_ExpressivSignature_t* pSigTypeOut); 00591 00592 00593 00594 00596 00605 EDK_API int 00606 EE_CognitivSetActiveActions(unsigned int userId, unsigned long activeActions); 00607 00608 00610 00619 EDK_API int 00620 EE_CognitivGetActiveActions(unsigned int userId, unsigned long* pActiveActionsOut); 00621 00622 00624 00633 EDK_API int 00634 EE_CognitivGetTrainingTime(unsigned int userId, unsigned int* pTrainingTimeOut); 00635 00636 00638 00647 EDK_API int 00648 EE_CognitivSetTrainingControl(unsigned int userId, EE_CognitivTrainingControl_t control); 00649 00650 00652 00661 EDK_API int 00662 EE_CognitivSetTrainingAction(unsigned int userId, EE_CognitivAction_t action); 00663 00664 00666 00675 EDK_API int 00676 EE_CognitivGetTrainingAction(unsigned int userId, EE_CognitivAction_t* pActionOut); 00677 00678 00680 00691 EDK_API int 00692 EE_CognitivGetTrainedSignatureActions(unsigned int userId, unsigned long* pTrainedActionsOut); 00693 00694 00696 00707 EDK_API int 00708 EE_CognitivGetOverallSkillRating(unsigned int userId, float* pOverallSkillRatingOut); 00709 00710 00712 00724 EDK_API int 00725 EE_CognitivGetActionSkillRating(unsigned int userId, EE_CognitivAction_t action, float* pActionSkillRatingOut); 00726 00727 00729 00738 EDK_API int 00739 EE_CognitivSetActivationLevel(unsigned int userId, int level); 00740 00741 00743 00755 EDK_API int 00756 EE_CognitivSetActionSensitivity(unsigned int userId, 00757 int action1Sensitivity, int action2Sensitivity, 00758 int action3Sensitivity, int action4Sensitivity); 00759 00760 00762 00771 EDK_API int 00772 EE_CognitivGetActivationLevel(unsigned int userId, int *pLevelOut); 00773 00774 00776 00788 EDK_API int 00789 EE_CognitivGetActionSensitivity(unsigned int userId, 00790 int* pAction1SensitivityOut, int* pAction2SensitivityOut, 00791 int* pAction3SensitivityOut, int* pAction4SensitivityOut); 00792 00793 00795 00803 EDK_API int 00804 EE_CognitivStartSamplingNeutral(unsigned int userId); 00805 00806 00808 00816 EDK_API int 00817 EE_CognitivStopSamplingNeutral(unsigned int userId); 00818 00819 00821 00830 EDK_API int 00831 EE_CognitivSetSignatureCaching(unsigned int userId, unsigned int enabled); 00832 00833 00835 00844 EDK_API int 00845 EE_CognitivGetSignatureCaching(unsigned int userId, unsigned int* pEnabledOut); 00846 00847 00849 00858 EDK_API int 00859 EE_CognitivSetSignatureCacheSize(unsigned int userId, unsigned int size); 00860 00861 00863 00872 EDK_API int 00873 EE_CognitivGetSignatureCacheSize(unsigned int userId, unsigned int* pSizeOut); 00874 00875 00877 00886 EDK_API int 00887 EE_HeadsetGetSensorDetails(EE_InputChannels_t channelId, InputSensorDescriptor_t* pDescriptorOut); 00888 00889 00891 00900 EDK_API int 00901 EE_HardwareGetVersion(unsigned int userId, unsigned long* pHwVersionOut); 00902 00904 00914 EDK_API int 00915 EE_SoftwareGetVersion(char* pszVersionOut, unsigned int nVersionChars, unsigned long* pBuildNumOut); 00916 00918 00929 EDK_API int 00930 EE_HeadsetGetGyroDelta(unsigned int userId, int* pXOut, int* pYOut); 00931 00933 00942 EDK_API int 00943 EE_HeadsetGyroRezero(unsigned int userId); 00944 00946 00949 EDK_API OptimizationParamHandle 00950 EE_OptimizationParamCreate(); 00951 00953 00956 EDK_API void 00957 EE_OptimizationParamFree(OptimizationParamHandle hParam); 00958 00960 00965 EDK_API int 00966 EE_OptimizationEnable(OptimizationParamHandle hParam); 00967 00969 00974 EDK_API int 00975 EE_OptimizationIsEnabled(bool* pEnabledOut); 00976 00978 00982 EDK_API int 00983 EE_OptimizationDisable(); 00984 00986 00991 EDK_API int 00992 EE_OptimizationGetParam(OptimizationParamHandle hParam); 00993 00995 01002 EDK_API int 01003 EE_OptimizationGetVitalAlgorithm(OptimizationParamHandle hParam, EE_EmotivSuite_t suite, unsigned int* pVitalAlgorithmBitVectorOut); 01004 01006 01013 EDK_API int 01014 EE_OptimizationSetVitalAlgorithm(OptimizationParamHandle hParam, EE_EmotivSuite_t suite, unsigned int vitalAlgorithmBitVector); 01015 01017 01024 EDK_API int EE_ResetDetection(unsigned int userId, EE_EmotivSuite_t suite, unsigned int detectionBitVector); 01025 01027 01030 EDK_API DataHandle EE_DataCreate(); 01031 01033 01036 EDK_API void EE_DataFree(DataHandle hData); 01037 01039 01045 EDK_API int EE_DataUpdateHandle(unsigned int userId, DataHandle hData); 01046 01048 01056 EDK_API int EE_DataGet(DataHandle hData, EE_DataChannel_t channel, double buffer[], unsigned int bufferSizeInSample); 01057 01059 01065 EDK_API int EE_DataGetNumberOfSample(DataHandle hData, unsigned int* nSampleOut); 01066 01068 01073 EDK_API int EE_DataSetBufferSizeInSec(float bufferSizeInSec); 01074 01076 01081 EDK_API int EE_DataGetBufferSizeInSec(float* pBufferSizeInSecOut); 01082 01084 01091 EDK_API int EE_DataAcquisitionEnable(unsigned int userId, bool enable); 01092 01094 01100 EDK_API int EE_DataAcquisitionIsEnabled(unsigned int userId, bool* pEnableOut); 01101 01103 01109 EDK_API int EE_DataSetSychronizationSignal(unsigned int userId, int signal); 01110 01112 01118 EDK_API int EE_DataSetMarker(unsigned int userId, int marker); 01119 01121 01127 EDK_API int EE_DataGetSamplingRate(unsigned int userId, unsigned int* samplingRateOut); 01128 }; 01129 01130 #endif
1.7.3