summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2013-02-03 15:14:14 +0000
committerWim Vriend <facetracknoir@gmail.com>2013-02-03 15:14:14 +0000
commitaa575640fcc3c2ad41f68986ee6263f11630adf8 (patch)
tree4408387aed034afd809fae46bb639cc8e75dfe71
parentffa80134f54e7c0b9bb9349cbb968d54dc6ed347 (diff)
Changed FreeTrack 2.0 concerning TIRViews. It needs to start first.
Added 'disable beep' to KeyboardShortcutDialog. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@260 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r--FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui161
-rw-r--r--FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp133
-rw-r--r--FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h3
-rw-r--r--FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp29
-rw-r--r--FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui15
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp10
-rw-r--r--FaceTrackNoIR/tracker.cpp39
-rw-r--r--FaceTrackNoIR/tracker.h1
8 files changed, 298 insertions, 93 deletions
diff --git a/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui b/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui
index 29cba42b..980b2943 100644
--- a/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui
+++ b/FTNoIR_Protocol_FT/FTNoIR_FTcontrols.ui
@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
- <width>411</width>
- <height>112</height>
+ <width>588</width>
+ <height>263</height>
</rect>
</property>
<property name="windowTitle">
- <string>FreeTrack settings FaceTrackNoIR</string>
+ <string>FreeTrack 2.0 settings FaceTrackNoIR</string>
</property>
<property name="windowIcon">
<iconset>
@@ -25,7 +25,149 @@
</property>
<layout class="QVBoxLayout" name="_vertical_layout">
<item>
- <layout class="QHBoxLayout">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>70</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>TIRViews</string>
+ </property>
+ <widget class="QCheckBox" name="chkTIRViews">
+ <property name="geometry">
+ <rect>
+ <x>70</x>
+ <y>20</y>
+ <width>88</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text">
+ <string>Use TIRViews</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_4">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>10</y>
+ <width>301</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>TIRViews is only required for some older games (like CFS3).</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_5">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>30</y>
+ <width>421</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>For it to work, TIRViews.dll must be placed in the FaceTrackNoIR program folder.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_6">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>50</y>
+ <width>251</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>If the checkbox is disabled, the DLL was not found.</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>70</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>TrackIR.exe</string>
+ </property>
+ <widget class="QCheckBox" name="chkStartDummy">
+ <property name="geometry">
+ <rect>
+ <x>13</x>
+ <y>20</y>
+ <width>145</width>
+ <height>17</height>
+ </rect>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text">
+ <string>Start dummy TrackIR.exe</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_3">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>10</y>
+ <width>351</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Some programs check, to see if a process called TrackIR.exe is running,</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>30</y>
+ <width>261</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>before enabling head-tracking (EZCA is one of them).</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_7">
+ <property name="geometry">
+ <rect>
+ <x>180</x>
+ <y>50</y>
+ <width>231</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Check the checkbox, to overcome this problem.</string>
+ </property>
+ </widget>
+ </widget>
+ </item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
@@ -55,17 +197,6 @@
</spacer>
</item>
<item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>There are no settings necessary for the FreeTrack protocol.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
diff --git a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp
index 159d3c31..7a1d898e 100644
--- a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp
+++ b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.cpp
@@ -26,6 +26,7 @@
********************************************************************************/
/*
Modifications (last one on top):
+ 20130203 - WVR: Added Tirviews and dummy checkboxes to the Settings dialog. This is necessary for CFS3 etc.
20130125 - WVR: Upgraded to FT2.0: now the FreeTrack protocol supports all TIR-enabled games.
20110401 - WVR: Moved protocol to a DLL, convenient for installation etc.
20101224 - WVR: Base class is no longer inheriting QThread. sendHeadposeToGame
@@ -42,6 +43,9 @@
FTNoIR_Protocol::FTNoIR_Protocol()
{
comhandle = 0;
+ useTIRViews = false;
+ useDummyExe = false;
+
loadSettings();
ProgramName = "";
intGameID = 0;
@@ -49,6 +53,7 @@ FTNoIR_Protocol::FTNoIR_Protocol()
dummyTrackIR = 0;
viewsStart = 0;
viewsStop = 0;
+
}
/** destructor **/
@@ -88,11 +93,11 @@ FTNoIR_Protocol::~FTNoIR_Protocol()
FTDestroyMapping();
}
-/** helper to Auto-destruct **/
-void FTNoIR_Protocol::Release()
-{
- delete this;
-}
+///** helper to Auto-destruct **/
+//void FTNoIR_Protocol::Release()
+//{
+// delete this;
+//}
void FTNoIR_Protocol::Initialize()
{
@@ -113,20 +118,28 @@ QStringList gameLine;
QFile file(QCoreApplication::applicationDirPath() + "/Settings/FaceTrackNoIR Supported Games.csv");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug()<< "cannot read file!";
- return false;
+
+ QString strError("Cannot load file: " + file.fileName());
+ sprintf_s(pMemData->ProgramName, 99, strError.toAscii());
+ file.close();
+
+ //
+ // Return true anyway, because maybe it's V160 compatible.
+ //
+ return true;
}
CSV csv(&file);
gameLine = csv.parseLine();
while (gameLine.count() > 2) {
- qDebug() << "Column 0: " << gameLine.at(0); // No.
- qDebug() << "Column 1: " << gameLine.at(1); // Game Name
- qDebug() << "Column 2: " << gameLine.at(2); // Game Protocol
- qDebug() << "Column 3: " << gameLine.at(3); // Supported since version
- qDebug() << "Column 4: " << gameLine.at(4); // Verified
- qDebug() << "Column 5: " << gameLine.at(5); // By
- qDebug() << "Column 6: " << gameLine.at(6); // International ID
- qDebug() << "Column 7: " << gameLine.at(7); // FaceTrackNoIR ID
+ //qDebug() << "Column 0: " << gameLine.at(0); // No.
+ //qDebug() << "Column 1: " << gameLine.at(1); // Game Name
+ //qDebug() << "Column 2: " << gameLine.at(2); // Game Protocol
+ //qDebug() << "Column 3: " << gameLine.at(3); // Supported since version
+ //qDebug() << "Column 4: " << gameLine.at(4); // Verified
+ //qDebug() << "Column 5: " << gameLine.at(5); // By
+ //qDebug() << "Column 6: " << gameLine.at(6); // International ID
+ //qDebug() << "Column 7: " << gameLine.at(7); // FaceTrackNoIR ID
//
// If the gameID was found, fill the shared memory
@@ -149,7 +162,8 @@ QStringList gameLine;
//
// If the gameID was NOT found, fill only the name "Unknown game connected"
//
- sprintf_s(pMemData->ProgramName, 99, gameLine.at(1).toAscii());
+ QString strUnknown("Unknown game connected (ID = " + gameID + ")");
+ sprintf_s(pMemData->ProgramName, 99, strUnknown.toAscii());
file.close();
return true;
}
@@ -158,6 +172,18 @@ QStringList gameLine;
// Load the current Settings from the currently 'active' INI-file.
//
void FTNoIR_Protocol::loadSettings() {
+ QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
+
+ QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
+ QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
+
+ //
+ // Use the settings-section from the deprecated fake-TIR protocol, as they are most likely to be found there.
+ //
+ iniFile.beginGroup ( "FTIR" );
+ useTIRViews = iniFile.value ( "useTIRViews", 0 ).toBool();
+ useDummyExe = iniFile.value ( "useDummyExe", 1 ).toBool();
+ iniFile.endGroup ();
}
//
@@ -254,46 +280,11 @@ PDWORD_PTR MsgResult = 0;
QString gameID = QString(pMemData->GameID);
// QString gameID = QString("2304");
- qDebug() << "sendHeadposeToGame: gameID = " << gameID;
+// qDebug() << "sendHeadposeToGame: gameID = " << gameID;
if (gameID.length() > 0) {
if ( gameID.toInt() != intGameID ) {
if (getGameData( gameID ) ) {
SendMessageTimeout( (HWND) hMainWindow, RegisterWindowMessageA(FT_PROGRAMID), 0, 0, 0, 2000, MsgResult);
-
- //
- // Check if TIRViews or dummy TrackIR.exe is required for this game
- //
- QString ftnID = QString(pMemData->FTNID);
- if (ftnID.length() >= 22) {
- if (ftnID.at(20) != '0') {
- FTIRViewsLib.setFileName(QCoreApplication::applicationDirPath() + "/TIRViews.dll");
- FTIRViewsLib.load();
-
- viewsStart = (importTIRViewsStart) FTIRViewsLib.resolve("TIRViewsStart");
- if (viewsStart == NULL) {
- qDebug() << "FTServer::run() says: TIRViewsStart function not found in DLL!";
- }
- else {
- qDebug() << "FTServer::run() says: TIRViewsStart executed!";
- viewsStart();
- }
-
- //
- // Load the Stop function from TIRViews.dll. Call it when terminating the thread.
- //
- viewsStop = (importTIRViewsStop) FTIRViewsLib.resolve("TIRViewsStop");
- if (viewsStop == NULL) {
- qDebug() << "FTServer::run() says: TIRViewsStop function not found in DLL!";
- }
- }
- if (ftnID.at(21) != '0') {
- QString program = QCoreApplication::applicationDirPath() + "/TrackIR.exe";
- dummyTrackIR = new QProcess();
- dummyTrackIR->start(program);
-
- qDebug() << "FTServer::run() says: TrackIR.exe executed!";
- }
- }
}
intGameID = gameID.toInt();
}
@@ -336,6 +327,46 @@ bool FTNoIR_Protocol::checkServerInstallationOK( HANDLE handle )
settings.setValue( "Path" , aLocation );
settingsTIR.setValue( "Path" , aLocation );
+ //
+ // TIRViews must be started first, or the NPClient DLL will never be loaded.
+ //
+ if (useTIRViews) {
+
+ QString aFileName = QCoreApplication::applicationDirPath() + "/TIRViews.dll";
+ if ( QFile::exists( aFileName ) ) {
+
+ FTIRViewsLib.setFileName(aFileName);
+ FTIRViewsLib.load();
+
+ viewsStart = (importTIRViewsStart) FTIRViewsLib.resolve("TIRViewsStart");
+ if (viewsStart == NULL) {
+ qDebug() << "FTServer::run() says: TIRViewsStart function not found in DLL!";
+ }
+ else {
+ qDebug() << "FTServer::run() says: TIRViewsStart executed!";
+ viewsStart();
+ }
+
+ //
+ // Load the Stop function from TIRViews.dll. Call it when terminating the thread.
+ //
+ viewsStop = (importTIRViewsStop) FTIRViewsLib.resolve("TIRViewsStop");
+ if (viewsStop == NULL) {
+ qDebug() << "FTServer::run() says: TIRViewsStop function not found in DLL!";
+ }
+ }
+ }
+
+ //
+ // Check if TIRViews or dummy TrackIR.exe is required for this game
+ //
+ if (useDummyExe) {
+ QString program = QCoreApplication::applicationDirPath() + "/TrackIR.exe";
+ dummyTrackIR = new QProcess();
+ dummyTrackIR->start(program);
+
+ qDebug() << "FTServer::run() says: TrackIR.exe executed!";
+ }
} catch(...) {
diff --git a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h
index 12a20ee8..00f124f6 100644
--- a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h
+++ b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h
@@ -73,10 +73,11 @@ private:
// Private properties
QString ProgramName;
-// QLibrary FTClientLib;
QLibrary FTIRViewsLib;
QProcess *dummyTrackIR;
int intGameID;
+ bool useTIRViews; // Needs to be in the Settings dialog
+ bool useDummyExe;
float getRadsFromDegrees ( float degrees ) { return (degrees * 0.017453f); }
bool getGameData( QString gameID );
diff --git a/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp b/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp
index 62584b43..678b3a5f 100644
--- a/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp
+++ b/FTNoIR_Protocol_FT/ftnoir_protocol_FT_dialog.cpp
@@ -50,7 +50,18 @@ QWidget()
// Connect Qt signals to member-functions
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.chkTIRViews, SIGNAL(stateChanged(int)), this, SLOT(chkTIRViewsChanged()));
+ connect(ui.chkStartDummy, SIGNAL(stateChanged(int)), this, SLOT(settingChanged()));
+
+ aFileName = QCoreApplication::applicationDirPath() + "/TIRViews.dll";
+ if ( !QFile::exists( aFileName ) ) {
+ ui.chkTIRViews->setChecked( false );
+ ui.chkTIRViews->setEnabled ( false );
+ save();
+ }
+ else {
+ ui.chkTIRViews->setEnabled ( true );
+ }
theProtocol = NULL;
@@ -65,11 +76,6 @@ FTControls::~FTControls() {
qDebug() << "~FTControls() says: started";
}
-void FTControls::Release()
-{
- delete this;
-}
-
//
// Initialize tracker-client-dialog
//
@@ -144,6 +150,11 @@ void FTControls::loadSettings() {
// ui.chkTIRViews->setChecked (iniFile.value ( "useTIRViews", 0 ).toBool());
iniFile.endGroup ();
+ iniFile.beginGroup ( "FTIR" );
+ ui.chkTIRViews->setChecked (iniFile.value ( "useTIRViews", 0 ).toBool());
+ ui.chkStartDummy->setChecked (iniFile.value ( "useDummyExe", 1 ).toBool());
+ iniFile.endGroup ();
+
settingsDirty = false;
}
@@ -157,7 +168,11 @@ void FTControls::save() {
QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
iniFile.beginGroup ( "FT" );
-// iniFile.setValue ( "useTIRViews", ui.chkTIRViews->isChecked() );
+ iniFile.endGroup ();
+
+ iniFile.beginGroup ( "FTIR" );
+ iniFile.setValue ( "useTIRViews", ui.chkTIRViews->isChecked() );
+ iniFile.setValue ( "useDummyExe", ui.chkStartDummy->isChecked() );
iniFile.endGroup ();
settingsDirty = false;
diff --git a/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui b/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui
index 021c6ce6..e9f3facb 100644
--- a/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui
+++ b/FaceTrackNoIR/FTNoIR_KeyboardShortcuts.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>672</width>
+ <width>687</width>
<height>438</height>
</rect>
</property>
@@ -682,6 +682,19 @@
</property>
</widget>
</item>
+ <item row="1" column="9">
+ <widget class="QCheckBox" name="chkDisableBeep">
+ <property name="maximumSize">
+ <size>
+ <width>80</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Disable Beep</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index ccd667d0..c9a05dc9 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -23,6 +23,7 @@
*********************************************************************************/
/*
Modifications (last one on top):
+ 20130201 - WVR: Load FreeTrack 2.0 protocol instead of fake TrackIR (which is now obsolete).
20130101 - WVR: Added "None" to filter-listbox to remove "use advanced filtering".
20121209 - WVR: Pre-v170 DLLs will not be added to the Listbox. Initial selection was changed (made case-insensitive).
20121014 - WVR: Added second Tracker Source for Arduino solution. The two will be mutually exclusive.
@@ -494,7 +495,7 @@ void FaceTrackNoIR::loadSettings() {
// Put the filename in the window-title.
//
QFileInfo pathInfo ( currentFile );
- setWindowTitle ( "FaceTrackNoIR (1.7 alpha 10) - " + pathInfo.fileName() );
+ setWindowTitle ( "FaceTrackNoIR (1.7) - " + pathInfo.fileName() );
//
// Get a List of all the INI-files in the (currently active) Settings-folder.
@@ -543,6 +544,7 @@ void FaceTrackNoIR::loadSettings() {
if (selectedProtocolName.length() == 0) {
int index = iniFile.value ( "Selection", 0 ).toInt();
switch ( index ) {
+ case TRACKIR:
case FREE_TRACK:
selectedProtocolName = QString("FTNoIR_Protocol_FT.dll");
break;
@@ -559,10 +561,6 @@ void FaceTrackNoIR::loadSettings() {
selectedProtocolName = QString("FTNoIR_Protocol_FSUIPC.dll");
break;
- case TRACKIR:
- selectedProtocolName = QString("FTNoIR_Protocol_FTIR.dll");
- break;
-
case FLIGHTGEAR:
selectedProtocolName = QString("FTNoIR_Protocol_FG.dll");
break;
@@ -1920,6 +1918,7 @@ int keyindex;
ui.chkCenterShift->setChecked (iniFile.value ( "Shift_Center", 0 ).toBool());
ui.chkCenterCtrl->setChecked (iniFile.value ( "Ctrl_Center", 0 ).toBool());
ui.chkCenterAlt->setChecked (iniFile.value ( "Alt_Center", 0 ).toBool());
+ ui.chkDisableBeep->setChecked (iniFile.value ( "Disable_Beep", 0 ).toBool());
// GameZero key
ui.cbxGameZeroMouseKey->setCurrentIndex( iniFile.value ( "MouseKey_GameZero", 0 ).toInt() );
@@ -2002,6 +2001,7 @@ void KeyboardShortcutDialog::save() {
iniFile.setValue ( "Shift_Center", ui.chkCenterShift->isChecked() );
iniFile.setValue ( "Ctrl_Center", ui.chkCenterCtrl->isChecked() );
iniFile.setValue ( "Alt_Center", ui.chkCenterAlt->isChecked() );
+ iniFile.setValue ( "Disable_Beep", ui.chkDisableBeep->isChecked() );
iniFile.setValue ( "MouseKey_GameZero", ui.cbxGameZeroMouseKey->currentIndex());
iniFile.setValue ( "Keycode_GameZero", keyList.at( ui.cbxGameZeroKey->currentIndex() ) );
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp
index 1266ab01..1dd2cf1b 100644
--- a/FaceTrackNoIR/tracker.cpp
+++ b/FaceTrackNoIR/tracker.cpp
@@ -23,6 +23,7 @@
*********************************************************************************/
/*
Modifications (last one on top):
+ 20130201 - WVR: Remove the Protocol, when stopping the Thread.
20121215 - WVR: Fixed crash after message: protocol not installed correctly... by terminating the thread.
20120921 - WVR: Fixed centering when no filter is selected.
20120917 - WVR: Added Mouse-buttons to ShortKeys.
@@ -102,6 +103,7 @@ TShortKey Tracker::CenterKey; // ShortKey to Center headposition
TShortKey Tracker::StartStopKey; // ShortKey to Start/stop tracking
TShortKey Tracker::InhibitKey; // ShortKey to inhibit axis while tracking
TShortKey Tracker::GameZeroKey; // ShortKey to Set Game Zero
+bool Tracker::DisableBeep = false; // Disable beep when center
//TShortKey Tracker::AxisReverseKey; // ShortKey to start/stop axis reverse while tracking
int Tracker::CenterMouseKey; // ShortKey to Center headposition
@@ -278,6 +280,14 @@ Tracker::~Tracker() {
pSecondTracker = NULL;
}
+ //
+ // Remove the Protocol
+ //
+ if (pProtocol) {
+ delete pProtocol;
+ pProtocol = NULL;
+ }
+
// Close handles
::CloseHandle(m_StopThread);
::CloseHandle(m_WaitThread);
@@ -642,7 +652,9 @@ bool bTracker2Confid = false;
//
if ((Tracker::do_center) || ((bInitialCenter1 && bTracker1Confid ) || (bInitialCenter2 && bTracker2Confid))) {
- MessageBeep (MB_ICONASTERISK);
+ if (!DisableBeep) {
+ MessageBeep (MB_ICONASTERISK); // Acknowledge the key-press with a beep.
+ }
if (pTracker && bTracker1Confid) {
pTracker->notifyCenter(); // Send 'center' to the tracker
bInitialCenter1 = false;
@@ -923,9 +935,9 @@ float sum = 0;
// Load the current Settings from the currently 'active' INI-file.
//
void Tracker::loadSettings() {
-int NeutralZone;
-int sensYaw, sensPitch, sensRoll;
-int sensX, sensY, sensZ;
+//int NeutralZone;
+//int sensYaw, sensPitch, sensRoll;
+//int sensX, sensY, sensZ;
qDebug() << "Tracker::loadSettings says: Starting ";
QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER)
@@ -938,15 +950,15 @@ int sensX, sensY, sensZ;
//
// Read the Tracking settings, to fill the curves.
//
- iniFile.beginGroup ( "Tracking" );
- NeutralZone = iniFile.value ( "NeutralZone", 5 ).toInt();
- sensYaw = iniFile.value ( "sensYaw", 100 ).toInt();
- sensPitch = iniFile.value ( "sensPitch", 100 ).toInt();
- sensRoll = iniFile.value ( "sensRoll", 100 ).toInt();
- sensX = iniFile.value ( "sensX", 100 ).toInt();
- sensY = iniFile.value ( "sensY", 100 ).toInt();
- sensZ = iniFile.value ( "sensZ", 100 ).toInt();
- iniFile.endGroup ();
+ //iniFile.beginGroup ( "Tracking" );
+ //NeutralZone = iniFile.value ( "NeutralZone", 5 ).toInt();
+ //sensYaw = iniFile.value ( "sensYaw", 100 ).toInt();
+ //sensPitch = iniFile.value ( "sensPitch", 100 ).toInt();
+ //sensRoll = iniFile.value ( "sensRoll", 100 ).toInt();
+ //sensX = iniFile.value ( "sensX", 100 ).toInt();
+ //sensY = iniFile.value ( "sensY", 100 ).toInt();
+ //sensZ = iniFile.value ( "sensZ", 100 ).toInt();
+ //iniFile.endGroup ();
//
// Read the keyboard shortcuts.
@@ -959,6 +971,7 @@ int sensX, sensY, sensZ;
CenterKey.shift = iniFile.value ( "Shift_Center", 0 ).toBool();
CenterKey.ctrl = iniFile.value ( "Ctrl_Center", 0 ).toBool();
CenterKey.alt = iniFile.value ( "Alt_Center", 0 ).toBool();
+ DisableBeep = iniFile.value ( "Disable_Beep", 0 ).toBool();
// StartStop key
StartStopMouseKey = iniFile.value ( "MouseKey_StartStop", 0 ).toInt();
diff --git a/FaceTrackNoIR/tracker.h b/FaceTrackNoIR/tracker.h
index 0ddd5df4..4b161293 100644
--- a/FaceTrackNoIR/tracker.h
+++ b/FaceTrackNoIR/tracker.h
@@ -188,6 +188,7 @@ private:
static int StartStopMouseKey; // ShortKey to Start/stop tracking
static int InhibitMouseKey; // ShortKey to disable one or more axis during tracking
static int GameZeroMouseKey; // ShortKey to Set Game Zero
+ static bool DisableBeep; // Disable Beep when center is pressed
// Flags to start/stop/reset tracking
static bool confid; // Tracker data is OK