summaryrefslogtreecommitdiffhomepage
path: root/faceAPI
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2011-05-01 14:20:34 +0000
committerWim Vriend <facetracknoir@gmail.com>2011-05-01 14:20:34 +0000
commitee4f1ceb7741cc1b578dafe37e255f96e15a5a84 (patch)
tree57c928bb028e66e7f03b1f7ba51e160e34223f08 /faceAPI
parent46503a32de2fdc498aa04504482997b8708401c9 (diff)
Added controls for faceAPI
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@82 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'faceAPI')
-rw-r--r--faceAPI/main.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/faceAPI/main.cpp b/faceAPI/main.cpp
index 6d02b355..403340a5 100644
--- a/faceAPI/main.cpp
+++ b/faceAPI/main.cpp
@@ -23,6 +23,7 @@
*********************************************************************************/
/*
Modifications (last one on top):
+ 20110501 - WVR: Added some command to be handled from FaceTrackNoIR (settings dialog).
20110322 - WVR: Somehow the video-widget of faceAPI version 3.2.6. does not
work with FaceTrackNoIR (Qt issue?!). To be able to use
release 3.2.6 of faceAPI anyway, this console-app is used.
@@ -372,20 +373,27 @@ void run()
sprintf_s(msg, "Command: %d\n", pMemData->command);
OutputDebugStringA(msg);
if (pMemData) {
+
+ //
+ //
+ // Determine the trackers' state and send it to FaceTrackNoIR.
+ //
+ THROW_ON_ERROR(smEngineGetState(engine_handle, &state));
+ pMemData->state = state;
+
+ //
+ // Check if a command was issued and do something with it!
+ //
switch (pMemData->command) {
case FT_SM_START:
//
// Only execute Start, if the engine is not yet tracking.
//
- THROW_ON_ERROR(smEngineGetState(engine_handle, &state));
if (state != SM_API_ENGINE_STATE_HT_TRACKING) {
THROW_ON_ERROR(smEngineStart(engine_handle)); // Start tracking
}
pMemData->command = 0; // Reset
-
- THROW_ON_ERROR(smEngineShowCameraControlPanel(engine_handle));
-
break;
case FT_SM_STOP:
@@ -399,6 +407,11 @@ void run()
pMemData->command = 0; // Reset
break;
+ case FT_SM_SHOW_CAM:
+ THROW_ON_ERROR(smEngineShowCameraControlPanel(engine_handle));
+ pMemData->command = 0; // Reset
+ break;
+
default:
pMemData->command = 0; // Reset
// should never be reached
@@ -505,6 +518,7 @@ bool SMCreateMapping()
pMemData = (SMMemMap *) MapViewOfFile(hSMMemMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(TFaceData));
if (pMemData != NULL) {
OutputDebugString(_T("FTCreateMapping says: MapViewOfFile OK.\n"));
+ pMemData->state = 0;
// pMemData->handle = handle; // The game uses the handle, to send a message that the Program-Name was set!
}
hSMMutex = CreateMutexA(NULL, false, SM_MUTEX);