From 1ef199b2369d78558df6c706592ae1def10adfd7 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Mon, 15 Aug 2011 11:48:23 +0000 Subject: Some minor changes to the interface. Also moved to new dev.hardware git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@89 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Protocol_FTIR/FTNoIR_FTIRcontrols.ui | 201 +++++++++++++++++------ FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp | 17 +- FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h | 1 + FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj | 12 +- 4 files changed, 168 insertions(+), 63 deletions(-) (limited to 'FTNoIR_Protocol_FTIR') diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_FTIRcontrols.ui b/FTNoIR_Protocol_FTIR/FTNoIR_FTIRcontrols.ui index a2d06d2a..b7cbe25f 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_FTIRcontrols.ui +++ b/FTNoIR_Protocol_FTIR/FTNoIR_FTIRcontrols.ui @@ -6,8 +6,8 @@ 0 0 - 411 - 157 + 588 + 216 @@ -25,31 +25,151 @@ - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - Use TIRViews - - - - + + + + 0 + 70 + + + + TIRViews + + + + + 70 + 20 + 88 + 17 + + + + Qt::RightToLeft + + + Use TIRViews + + + + + + 180 + 10 + 301 + 16 + + + + TIRViews is only required for some older games (like CFS3). + + + + + + 180 + 30 + 421 + 16 + + + + For it to work, TIRViews.dll must be placed in the FaceTrackNoIR program folder. + + + true + + + + + + 180 + 50 + 251 + 16 + + + + If the checkbox is disabled, the DLL was not found. + + + + + + + + + 0 + 70 + + + + TrackIR.exe + + + + + 13 + 20 + 145 + 17 + + + + Qt::RightToLeft + + + Start dummy TrackIR.exe + + + + + + 180 + 10 + 351 + 16 + + + + Some programs check, to see if a process called TrackIR.exe is running, + + + + + + 180 + 30 + 261 + 16 + + + + before enabling head-tracking (EZCA is one of them). + + + true + + + + + + 180 + 50 + 231 + 16 + + + + Check the checkbox, to overcome this problem. + + + chkStartDummy + label_2 + label + label_3 + groupBox + @@ -65,32 +185,7 @@ - - - - - TIRViews is only required for some older games (like CFS3). - - - - - - - For it to work, TIRViews.dll must be placed in the FaceTrackNoIR program folder. - - - true - - - - - - - If the checkbox is disabled, the DLL was not found. - - - - + diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp index 83b21f7b..82857745 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.cpp @@ -62,9 +62,11 @@ FTNoIR_Protocol_FTIR::~FTNoIR_Protocol_FTIR() // // Kill the dummy TrackIR process. // - qDebug() << "FTIRServer::~FTIRServer() about to kill TrackIR.exe process"; +// qDebug() << "FTIRServer::~FTIRServer() about to kill TrackIR.exe process"; try { if (dummyTrackIR) { + qDebug() << "FTIRServer::~FTIRServer() about to kill TrackIR.exe process"; +// dummyTrackIR->close(); dummyTrackIR->kill(); } } @@ -115,6 +117,7 @@ void FTNoIR_Protocol_FTIR::loadSettings() { iniFile.beginGroup ( "FTIR" ); useTIRViews = iniFile.value ( "useTIRViews", 0 ).toBool(); + useDummyExe = iniFile.value ( "useDummyExe", 1 ).toBool(); iniFile.endGroup (); } @@ -217,9 +220,11 @@ bool FTNoIR_Protocol_FTIR::checkServerInstallationOK( HANDLE handle ) // Some TrackIR clients check if a process called TrackIR.exe is running. // This should do the trick // - QString program = "TrackIR.exe"; - dummyTrackIR = new QProcess(); - dummyTrackIR->start(program); + if (useDummyExe) { + QString program = "TrackIR.exe"; + dummyTrackIR = new QProcess(); + dummyTrackIR->start(program); + } } catch(...) { settings.~QSettings(); @@ -380,6 +385,7 @@ QWidget() connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); connect(ui.chkTIRViews, SIGNAL(stateChanged(int)), this, SLOT(chkTIRViewsChanged())); + connect(ui.chkStartDummy, SIGNAL(stateChanged(int)), this, SLOT(settingChanged())); aFileName = QCoreApplication::applicationDirPath() + "/"; aFileName.append(FTIR_VIEWS_FILENAME); @@ -479,6 +485,8 @@ void FTIRControls::loadSettings() { iniFile.beginGroup ( "FTIR" ); ui.chkTIRViews->setChecked (iniFile.value ( "useTIRViews", 0 ).toBool()); + ui.chkStartDummy->setChecked (iniFile.value ( "useDummyExe", 1 ).toBool()); + iniFile.endGroup (); settingsDirty = false; @@ -495,6 +503,7 @@ void FTIRControls::save() { iniFile.beginGroup ( "FTIR" ); iniFile.setValue ( "useTIRViews", ui.chkTIRViews->isChecked() ); + iniFile.setValue ( "useDummyExe", ui.chkStartDummy->isChecked() ); iniFile.endGroup (); settingsDirty = false; diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h index 59454e90..6307c6a1 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h @@ -76,6 +76,7 @@ private: QLibrary FTIRViewsLib; QProcess *dummyTrackIR; bool useTIRViews; + bool useDummyExe; float scale2AnalogLimits( float x, float min_x, float max_x ); void loadSettings(); diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj index ca3f797e..6e4b6c35 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj @@ -1,7 +1,7 @@ @@ -209,7 +209,7 @@ @@ -318,7 +318,7 @@ />