-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathepocutils.hpp
103 lines (77 loc) · 3.71 KB
/
epocutils.hpp
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
/* epocutils.h - header file
*
* Emotiv Epoc Ubuntu SDK Dev Edition - namespaced utility header file - by StephaneAG 2013
*
* supposed to be used: 1 -> as a utility class ( include header file in necessary .cpp file )
* 2 -> as a utility class, embedded in a library that is available system wide ( .so file )
*
*/
/* includes the necessary standard stuff */
#include <iostream>
#include <map>
/* include the Emotiv-proprietary stuff */
#include "edk.h"
#include "edkErrorCode.h"
#include "EmoStateDLL.h"
/* we define what this header file makes available to file that include it */
#ifndef epocutils_h
#define epocutils_h
namespace epocutils
{
void helloWorld(); // a dummy 'Hello World' fcn
int highFive(); // anothe dummy fcn
/* the REAL functions & stuff of the 'epocuutils' helper */
/* a 'EpocHeadset_struct' structure to hold all the stuff we're interested in */
//typedef struct EpocHeadset_struct
struct EpocHeadset_t
{
// bool to prevent unnecessary polling
bool newDataToRead;
// -- Epoc 'original' values -- // R: " #include <typeinfo> & then std::cout << typeid( <the-var-name> ).name() << std::endl; ", but still not that easy to use ( ...)
float time; // aka, returned a 'f' from the comment above in comments
unsigned int userID;
int wirelessSignalStatus; // R: do a 'static_cast<int>(ES_GetWIrelessSignalStatus(eState))' as else the type will be 'EE_SignalStrength_t' ( enum )
// Expressiv suite
int isBlinking;
int isWinkingLeft;
int isWinkingRight;
int isLookingLeft;
int isLookingRight;
// Digg the doc & ask Emotiv for the 'IsEyesOpen', 'IsLookingUp' & 'IsLookingDown' fcn ( ... )
float eyebrow; // R: " expressivStates[ EXP_EYEBROW ] "
float furrow;
float smile;
float clench;
float smirkLeft;
float smirkRight;
float laugh;
// Affectiv suite
float shortTermExcitement;
float longTermExcitement;
float engagementBoredom;
// Digg the doc & ask Emotiv for the 'Meditation' & 'Frustration'
// Cognitiv suite
int cogntivAction;
float cogntiviActionConfidence;
//} EpocHeadset;
};
/* connect to the Epoc headset */
int connect(bool& connected);
/* disconnect from the Epoc headset ( WARNING: this function WILL NOT free the 'EmoStateHandle' neither the 'EmoEngineEventHandle' ! ) */
void disconnect(bool& connected);
/* disconnect from the Epoc headset AND clean up */
void disconnect(bool& connected, EmoStateHandle& eState, EmoEngineEventHandle& eEvent);
/* create an 'EmoEngineEventHandle' */
EmoEngineEventHandle createEventHandle();
/* create an 'EmoStateHandle' */
EmoStateHandle createStateHandle();
/* initialize the struct members ( I actually don't know if it's actually required, but it's always nice to init parameters before setting values to them anyway ( ... ) */
//void initializeEpocHeadsetStruct(unsigned int& userID, EpocHeadset& epocheadset);
void initializeEpocHeadsetStruct(unsigned int& userID, EpocHeadset_t& epocheadset);
/* To DO - 'createInitializedEpocHeadsetStruct'*/
/* handle fresh data from the Epoc headset, if connected, & update the passed 'EpocHeadset_struct' structure with that data */
//void handleEvents(bool& connected, int& epoc_state, EmoEngineEventHandle& eEvent, EmoStateHandle& eState, unsigned int& userID, EpocHeadset& epocheadset);
void handleEvents(bool& connected, int& epoc_state, EmoEngineEventHandle& eEvent, EmoStateHandle& eState, unsigned int& userID, EpocHeadset_t& epocheadset);
/* TO DO - even just to know how to do it - ~same fcn as above but accept a 'fcn&' as last argument, to wich it 'd pass a struct/class when done processing new events ( if any ) */
}
#endif // epocutils_h