summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2010-10-23 15:36:16 +0000
committerWim Vriend <facetracknoir@gmail.com>2010-10-23 15:36:16 +0000
commitf3e5ceffbceaf6f9931ad2ac6bad69732d37dd4c (patch)
tree9e519a8db95212147076d1e14225ca831b34918b /FaceTrackNoIR
parent4b7af2d35be630472daadf3b85f289603a7092ad (diff)
Built in support of TIRViews.
Older games like CFS3 require this to be in the program-folder. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@25 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR')
-rw-r--r--FaceTrackNoIR/FTIRServer.cpp192
-rw-r--r--FaceTrackNoIR/FTIRServer.h35
-rw-r--r--FaceTrackNoIR/FTIRTypes.h15
-rw-r--r--FaceTrackNoIR/FTNoIR_FSUIPCcontrols.ui217
-rw-r--r--FaceTrackNoIR/FTNoIR_FTIRcontrols.ui194
-rw-r--r--FaceTrackNoIR/FTServer.cpp1
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.cpp17
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.ui5
-rw-r--r--FaceTrackNoIR/FaceTrackNoIR.vcproj30
-rw-r--r--FaceTrackNoIR/tracker.cpp13
10 files changed, 677 insertions, 42 deletions
diff --git a/FaceTrackNoIR/FTIRServer.cpp b/FaceTrackNoIR/FTIRServer.cpp
index a3298ace..1de4ee87 100644
--- a/FaceTrackNoIR/FTIRServer.cpp
+++ b/FaceTrackNoIR/FTIRServer.cpp
@@ -21,6 +21,7 @@
********************************************************************************/
/*
Modifications (last one on top):
+ 20101023 - WVR: Added TIRViews for FS2004, Combat FS3, etc...
*/
#include "FTIRServer.h"
@@ -40,6 +41,7 @@ FTIRServer::FTIRServer() {
m_StopThread = CreateEvent(0, TRUE, FALSE, 0);
m_WaitThread = CreateEvent(0, TRUE, FALSE, 0);
+ loadSettings();
ProgramName = "";
}
@@ -57,9 +59,10 @@ FTIRServer::~FTIRServer() {
::CloseHandle(m_WaitThread);
//
- // Free the DLL
+ // Free the DLL's
//
FTIRClientLib.unload();
+ FTIRViewsLib.unload();
//terminates the QThread and waits for finishing the QThread
terminate();
@@ -68,7 +71,9 @@ FTIRServer::~FTIRServer() {
/** QThread run @override **/
void FTIRServer::run() {
- importSetPosition setposition;
+ importSetPosition setposition; // Inside NPClient.dll
+ importTIRViewsStart viewsStart = NULL; // Inside TIRViews.dll
+ importTIRViewsStop viewsStop = NULL;
//
// Get the setposition function from the DLL and use it!
@@ -82,11 +87,40 @@ void FTIRServer::run() {
setposition (7.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f);
}
+ //
+ // Load the Start function from TIRViews.dll and call it, to start compatibility with older games
+ //
+ if (useTIRViews) {
+ viewsStart = (importTIRViewsStart) FTIRViewsLib.resolve("TIRViewsStart");
+ if (viewsStart == NULL) {
+ qDebug() << "FTIRServer::run() says: TIRViewsStart function not found in DLL!";
+ }
+ else {
+ qDebug() << "FTIRServer::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() << "FTIRServer::run() says: TIRViewsStop function not found in DLL!";
+ }
+ }
+
+ //
+ // Run, until termination
+ //
forever
{
// Check event for stop thread
if(::WaitForSingleObject(m_StopThread, 0) == WAIT_OBJECT_0)
{
+ if (viewsStop != NULL) {
+ viewsStop();
+ }
+
// Set event
::SetEvent(m_WaitThread);
return;
@@ -224,16 +258,22 @@ bool FTIRServer::FTIRCheckClientDLL()
//
FTIRClientLib.setFileName(aFileName);
FTIRClientLib.load();
- //provider = (importProvider) FTIRClientLib.resolve("FTProvider");
- //if (provider) {
- // pProvider = provider();
- // qDebug() << "FTCheckClientDLL says: Provider =" << pProvider;
- //}
}
else {
QMessageBox::information(0, "FaceTrackNoIR error", QString("Necessary file (NPClient.dll) was NOT found!\n"));
return false;
}
+
+ //
+ // Also load TIRViews.dll, to support some older games
+ //
+ if (useTIRViews) {
+ aFileName = aLocation;
+ aFileName.append(FTIR_VIEWS_FILENAME);
+ FTIRViewsLib.setFileName(aFileName);
+ FTIRViewsLib.load();
+ }
+
} catch(...) {
settings.~QSettings();
}
@@ -259,4 +299,142 @@ double local_x;
return (float) y;
}
+//
+// Load the current Settings from the currently 'active' INI-file.
+//
+void FTIRServer::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)
+
+ iniFile.beginGroup ( "FTIR" );
+ useTIRViews = iniFile.value ( "useTIRViews", 0 ).toBool();
+ iniFile.endGroup ();
+}
+
+//
+// Constructor for server-settings-dialog
+//
+FTIRControls::FTIRControls( QWidget *parent, Qt::WindowFlags f ) :
+QWidget( parent , f)
+{
+ QString aFileName; // File Path and Name
+
+ ui.setupUi( this );
+
+ QPoint offsetpos(100, 100);
+ this->move(parent->pos() + offsetpos);
+
+ // 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()));
+
+ aFileName = QCoreApplication::applicationDirPath() + "/";
+ aFileName.append(FTIR_VIEWS_FILENAME);
+ if ( !QFile::exists( aFileName ) ) {
+ ui.chkTIRViews->setChecked( false );
+ ui.chkTIRViews->setEnabled ( false );
+ }
+ else {
+ ui.chkTIRViews->setEnabled ( true );
+ }
+
+ // Load the settings from the current .INI-file
+ loadSettings();
+}
+
+//
+// Destructor for server-dialog
+//
+FTIRControls::~FTIRControls() {
+ qDebug() << "~FTIRControls() says: started";
+}
+
+//
+// OK clicked on server-dialog
+//
+void FTIRControls::doOK() {
+ save();
+ this->close();
+}
+
+// override show event
+void FTIRControls::showEvent ( QShowEvent * event ) {
+ loadSettings();
+}
+
+//
+// Cancel clicked on server-dialog
+//
+void FTIRControls::doCancel() {
+ //
+ // Ask if changed Settings should be saved
+ //
+ if (settingsDirty) {
+ int ret = QMessageBox::question ( this, "Settings have changed", "Do you want to save the settings?", QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard );
+
+ qDebug() << "doCancel says: answer =" << ret;
+
+ switch (ret) {
+ case QMessageBox::Save:
+ save();
+ this->close();
+ break;
+ case QMessageBox::Discard:
+ this->close();
+ break;
+ case QMessageBox::Cancel:
+ // Cancel was clicked
+ break;
+ default:
+ // should never be reached
+ break;
+ }
+ }
+ else {
+ this->close();
+ }
+}
+
+//
+// Load the current Settings from the currently 'active' INI-file.
+//
+void FTIRControls::loadSettings() {
+
+ qDebug() << "loadSettings says: Starting ";
+ 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)
+
+ qDebug() << "loadSettings says: iniFile = " << currentFile;
+
+ iniFile.beginGroup ( "FTIR" );
+ ui.chkTIRViews->setChecked (iniFile.value ( "useTIRViews", 0 ).toBool());
+ iniFile.endGroup ();
+
+ settingsDirty = false;
+
+}
+
+//
+// Save the current Settings to the currently 'active' INI-file.
+//
+void FTIRControls::save() {
+
+ 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)
+
+ iniFile.beginGroup ( "FTIR" );
+ iniFile.setValue ( "useTIRViews", ui.chkTIRViews->isChecked() );
+ iniFile.endGroup ();
+
+ settingsDirty = false;
+}
+
//END
diff --git a/FaceTrackNoIR/FTIRServer.h b/FaceTrackNoIR/FTIRServer.h
index 503514ec..8585b30f 100644
--- a/FaceTrackNoIR/FTIRServer.h
+++ b/FaceTrackNoIR/FTIRServer.h
@@ -23,7 +23,6 @@
#ifndef INCLUDED_FTIRSERVER_H
#define INCLUDED_FTIRSERVER_H
-//#include "Windows.h"
#include "FTIRTypes.h"
#include <QString>
#include <QMessageBox>
@@ -37,8 +36,10 @@
#include <QUdpSocket>
typedef void (WINAPI *importSetPosition)(float x, float y, float z, float xRot, float yRot, float zRot);
-//typedef bool (WINAPI *importGetData)(TFreeTrackData * data);
-//typedef HANDLE (WINAPI *importGetMapHandle)(void);
+typedef void (WINAPI *importTIRViewsStart)(void);
+typedef void (WINAPI *importTIRViewsStop)(void);
+
+#include "ui_FTNoIR_FTIRcontrols.h"
using namespace std;
@@ -71,7 +72,11 @@ private:
// Private properties
QString ProgramName;
QLibrary FTIRClientLib;
+ QLibrary FTIRViewsLib;
+ bool useTIRViews;
+
static float scale2AnalogLimits( float x, float min_x, float max_x );
+ void loadSettings();
public:
@@ -94,6 +99,30 @@ public:
};
+// Widget that has controls for FTIR server-settings.
+class FTIRControls: public QWidget, public Ui::UICFTIRControls
+{
+ Q_OBJECT
+public:
+
+ explicit FTIRControls( QWidget *parent=0, Qt::WindowFlags f=0 );
+ virtual ~FTIRControls();
+ void showEvent ( QShowEvent * event );
+
+private:
+ Ui::UICFTIRControls ui;
+ void loadSettings();
+ void save();
+
+ /** helper **/
+ bool settingsDirty;
+
+private slots:
+ void doOK();
+ void doCancel();
+ void chkTIRViewsChanged() { settingsDirty = true; };
+};
+
#endif//INCLUDED_FTIRSERVER_H
//END
diff --git a/FaceTrackNoIR/FTIRTypes.h b/FaceTrackNoIR/FTIRTypes.h
index 6402245e..bd19769b 100644
--- a/FaceTrackNoIR/FTIRTypes.h
+++ b/FaceTrackNoIR/FTIRTypes.h
@@ -28,8 +28,6 @@
#include <tchar.h>
#include <stdio.h>
-//#include "Registry.h"
-
//
// Versioning hasn't been worked out yet...
//
@@ -92,13 +90,10 @@ typedef enum tagNPResult
NP_ERR_INTERNAL_DATA
} NPRESULT;
-// static const char* FTIR_CLIENT_LOCATION = "Software\\NaturalPoint\\NATURALPOINT\\NPClient Location";
static const char* FTIR_CLIENT_FILENAME = "NPClient.dll";
+ static const char* FTIR_VIEWS_FILENAME = "TIRViews.dll";
static const char* FTIR_MM_DATA = "{0F98177E-0E5C-4F86-8837-229D19B1701D}";
-// static const char* FTIR_MM_DATA = "FT_TIR_SharedMem";
-// static const char* FREETRACK = "Freetrack";
static const char* FTIR_MUTEX = "FT_TIR_Mutex";
-// static const char* FT_PROGRAMID = "FT_ProgramID";
static const char* FTIR_REGISTER_PROGRAMHANDLE = "FT_Register_Program_Handle";
static const char* FTIR_UNREGISTER_PROGRAMHANDLE = "FT_UnRegister_Program_Handle";
@@ -123,14 +118,6 @@ typedef struct tagTrackIRData
float fNPSmoothX;
float fNPSmoothY;
float fNPSmoothZ;
-
- //// unsigned short wError;
- //// short iFrame;
- //// unsigned short wUnknown3;
- ////float xRot, yRot, zRot;
- //// float x,y,z;
- ////int iPadding[9];
-
} TRACKIRDATA, *LPTRACKIRDATA;
struct FTIRMemMap {
diff --git a/FaceTrackNoIR/FTNoIR_FSUIPCcontrols.ui b/FaceTrackNoIR/FTNoIR_FSUIPCcontrols.ui
new file mode 100644
index 00000000..7dc627b0
--- /dev/null
+++ b/FaceTrackNoIR/FTNoIR_FSUIPCcontrols.ui
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UICFSUIPCControls</class>
+ <widget class="QWidget" name="UICFSUIPCControls">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>541</width>
+ <height>127</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>FSUIPC settings FaceTrackNoIR</string>
+ </property>
+ <property name="windowIcon">
+ <iconset>
+ <normaloff>images/FaceTrackNoIR.ico</normaloff>images/FaceTrackNoIR.ico</iconset>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" name="_vertical_layout">
+ <item>
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="textLabel2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Location of FSUIPC.dll:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="txtLocationOfDLL">
+ <property name="minimumSize">
+ <size>
+ <width>230</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Location of FSUIPC.dll</string>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Sunken</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="text">
+ <string>Location of FSUIPC.dll</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnFindDLL">
+ <property name="maximumSize">
+ <size>
+ <width>35</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item>
+ <widget class="QPushButton" name="btnOK">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnCancel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+ <slots>
+ <slot>startEngineClicked()</slot>
+ <slot>stopEngineClicked()</slot>
+ <slot>cameraSettingsClicked()</slot>
+ </slots>
+</ui>
diff --git a/FaceTrackNoIR/FTNoIR_FTIRcontrols.ui b/FaceTrackNoIR/FTNoIR_FTIRcontrols.ui
new file mode 100644
index 00000000..a2d06d2a
--- /dev/null
+++ b/FaceTrackNoIR/FTNoIR_FTIRcontrols.ui
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UICFTIRControls</class>
+ <widget class="QWidget" name="UICFTIRControls">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>411</width>
+ <height>157</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>FTIR settings FaceTrackNoIR</string>
+ </property>
+ <property name="windowIcon">
+ <iconset>
+ <normaloff>images/FaceTrackNoIR.ico</normaloff>images/FaceTrackNoIR.ico</iconset>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" name="_vertical_layout">
+ <item>
+ <layout class="QHBoxLayout">
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="chkTIRViews">
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text">
+ <string>Use TIRViews</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>TIRViews is only required for some older games (like CFS3).</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <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>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>If the checkbox is disabled, the DLL was not found.</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item>
+ <widget class="QPushButton" name="btnOK">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnCancel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+ <slots>
+ <slot>startEngineClicked()</slot>
+ <slot>stopEngineClicked()</slot>
+ <slot>cameraSettingsClicked()</slot>
+ </slots>
+</ui>
diff --git a/FaceTrackNoIR/FTServer.cpp b/FaceTrackNoIR/FTServer.cpp
index ff273cc3..2bd3d5f5 100644
--- a/FaceTrackNoIR/FTServer.cpp
+++ b/FaceTrackNoIR/FTServer.cpp
@@ -30,6 +30,7 @@
//
// The FaceAPI only runs in the 'Release' configuration. It may have something to
// do with compiler-settings, but for now it's not solved...
+// --> WVR 20101023: This was solved by downgrading to VS2005...
//
// Connecting with the Freetrack DLL only seems to work, when UNICODE is OFF.
// That's strange, isn't it?
diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp
index ffa38344..3f3d3018 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.cpp
+++ b/FaceTrackNoIR/FaceTrackNoIR.cpp
@@ -26,6 +26,7 @@
#include "tracker.h"
#include "PPJoyServer.h"
#include "FSUIPCServer.h"
+#include "FTIRServer.h"
using namespace sm::faceapi;
using namespace sm::faceapi::qt;
@@ -661,7 +662,6 @@ void FaceTrackNoIR::showServerControls() {
case FREE_TRACK:
case FLIGHTGEAR:
case FTNOIR:
- case TRACKIR:
case SIMCONNECT:
break;
case PPJOY:
@@ -670,6 +670,9 @@ void FaceTrackNoIR::showServerControls() {
case FSUIPC:
_server_controls = new FSUIPCControls( this, Qt::Dialog );
break;
+ case TRACKIR:
+ _server_controls = new FTIRControls( this, Qt::Dialog );
+ break;
default:
break;
}
@@ -757,16 +760,16 @@ void FaceTrackNoIR::createIconGroupBox()
//
void FaceTrackNoIR::createActions()
{
- minimizeAction = new QAction(tr("Mi&nimize"), this);
+ minimizeAction = new QAction(tr("Mi&nimize FaceTrackNoIR"), this);
connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide()));
//maximizeAction = new QAction(tr("Ma&ximize"), this);
//connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
- restoreAction = new QAction(tr("&Restore"), this);
+ restoreAction = new QAction(tr("&Restore FaceTrackNoIR"), this);
connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
- quitAction = new QAction(tr("&Quit"), this);
+ quitAction = new QAction(tr("&Quit FaceTrackNoIR"), this);
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
}
@@ -810,16 +813,12 @@ void FaceTrackNoIR::setIcon(int index)
case FREE_TRACK:
case FLIGHTGEAR:
case FTNOIR:
- case TRACKIR:
case SIMCONNECT:
ui.btnShowServerControls->hide();
break;
case PPJOY:
- ui.btnShowServerControls->show();
- ui.btnShowServerControls->setEnabled ( true );
- break;
-
case FSUIPC:
+ case TRACKIR:
ui.btnShowServerControls->show();
ui.btnShowServerControls->setEnabled ( true );
break;
diff --git a/FaceTrackNoIR/FaceTrackNoIR.ui b/FaceTrackNoIR/FaceTrackNoIR.ui
index 042a11b9..3ef87463 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.ui
+++ b/FaceTrackNoIR/FaceTrackNoIR.ui
@@ -934,7 +934,7 @@ color:#000;</string>
</rect>
</property>
<property name="toolTip">
- <string>Change tracker settings</string>
+ <string>Change game protocol settings</string>
</property>
<property name="styleSheet">
<string notr="true"/>
@@ -947,6 +947,9 @@ color:#000;</string>
</item>
<item>
<widget class="QPushButton" name="btnEditCurves">
+ <property name="toolTip">
+ <string>Edit the Curve settings</string>
+ </property>
<property name="text">
<string>Curves</string>
</property>
diff --git a/FaceTrackNoIR/FaceTrackNoIR.vcproj b/FaceTrackNoIR/FaceTrackNoIR.vcproj
index ae73dc1c..417ebb20 100644
--- a/FaceTrackNoIR/FaceTrackNoIR.vcproj
+++ b/FaceTrackNoIR/FaceTrackNoIR.vcproj
@@ -578,6 +578,32 @@
</FileConfiguration>
</File>
<File
+ RelativePath=".\FTNoIR_FTIRcontrols.ui"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Uic&apos;ing $(InputFileName)..."
+ CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;.\GeneratedFiles\ui_$(InputName).h&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="&quot;.\GeneratedFiles\ui_$(InputName).h&quot;"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ Description="Uic&apos;ing $(InputFileName)..."
+ CommandLine="&quot;$(QTDIR)\bin\uic.exe&quot; -o &quot;.\GeneratedFiles\ui_$(InputName).h&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+ AdditionalDependencies="$(QTDIR)\bin\uic.exe"
+ Outputs="&quot;.\GeneratedFiles\ui_$(InputName).h&quot;"
+ />
+ </FileConfiguration>
+ </File>
+ <File
RelativePath=".\FTNoIR_KeyboardShortcuts.ui"
>
<FileConfiguration
@@ -715,6 +741,10 @@
>
</File>
<File
+ RelativePath=".\GeneratedFiles\ui_FTNoIR_FTIRcontrols.h"
+ >
+ </File>
+ <File
RelativePath=".\GeneratedFiles\ui_FTNoIR_KeyboardShortcuts.h"
>
</File>
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp
index 374b45b2..4c6d619b 100644
--- a/FaceTrackNoIR/tracker.cpp
+++ b/FaceTrackNoIR/tracker.cpp
@@ -262,7 +262,7 @@ void Tracker::setup(QWidget *head, FaceTrackNoIR *parent) {
server_FSUIPC->start(); // Start the thread
}
else {
- QMessageBox::information(mainApp, "FaceTrackNoIR error", "FSUIPC is not (correctly) installed!");
+ QMessageBox::information(mainApp, "FaceTrackNoIR error", "FSUIPC is not (correctly) installed!\nIt should be placed in the Modules folder of FS!");
}
}
@@ -340,13 +340,7 @@ void Tracker::run() {
}
else {
//
- // Check the state of the BACK key (= Start/Stop tracking) and EQUALS key (= Center)
- //
- if ( isShortKeyPressed( &CenterKey, &keystate[0] ) ) {
- qDebug() << "Tracker::run Shortkey Center pressed!" << GetLastError();
- }
- //
- // Check the state of the BACK key (= Start/Stop tracking) and EQUALS key (= Center)
+ // Check the state of the Start/Stop key
//
if ( isShortKeyPressed( &StartStopKey, &keystate[0] ) && (!lastBackKey) ) {
Tracker::do_tracking = !Tracker::do_tracking;
@@ -382,6 +376,9 @@ void Tracker::run() {
}
lastBackKey = isShortKeyPressed( &StartStopKey, &keystate[0] ); // Remember
+ //
+ // Check the state of the Center key
+ //
if ( isShortKeyPressed( &CenterKey, &keystate[0] ) && (!lastEqualsKey) ) {
Tracker::do_center = true;
qDebug() << "Tracker::run() says Center pressed";