diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2011-05-28 13:08:36 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2011-05-28 13:08:36 +0000 |
commit | 2852ec626fec6d4955a41202feec6be27e776e93 (patch) | |
tree | 6ec9fad989d838b19b44d326c597a0f07134cd7d /FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp | |
parent | 8c8ddc7500db299c52ce8d818ab84ea65d64ddb6 (diff) |
Added filter setting faceAPI
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@84 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp')
-rw-r--r-- | FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp index 9834e78f..0998d90a 100644 --- a/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp +++ b/FTNoIR_Tracker_SM/ftnoir_tracker_faceapi.cpp @@ -251,6 +251,11 @@ QWidget() connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
connect(ui.btnEngineStart, SIGNAL(clicked()), this, SLOT(doStartEngine()));
connect(ui.btnEngineStop, SIGNAL(clicked()), this, SLOT(doStopEngine()));
+
+ ui.cbxFilterSetting->addItem("None");
+ ui.cbxFilterSetting->addItem("Normal");
+ ui.cbxFilterSetting->addItem("High");
+ connect(ui.cbxFilterSetting, SIGNAL(currentIndexChanged(int)), this, SLOT(doSetFilter( int )));
connect(ui.btnCameraSettings, SIGNAL(clicked()), this, SLOT(doShowCam()));
if (SMCreateMapping()) {
@@ -265,8 +270,9 @@ QWidget() //Setup the timer for showing the headpose.
timUpdateSettings = new QTimer(this);
- connect(timUpdateSettings, SIGNAL(timeout()), this, SLOT(showSettings()));
- timUpdateSettings->start(1000);
+ connect(timUpdateSettings, SIGNAL(timeout()), this, SLOT(doTimUpdate()));
+ timUpdateSettings->start(100);
+ connect(this, SIGNAL(stateChanged( int )), this, SLOT(showSettings( int )));
}
@@ -435,10 +441,22 @@ bool SMClientControls::SMCreateMapping() //
// Show the current engine-settings etc.
//
-void SMClientControls::showSettings()
+void SMClientControls::doTimUpdate()
+{
+ int state = pMemData->state;
+ if ( state != prev_state) {
+ emit stateChanged(state);
+ prev_state = state;
+ }
+}
+
+//
+// Show the current engine-settings etc.
+//
+void SMClientControls::showSettings( int newState )
{
qDebug() << "SMClientControls::showSettings says: Starting Function";
- switch (pMemData->state)
+ switch (newState)
{
case SM_API_ENGINE_STATE_TERMINATED:
ui._engine_state_label->setText("TERMINATED");
@@ -463,10 +481,11 @@ void SMClientControls::showSettings() break;
}
+ ui.cbxFilterSetting->setEnabled( (newState == SM_API_ENGINE_STATE_IDLE) );
}
//
-// Start the tracking Engine.
+// Send a command without parameter-value to the tracking Engine.
//
void SMClientControls::doCommand(int command)
{
@@ -477,6 +496,19 @@ void SMClientControls::doCommand(int command) return;
}
+//
+// Send a command with integer parameter-value to the tracking Engine.
+//
+void SMClientControls::doCommand(int command, int value)
+{
+ if ( (pMemData != NULL) && (WaitForSingleObject(hSMMutex, 100) == WAIT_OBJECT_0) ) {
+ pMemData->command = command; // Send command
+ pMemData->par_val_int = value;
+ ReleaseMutex(hSMMutex);
+ }
+ return;
+}
+
////////////////////////////////////////////////////////////////////////////////
// Factory function that creates instances if the Tracker-settings dialog object.
|