summaryrefslogtreecommitdiffhomepage
path: root/faceAPI
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2011-03-25 15:34:09 +0000
committerWim Vriend <facetracknoir@gmail.com>2011-03-25 15:34:09 +0000
commit62a27051a8222ba2759af4afcaf86eb0321786c1 (patch)
tree3487c741a8df51a3ebca0e031d7977adf03b563c /faceAPI
parentf1affef14367d572f4aa0b4ff113ebfc1a48ede7 (diff)
Some more changes from previous commit.
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@58 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'faceAPI')
-rw-r--r--faceAPI/main.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/faceAPI/main.cpp b/faceAPI/main.cpp
index 3b260dca..e60535fe 100644
--- a/faceAPI/main.cpp
+++ b/faceAPI/main.cpp
@@ -209,6 +209,8 @@ smCameraHandle createFirstCamera()
void run()
{
char msg[100];
+ int state;
+
// Capture control-C
// signal(SIGINT, CtrlCHandler);
@@ -334,7 +336,7 @@ void run()
smWindowHandle win_handle = 0;
THROW_ON_ERROR(smVideoDisplayGetWindowHandle(video_display_handle,&win_handle));
SetWindowText(win_handle, _T("faceAPI Video-widget"));
- MoveWindow(win_handle, 0, 0, 250, 150, true);
+ MoveWindow(win_handle, 0, 0, 250, 180, true);
// Loop on the keyboard
while (processKeyPress(engine_handle, video_display_handle) && !stopCommand)
@@ -372,7 +374,14 @@ void run()
if (pMemData) {
switch (pMemData->command) {
case FT_SM_START:
- THROW_ON_ERROR(smEngineStart(engine_handle)); // Start tracking
+
+ //
+ // 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
break;