summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR/tracker.cpp
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2011-02-07 21:36:06 +0000
committerWim Vriend <facetracknoir@gmail.com>2011-02-07 21:36:06 +0000
commitd3ff506356286dd7cbff67b8736482539a317006 (patch)
treeefac1f1e5678f1adebab198b53be26c6d0b2500d /FaceTrackNoIR/tracker.cpp
parent4acd072afb9cc76231b1d666d933f3dbbb4b3baa (diff)
Added option to stop tracking, but keep the engine running.
Improved KeyboardShortcutDialog git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@48 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/tracker.cpp')
-rw-r--r--FaceTrackNoIR/tracker.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp
index 90efc9d6..91c386c0 100644
--- a/FaceTrackNoIR/tracker.cpp
+++ b/FaceTrackNoIR/tracker.cpp
@@ -66,6 +66,7 @@ bool Tracker::do_center = false;
bool Tracker::do_inhibit = false;
bool Tracker::useFilter = false;
bool Tracker::setZero = true;
+bool Tracker::setEngineStop = true;
HANDLE Tracker::hTrackMutex = 0;
long Tracker::prevHeadPoseTime = 0;
@@ -440,10 +441,14 @@ void Tracker::run() {
current_camera_position.pitch = 0.0f;
current_camera_position.roll = 0.0f;
- _engine->start();
+ if (_engine->state() != SM_API_ENGINE_STATE_HT_TRACKING) {
+ _engine->start();
+ }
}
else {
- _engine->stop();
+ if (setEngineStop) { // Only stop engine when option is checked
+ _engine->stop();
+ }
}
qDebug() << "Tracker::run() says StartStop pressed, do_tracking =" << Tracker::do_tracking;
}
@@ -1082,6 +1087,7 @@ QPointF point1, point2, point3, point4;
StartStopKey.ctrl = iniFile.value ( "Ctrl_StartStop", 0 ).toBool();
StartStopKey.alt = iniFile.value ( "Alt_StartStop", 0 ).toBool();
setZero = iniFile.value ( "SetZero", 1 ).toBool();
+ setEngineStop = iniFile.value ( "SetEngineStop", 1 ).toBool();
// Inhibit key
InhibitKey.keycode = iniFile.value ( "Keycode_Inhibit", 0 ).toInt();