From 289ee4f5352edab1fa31311ef6a800e7d9998acd Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Fri, 27 Apr 2012 09:50:19 +0000 Subject: Changed filling protocol Listbox to match the Filter and Tracker. git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@109 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Protocol_Base/ftnoir_protocol_base.h | 38 +++ FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.h | 9 + FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.vcproj | 46 ++++ FTNoIR_Protocol_FG/Protocol.qrc | 5 + FTNoIR_Protocol_FG/images/FlightGear.ico | Bin 0 -> 13094 bytes FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.h | 9 + .../FTNoIR_Protocol_FSUIPC.vcproj | 52 +++- FTNoIR_Protocol_FSUIPC/Protocol.qrc | 5 + FTNoIR_Protocol_FSUIPC/images/FS9.ico | Bin 0 -> 29926 bytes FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h | 9 + FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.vcproj | 46 ++++ FTNoIR_Protocol_FT/Protocol.qrc | 5 + FTNoIR_Protocol_FT/images/Freetrack.ico | Bin 0 -> 17542 bytes FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h | 9 + FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj | 46 ++++ FTNoIR_Protocol_FTIR/Protocol.qrc | 5 + FTNoIR_Protocol_FTIR/images/TrackIR.ico | Bin 0 -> 15086 bytes FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h | 9 + FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.vcproj | 46 ++++ FTNoIR_Protocol_FTN/Protocol.qrc | 5 + FTNoIR_Protocol_FTN/images/FaceTrackNoIR.ico | Bin 0 -> 23558 bytes FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.h | 9 + FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.vcproj | 46 ++++ FTNoIR_Protocol_MOUSE/FTNoIR_mousecontrols.ui | 10 +- FTNoIR_Protocol_MOUSE/Protocol.qrc | 5 + FTNoIR_Protocol_MOUSE/images/Mouse.ico | Bin 0 -> 17542 bytes FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.h | 9 + FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.vcproj | 46 ++++ FTNoIR_Protocol_PPJOY/Protocol.qrc | 5 + FTNoIR_Protocol_PPJOY/images/PPJoy.ico | Bin 0 -> 5166 bytes FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.h | 9 + FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.vcproj | 46 ++++ FTNoIR_Protocol_SC/Protocol.qrc | 5 + FTNoIR_Protocol_SC/images/FSX.ico | Bin 0 -> 87910 bytes FaceTrackNoIR/FaceTrackNoIR.cpp | 295 ++++++++++++--------- FaceTrackNoIR/FaceTrackNoIR.h | 7 +- FaceTrackNoIR/FaceTrackNoIR.qrc | 7 - FaceTrackNoIR/FaceTrackNoIR.ui | 4 +- FaceTrackNoIR/images/FlightGear.ico | Bin 13094 -> 0 bytes FaceTrackNoIR/images/Freetrack.ico | Bin 17542 -> 0 bytes FaceTrackNoIR/images/PPJoy.ico | Bin 5166 -> 0 bytes FaceTrackNoIR/images/TrackIR.ico | Bin 15086 -> 0 bytes FaceTrackNoIR/tracker.cpp | 74 +----- FaceTrackNoIR/tracker.h | 4 +- List of compatible games.xls | Bin 40448 -> 40448 bytes faceAPI/FaceAPI2FSX.vcproj | 2 +- 46 files changed, 708 insertions(+), 219 deletions(-) create mode 100644 FTNoIR_Protocol_FG/Protocol.qrc create mode 100644 FTNoIR_Protocol_FG/images/FlightGear.ico create mode 100644 FTNoIR_Protocol_FSUIPC/Protocol.qrc create mode 100644 FTNoIR_Protocol_FSUIPC/images/FS9.ico create mode 100644 FTNoIR_Protocol_FT/Protocol.qrc create mode 100644 FTNoIR_Protocol_FT/images/Freetrack.ico create mode 100644 FTNoIR_Protocol_FTIR/Protocol.qrc create mode 100644 FTNoIR_Protocol_FTIR/images/TrackIR.ico create mode 100644 FTNoIR_Protocol_FTN/Protocol.qrc create mode 100644 FTNoIR_Protocol_FTN/images/FaceTrackNoIR.ico create mode 100644 FTNoIR_Protocol_MOUSE/Protocol.qrc create mode 100644 FTNoIR_Protocol_MOUSE/images/Mouse.ico create mode 100644 FTNoIR_Protocol_PPJOY/Protocol.qrc create mode 100644 FTNoIR_Protocol_PPJOY/images/PPJoy.ico create mode 100644 FTNoIR_Protocol_SC/Protocol.qrc create mode 100644 FTNoIR_Protocol_SC/images/FSX.ico delete mode 100644 FaceTrackNoIR/images/FlightGear.ico delete mode 100644 FaceTrackNoIR/images/Freetrack.ico delete mode 100644 FaceTrackNoIR/images/PPJoy.ico delete mode 100644 FaceTrackNoIR/images/TrackIR.ico diff --git a/FTNoIR_Protocol_Base/ftnoir_protocol_base.h b/FTNoIR_Protocol_Base/ftnoir_protocol_base.h index c9fbdd1c..20569409 100644 --- a/FTNoIR_Protocol_Base/ftnoir_protocol_base.h +++ b/FTNoIR_Protocol_Base/ftnoir_protocol_base.h @@ -1,3 +1,32 @@ +/******************************************************************************** +* FaceTrackNoIR This program is a private project of the some enthusiastic * +* gamers from Holland, who don't like to pay much for * +* head-tracking. * +* * +* Copyright (C) 2010 Wim Vriend (Developing) * +* Ron Hendriks (Researching and Testing) * +* * +* Homepage * +* * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the * +* Free Software Foundation; either version 3 of the License, or (at your * +* option) any later version. * +* * +* This program is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along * +* with this program; if not, see . * +* This class implements a tracker-base * +*********************************************************************************/ +/* + Modifications (last one on top): + 20110415 - WVR: Added overloaded operator - and -= +*/ + #ifndef FTNOIR_PROTOCOL_BASE_H #define FTNOIR_PROTOCOL_BASE_H @@ -22,6 +51,10 @@ struct IProtocol virtual bool checkServerInstallationOK ( HANDLE handle ) = 0; virtual void sendHeadposeToGame( T6DOF *headpose ) = 0; virtual void getNameFromGame( char *dest ) = 0; // Take care dest can handle up to 100 chars... + + virtual void getFullName(QString *strToBeFilled) = 0; + virtual void getShortName(QString *strToBeFilled) = 0; + virtual void getDescription(QString *strToBeFilled) = 0; }; // Handle type. In C++ language the iterface type is used. @@ -53,6 +86,11 @@ struct IProtocolDialog { virtual void Release() = 0; // Member required to enable Auto-remove virtual void Initialize(QWidget *parent) = 0; + + virtual void getFullName(QString *strToBeFilled) = 0; + virtual void getShortName(QString *strToBeFilled) = 0; + virtual void getDescription(QString *strToBeFilled) = 0; + virtual void getIcon(QIcon *icon) = 0; }; // Handle type. In C++ language the iterface type is used. diff --git a/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.h b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.h index 63b64f16..216095bf 100644 --- a/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.h +++ b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.h @@ -52,6 +52,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear UDP protocol"); }; + private: // Tracker *headTracker; // For upstream messages... TFlightGearData FlightData; @@ -78,6 +82,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("FlightGear UDP protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/FlightGear.ico"); }; + private: Ui::UICFGControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.vcproj b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.vcproj index 8fccf7f8..9e34aa64 100644 --- a/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.vcproj +++ b/FTNoIR_Protocol_FG/FTNoIR_Protocol_FG.vcproj @@ -254,6 +254,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FG/Protocol.qrc b/FTNoIR_Protocol_FG/Protocol.qrc new file mode 100644 index 00000000..1e715ac9 --- /dev/null +++ b/FTNoIR_Protocol_FG/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/FlightGear.ico + + diff --git a/FTNoIR_Protocol_FG/images/FlightGear.ico b/FTNoIR_Protocol_FG/images/FlightGear.ico new file mode 100644 index 00000000..f96c0f88 Binary files /dev/null and b/FTNoIR_Protocol_FG/images/FlightGear.ico differ diff --git a/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.h b/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.h index 70785fae..196a107a 100644 --- a/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.h +++ b/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.h @@ -68,6 +68,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FS2002/FS2004"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FSUIPC"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Microsoft FS2004 protocol"); }; + private: // Private properties QString ProgramName; @@ -92,6 +96,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FS2002/FS2004"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FSUIPC"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Microsoft FS2004 protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/FS9.ico"); }; + private: Ui::UICFSUIPCControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.vcproj b/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.vcproj index 03ded14b..9722f354 100644 --- a/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.vcproj +++ b/FTNoIR_Protocol_FSUIPC/FTNoIR_Protocol_FSUIPC.vcproj @@ -38,7 +38,7 @@ /> @@ -251,6 +251,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FSUIPC/Protocol.qrc b/FTNoIR_Protocol_FSUIPC/Protocol.qrc new file mode 100644 index 00000000..2830d09a --- /dev/null +++ b/FTNoIR_Protocol_FSUIPC/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/FS9.ico + + diff --git a/FTNoIR_Protocol_FSUIPC/images/FS9.ico b/FTNoIR_Protocol_FSUIPC/images/FS9.ico new file mode 100644 index 00000000..9afd1953 Binary files /dev/null and b/FTNoIR_Protocol_FSUIPC/images/FS9.ico differ diff --git a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h index 02e9525f..9d0a5033 100644 --- a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h +++ b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.h @@ -55,6 +55,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FreeTrack"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FreeTrack"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("FreeTrack protocol"); }; + private: bool FTCreateMapping(HANDLE handle); void FTDestroyMapping(); @@ -88,6 +92,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FreeTrack"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FreeTrack"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("FreeTrack protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/Freetrack.ico"); }; + private: Ui::UICFTControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.vcproj b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.vcproj index 3b5a21dc..80fcdfed 100644 --- a/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.vcproj +++ b/FTNoIR_Protocol_FT/FTNoIR_Protocol_FT.vcproj @@ -254,6 +254,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FT/Protocol.qrc b/FTNoIR_Protocol_FT/Protocol.qrc new file mode 100644 index 00000000..25ecc6fe --- /dev/null +++ b/FTNoIR_Protocol_FT/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/Freetrack.ico + + diff --git a/FTNoIR_Protocol_FT/images/Freetrack.ico b/FTNoIR_Protocol_FT/images/Freetrack.ico new file mode 100644 index 00000000..02554c3d Binary files /dev/null and b/FTNoIR_Protocol_FT/images/Freetrack.ico differ diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h index 90518394..29b16e4b 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.h @@ -59,6 +59,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("fake TrackIR"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FTIR"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("TrackIR V4 protocol"); }; + private: bool FTIRCreateMapping(HANDLE handle); void FTIRDestroyMapping(); @@ -98,6 +102,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("fake TrackIR"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FTIR"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("TrackIR V4 protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/TrackIR.ico"); }; + private: Ui::UICFTIRControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj index 6e4b6c35..d258f30e 100644 --- a/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj +++ b/FTNoIR_Protocol_FTIR/FTNoIR_Protocol_FTIR.vcproj @@ -254,6 +254,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FTIR/Protocol.qrc b/FTNoIR_Protocol_FTIR/Protocol.qrc new file mode 100644 index 00000000..a527e454 --- /dev/null +++ b/FTNoIR_Protocol_FTIR/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/TrackIR.ico + + diff --git a/FTNoIR_Protocol_FTIR/images/TrackIR.ico b/FTNoIR_Protocol_FTIR/images/TrackIR.ico new file mode 100644 index 00000000..99e02e7b Binary files /dev/null and b/FTNoIR_Protocol_FTIR/images/TrackIR.ico differ diff --git a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h index f90c0eac..8f0aa478 100644 --- a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h +++ b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h @@ -52,6 +52,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FaceTrackNoIR"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FTN Client"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("FaceTrackNoIR Client protocol"); }; + private: THeadPoseData TestData; long frame_counter; @@ -78,6 +82,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FaceTrackNoIR"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("FTN Client"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("FaceTrackNoIR Client protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/FaceTrackNoIR.ico"); }; + private: Ui::UICFTNControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.vcproj b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.vcproj index 276c79d3..3a59a74b 100644 --- a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.vcproj +++ b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.vcproj @@ -250,6 +250,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_FTN/Protocol.qrc b/FTNoIR_Protocol_FTN/Protocol.qrc new file mode 100644 index 00000000..b69d1f3f --- /dev/null +++ b/FTNoIR_Protocol_FTN/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/FaceTrackNoIR.ico + + diff --git a/FTNoIR_Protocol_FTN/images/FaceTrackNoIR.ico b/FTNoIR_Protocol_FTN/images/FaceTrackNoIR.ico new file mode 100644 index 00000000..5115066c Binary files /dev/null and b/FTNoIR_Protocol_FTN/images/FaceTrackNoIR.ico differ diff --git a/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.h b/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.h index af9574ca..dfe4ae3e 100644 --- a/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.h +++ b/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.h @@ -71,6 +71,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("Mouse Look"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("Mouse Look"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Mouse Look protocol"); }; + private: HANDLE h; INPUT MouseStruct; @@ -107,6 +111,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("Mouse Look"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("Mouse Look"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Mouse Look protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/Mouse.ico"); }; + private: Ui::UICMOUSEControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.vcproj b/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.vcproj index 1cfa3218..ec50f7ad 100644 --- a/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.vcproj +++ b/FTNoIR_Protocol_MOUSE/FTNoIR_Protocol_MOUSE.vcproj @@ -250,6 +250,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_MOUSE/FTNoIR_mousecontrols.ui b/FTNoIR_Protocol_MOUSE/FTNoIR_mousecontrols.ui index bb32ff11..4a6cc3b9 100644 --- a/FTNoIR_Protocol_MOUSE/FTNoIR_mousecontrols.ui +++ b/FTNoIR_Protocol_MOUSE/FTNoIR_mousecontrols.ui @@ -11,11 +11,11 @@ - PPJoy settings FaceTrackNoIR + MouseLook settings FaceTrackNoIR - - images/FaceTrackNoIR.icoimages/FaceTrackNoIR.ico + + :/images/Mouse.ico:/images/Mouse.ico Qt::LeftToRight @@ -403,7 +403,9 @@ - + + + slideSensX diff --git a/FTNoIR_Protocol_MOUSE/Protocol.qrc b/FTNoIR_Protocol_MOUSE/Protocol.qrc new file mode 100644 index 00000000..0e5e11d9 --- /dev/null +++ b/FTNoIR_Protocol_MOUSE/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/Mouse.ico + + diff --git a/FTNoIR_Protocol_MOUSE/images/Mouse.ico b/FTNoIR_Protocol_MOUSE/images/Mouse.ico new file mode 100644 index 00000000..1151ab2b Binary files /dev/null and b/FTNoIR_Protocol_MOUSE/images/Mouse.ico differ diff --git a/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.h b/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.h index d1cfa05d..97f064db 100644 --- a/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.h +++ b/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.h @@ -72,6 +72,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("PPJoy Virtual Joystick"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("PPJoy"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("PPJoy virtual joystick protocol"); }; + private: HANDLE h; JOYSTICK_STATE JoyState; @@ -103,6 +107,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("PPJoy Virtual Joystick"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("PPJoy"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("PPJoy virtual joystick protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/PPJoy.ico"); }; + private: Ui::UICPPJOYControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.vcproj b/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.vcproj index 222cb2ab..e8332f65 100644 --- a/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.vcproj +++ b/FTNoIR_Protocol_PPJOY/FTNoIR_Protocol_PPJOY.vcproj @@ -254,6 +254,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_PPJOY/Protocol.qrc b/FTNoIR_Protocol_PPJOY/Protocol.qrc new file mode 100644 index 00000000..bc9884e2 --- /dev/null +++ b/FTNoIR_Protocol_PPJOY/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/PPJoy.ico + + diff --git a/FTNoIR_Protocol_PPJOY/images/PPJoy.ico b/FTNoIR_Protocol_PPJOY/images/PPJoy.ico new file mode 100644 index 00000000..f94f8d65 Binary files /dev/null and b/FTNoIR_Protocol_PPJOY/images/PPJoy.ico differ diff --git a/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.h b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.h index 1b98fab4..33e08838 100644 --- a/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.h +++ b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.h @@ -90,6 +90,10 @@ public: void sendHeadposeToGame( T6DOF *headpose ); void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars... + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FSX SimConnect"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("SimConnect"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Microsoft SimConnect protocol"); }; + private: // Private properties QString ProgramName; @@ -140,6 +144,11 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent); + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FSX SimConnect"); }; + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("SimConnect"); }; + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Microsoft SimConnect protocol"); }; + void getIcon(QIcon *icon) { *icon = QIcon(":/images/FSX.ico"); }; + private: Ui::UICSCControls ui; void loadSettings(); diff --git a/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.vcproj b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.vcproj index 141f3266..c37c64e1 100644 --- a/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.vcproj +++ b/FTNoIR_Protocol_SC/FTNoIR_Protocol_SC.vcproj @@ -251,6 +251,32 @@ UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}" ParseFiles="false" > + + + + + + + + + + + + + + + + diff --git a/FTNoIR_Protocol_SC/Protocol.qrc b/FTNoIR_Protocol_SC/Protocol.qrc new file mode 100644 index 00000000..de6018af --- /dev/null +++ b/FTNoIR_Protocol_SC/Protocol.qrc @@ -0,0 +1,5 @@ + + + images/FSX.ico + + diff --git a/FTNoIR_Protocol_SC/images/FSX.ico b/FTNoIR_Protocol_SC/images/FSX.ico new file mode 100644 index 00000000..1c71d409 Binary files /dev/null and b/FTNoIR_Protocol_SC/images/FSX.ico differ diff --git a/FaceTrackNoIR/FaceTrackNoIR.cpp b/FaceTrackNoIR/FaceTrackNoIR.cpp index bb078b07..afa5f9ef 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.cpp +++ b/FaceTrackNoIR/FaceTrackNoIR.cpp @@ -23,7 +23,9 @@ *********************************************************************************/ /* Modifications (last one on top): - 20120317 - WVR: The Filter and Tracker-code was moved to separate DLL's. The calling-method + 20120427 - WVR: The Protocol-code was already in separate DLLs, but the ListBox was still filled ´statically´. Now, a Dir() of the + EXE-folder is done, to locate Protocol-DLLs. The Icons were also moved to the DLLs + 20120317 - WVR: The Filter and Tracker-code was moved to separate DLLs. The calling-method was changed accordingly. The save() and LoadSettings() functions were adapted. The face-tracker member-functions NotifyZeroed and refreshVideo were added, as requested by Stanislaw. @@ -154,9 +156,9 @@ void FaceTrackNoIR::setupFaceTrackNoIR() { loadSettings(); trayIcon->show(); + connect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int))); connect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int))); connect(ui.iconcomboTrackerSource, SIGNAL(currentIndexChanged(int)), this, SLOT(trackingSourceSelected(int))); - connect(ui.iconcomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setIcon(int))); connect(ui.iconcomboFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(filterSelected(int))); //Setup the timer for automatically minimizing after StartTracker. @@ -227,6 +229,14 @@ QFrame *FaceTrackNoIR::getVideoWidget() { return ui.video_frame; } +// +// Return the name of the Protocol-DLL +// +QString FaceTrackNoIR::getCurrentProtocolName() +{ + return protocolFileList.at(ui.iconcomboProtocol->currentIndex()); +} + // // Return the name of the Filter-DLL // @@ -356,7 +366,8 @@ void FaceTrackNoIR::save() { iniFile.endGroup (); iniFile.beginGroup ( "GameProtocol" ); - iniFile.setValue ( "Selection", ui.iconcomboBox->currentIndex() ); + iniFile.setValue ( "Selection", ui.iconcomboProtocol->currentIndex() ); + iniFile.setValue ( "DLL", getCurrentProtocolName() ); iniFile.endGroup (); iniFile.beginGroup ( "TrackerSource" ); @@ -481,18 +492,73 @@ void FaceTrackNoIR::loadSettings() { iniFile.endGroup (); + // + // Read the currently selected Protocol from the INI-file. + // If the setting "DLL" isn't found (pre-1.7 version of INI), then the setting 'Selection' is evaluated. + // iniFile.beginGroup ( "GameProtocol" ); - ui.iconcomboBox->setCurrentIndex(iniFile.value ( "Selection", 0 ).toInt()); - setIcon( ui.iconcomboBox->currentIndex() ); + + QString selectedProtocolName = iniFile.value ( "DLL", "" ).toString(); + qDebug() << "loadSettings says: selectedProtocolName = " << selectedProtocolName; + + if (selectedProtocolName.length() == 0) { + int index = iniFile.value ( "Selection", 0 ).toInt(); + switch ( index ) { + case FREE_TRACK: + selectedProtocolName = QString("FTNoIR_Protocol_FT.dll"); + break; + + case SIMCONNECT: + selectedProtocolName = QString("FTNoIR_Protocol_SC.dll"); + break; + + case PPJOY: + selectedProtocolName = QString("FTNoIR_Protocol_PPJOY.dll"); + break; + + case FSUIPC: + 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; + + case FTNOIR: + selectedProtocolName = QString("FTNoIR_Protocol_FTN.dll"); + break; + + case MOUSE: + selectedProtocolName = QString("FTNoIR_Protocol_MOUSE.dll"); + break; + + default: + selectedProtocolName = QString("FTNoIR_Protocol_MOUSE.dll"); + break; + } + } iniFile.endGroup (); + disconnect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int))); + for ( int i = 0; i < protocolFileList.size(); i++) { + if (protocolFileList.at(i) == selectedProtocolName) { + ui.iconcomboProtocol->setCurrentIndex( i ); + } + } + connect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int))); + protocolSelected( ui.iconcomboProtocol->currentIndex() ); + // // Read the currently selected Tracker from the INI-file. // If the setting "DLL" isn't found (pre-1.7 version), then the setting 'Selection' is evaluated. // iniFile.beginGroup ( "TrackerSource" ); QString selectedTrackerName = iniFile.value ( "DLL", "" ).toString(); - qDebug() << "createIconGroupBox says: selectedTrackerName = " << selectedTrackerName; + qDebug() << "loadSettings says: selectedTrackerName = " << selectedTrackerName; if (selectedTrackerName.length() == 0) { int index = iniFile.value ( "Selection", 0 ).toInt(); switch ( index ) { @@ -571,7 +637,7 @@ void FaceTrackNoIR::startTracker( ) { // // Create the Tracker and setup // - tracker = new Tracker ( ui.iconcomboBox->currentIndex(), ui.iconcomboTrackerSource->currentIndex(), this ); + tracker = new Tracker ( this ); // // Setup the Tracker and send the settings. @@ -610,7 +676,7 @@ void FaceTrackNoIR::startTracker( ) { // Enable/disable Protocol-server Settings ui.iconcomboTrackerSource->setEnabled ( false ); - ui.iconcomboBox->setEnabled ( false ); + ui.iconcomboProtocol->setEnabled ( false ); ui.btnShowServerControls->setEnabled ( false ); ui.iconcomboFilter->setEnabled ( false ); @@ -698,7 +764,7 @@ void FaceTrackNoIR::stopTracker( ) { ui.btnStartTracker->setEnabled ( true ); ui.btnStopTracker->setEnabled ( false ); // ui.btnShowEngineControls->setEnabled ( false ); - ui.iconcomboBox->setEnabled ( true ); + ui.iconcomboProtocol->setEnabled ( true ); ui.iconcomboTrackerSource->setEnabled ( true ); ui.iconcomboFilter->setEnabled ( true ); @@ -858,20 +924,6 @@ QString libName; libName.clear(); libName = getCurrentTrackerName(); - //switch (ui.iconcomboTrackerSource->currentIndex()) { - // case FT_SM_FACEAPI: // Face API - // qDebug() << "FaceTrackNoIR::showEngineControls case FT_SM_FACEAPI."; - // break; - - // case FT_FTNOIR: // FTNoir server - // qDebug() << "FaceTrackNoIR::showEngineControls case FT_FTNOIR."; - // libName = QString("FTNoIR_Tracker.dll"); - // break; - - // default: - // break; - //} - // // Load the Server-settings dialog (if any) and show it. // @@ -915,38 +967,7 @@ QString libName; // Show the appropriate Protocol-server Settings libName.clear(); - switch (ui.iconcomboBox->currentIndex()) { - case FREE_TRACK: - case SIMCONNECT: - break; - - case PPJOY: - libName = QString("FTNoIR_Protocol_PPJOY.dll"); - break; - - case FSUIPC: - libName = QString("FTNoIR_Protocol_FSUIPC.dll"); - break; - - case TRACKIR: - libName = QString("FTNoIR_Protocol_FTIR.dll"); - break; - - case FLIGHTGEAR: - libName = QString("FTNoIR_Protocol_FG.dll"); - break; - - case FTNOIR: - libName = QString("FTNoIR_Protocol_FTN.dll"); - break; - - case MOUSE: - libName = QString("FTNoIR_Protocol_MOUSE.dll"); - break; - - default: - break; - } + libName = getCurrentProtocolName(); // // Load the Server-settings dialog (if any) and show it. @@ -1076,31 +1097,75 @@ void FaceTrackNoIR::exit() { // void FaceTrackNoIR::createIconGroupBox() { +importGetProtocolDialog getProtocol; importGetFilterDialog getFilter; importGetTrackerDialog getTracker; -QLibrary *filterLib; -QString *filterName; -QIcon *filterIcon; +//QLibrary *filterLib; +//QString *filterName; +//QIcon *filterIcon; 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) - ui.iconcomboBox->addItem(QIcon(":/images/Freetrack.ico"), tr("Freetrack")); - ui.iconcomboBox->addItem(QIcon(":/images/FlightGear.ico"), tr("FlightGear")); - ui.iconcomboBox->addItem(QIcon(":/images/FaceTrackNoIR.ico"), tr("FTNoir client")); - ui.iconcomboBox->addItem(QIcon(":/images/PPJoy.ico"), tr("Virtual Joystick")); - ui.iconcomboBox->addItem(QIcon(":/images/TrackIR.ico"), tr("Fake TrackIR")); - ui.iconcomboBox->addItem(QIcon(":/images/FSX.ico"), tr("SimConnect (FSX)")); - ui.iconcomboBox->addItem(QIcon(":/images/FS9.ico"), tr("FS2002/FS2004")); - ui.iconcomboBox->addItem(QIcon(":/images/Mouse.ico"), tr("Mouse look")); - // // Get a List of all the Filter-DLL-files in the Program-folder. // QDir settingsDir( QCoreApplication::applicationDirPath() ); QStringList filters; + filters.clear(); + filters << "FTNoIR_Protocol_*.dll"; + protocolFileList.clear(); + protocolFileList = settingsDir.entryList( filters, QDir::Files, QDir::Name ); + + // + // Add strings to the Listbox. + // + disconnect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int))); + ui.iconcomboProtocol->clear(); + for ( int i = 0; i < protocolFileList.size(); i++) { + + qDebug() << "createIconGroupBox says: ProtocolName = " << protocolFileList.at(i); + + // + // Delete the existing QDialog + // + if (pProtocolDialog) { + pProtocolDialog.Release(); + } + + // Show the appropriate Protocol-server Settings + QLibrary *protocolLib = new QLibrary(protocolFileList.at(i)); + QString *protocolName = new QString(""); + QIcon *protocolIcon = new QIcon(); + + getProtocol = (importGetProtocolDialog) protocolLib->resolve("GetProtocolDialog"); + if (getProtocol) { + IProtocolDialogPtr ptrXyz(getProtocol()); + if (ptrXyz) + { + pProtocolDialog = ptrXyz; + pProtocolDialog->getFullName( protocolName ); + pProtocolDialog->getIcon( protocolIcon ); + qDebug() << "FaceTrackNoIR::showServerControls GetProtocolDialog Function Resolved!"; + } + else { + qDebug() << "FaceTrackNoIR::showServerControls Function NOT Resolved!"; + } + } + else { + QMessageBox::warning(0,"FaceTrackNoIR Error", "Protocol-DLL not loaded, please check if the DLL is version 1.7",QMessageBox::Ok,QMessageBox::NoButton); + } + + ui.iconcomboProtocol->addItem(*protocolIcon, *protocolName ); + } + connect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int))); + + // + // Get a List of all the Filter-DLL-files in the Program-folder. + // + filters.clear(); filters << "FTNoIR_Filter_*.dll"; filterFileList.clear(); filterFileList = settingsDir.entryList( filters, QDir::Files, QDir::Name ); @@ -1122,9 +1187,9 @@ QIcon *filterIcon; } // Show the appropriate Protocol-server Settings - filterLib = new QLibrary(filterFileList.at(i)); - filterName = new QString(""); - filterIcon = new QIcon(); + QLibrary *filterLib = new QLibrary(filterFileList.at(i)); + QString *filterName = new QString(""); + QIcon *filterIcon = new QIcon(); getFilter = (importGetFilterDialog) filterLib->resolve("GetFilterDialog"); if (getFilter) { @@ -1173,18 +1238,18 @@ QIcon *filterIcon; } // Show the appropriate Protocol-server Settings - filterLib = new QLibrary(trackerFileList.at(i)); - filterName = new QString(""); - filterIcon = new QIcon(); + QLibrary *trackerLib = new QLibrary(trackerFileList.at(i)); + QString *trackerName = new QString(""); + QIcon *trackerIcon = new QIcon(); - getTracker = (importGetTrackerDialog) filterLib->resolve("GetTrackerDialog"); + getTracker = (importGetTrackerDialog) trackerLib->resolve("GetTrackerDialog"); if (getTracker) { ITrackerDialogPtr ptrXyz(getTracker()); if (ptrXyz) { pTrackerDialog = ptrXyz; - pTrackerDialog->getFullName( filterName ); - pTrackerDialog->getIcon( filterIcon ); + pTrackerDialog->getFullName( trackerName ); + pTrackerDialog->getIcon( trackerIcon ); qDebug() << "FaceTrackNoIR::showServerControls GetTrackerDialog Function Resolved!"; } else { @@ -1195,7 +1260,7 @@ QIcon *filterIcon; QMessageBox::warning(0,"FaceTrackNoIR Error", "Facetracker-DLL not loaded, please check if the DLL is version 1.7",QMessageBox::Ok,QMessageBox::NoButton); } - ui.iconcomboTrackerSource->addItem(*filterIcon, *filterName ); + ui.iconcomboTrackerSource->addItem(*trackerIcon, *trackerName ); } connect(ui.iconcomboTrackerSource, SIGNAL(currentIndexChanged(int)), this, SLOT(trackingSourceSelected(int))); @@ -1239,45 +1304,6 @@ void FaceTrackNoIR::createTrayIcon() } } -// -// Set the Tray icon, using the Game-protocol combobox as source -// -void FaceTrackNoIR::setIcon(int index) -{ - QIcon icon = ui.iconcomboBox->itemIcon(index); - if (trayIcon != 0) { - trayIcon->setIcon(icon); - trayIcon->setToolTip(ui.iconcomboBox->itemText(index)); - trayIcon->show(); - trayIcon->showMessage( "FaceTrackNoIR", ui.iconcomboBox->itemText(index)); - } - setWindowIcon(QIcon(":/images/FaceTrackNoIR.ico")); - ui.btnShowServerControls->setIcon(icon); - - settingsDirty = true; - - // Enable/disable Protocol-server Settings - switch (ui.iconcomboBox->currentIndex()) { - case FREE_TRACK: - case SIMCONNECT: - ui.btnShowServerControls->hide(); - break; - case PPJOY: - case FSUIPC: - case TRACKIR: - case FLIGHTGEAR: - case FTNOIR: - case MOUSE: - ui.btnShowServerControls->show(); - ui.btnShowServerControls->setEnabled ( true ); - break; - - default: - break; - } - -} - // // Handle SystemTray events // @@ -1286,8 +1312,8 @@ void FaceTrackNoIR::iconActivated(QSystemTrayIcon::ActivationReason reason) switch (reason) { case QSystemTrayIcon::Trigger: case QSystemTrayIcon::DoubleClick: - //ui.iconcomboBox->setCurrentIndex((ui.iconcomboBox->currentIndex() + 1) - // % ui.iconcomboBox->count()); + //ui.iconcomboProtocol->setCurrentIndex((ui.iconcomboProtocol->currentIndex() + 1) + // % ui.iconcomboProtocol->count()); break; ////case QSystemTrayIcon::MiddleClick: //// showMessage(); @@ -1297,24 +1323,35 @@ void FaceTrackNoIR::iconActivated(QSystemTrayIcon::ActivationReason reason) } } +// +// Handle changes of the Protocol selection +// +void FaceTrackNoIR::protocolSelected(int index) +{ + settingsDirty = true; + ui.btnShowServerControls->setEnabled ( true ); + + // + // Set the Icon for the tray and update the Icon for the Settings button. + // + QIcon icon = ui.iconcomboProtocol->itemIcon(index); + if (trayIcon != 0) { + trayIcon->setIcon(icon); + trayIcon->setToolTip(ui.iconcomboProtocol->itemText(index)); + trayIcon->show(); + trayIcon->showMessage( "FaceTrackNoIR", ui.iconcomboProtocol->itemText(index)); + } + setWindowIcon(QIcon(":/images/FaceTrackNoIR.ico")); + ui.btnShowServerControls->setIcon(icon); +} + // // Handle changes of the Tracking Source selection // void FaceTrackNoIR::trackingSourceSelected(int index) { settingsDirty = true; - //switch ( index ) { - // case FT_SM_FACEAPI: // Face API - // ui.btnShowEngineControls->setEnabled ( false ); - // break; - // case FT_FTNOIR: // FTNoir server - // ui.video_frame->hide(); - // ui.headPoseWidget->show(); ui.btnShowEngineControls->setEnabled ( true ); - // break; - // default: - // break; - //} } // diff --git a/FaceTrackNoIR/FaceTrackNoIR.h b/FaceTrackNoIR/FaceTrackNoIR.h index 1bc2d7b7..ace9c666 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.h +++ b/FaceTrackNoIR/FaceTrackNoIR.h @@ -78,6 +78,7 @@ public: void updateSettings(); // Update the settings (let Tracker read INI-file). QFrame *getVideoWidget(); // Get a pointer to the video-widget, to use in the DLL + QString getCurrentProtocolName(); // Get the name of the selected protocol QString getCurrentFilterName(); // Get the name of the selected filter QString getCurrentTrackerName(); // Get the name of the selected face-tracker @@ -87,6 +88,7 @@ private: QTimer *timMinimizeFTN; // Timer to Auto-minimize QTimer *timUpdateHeadPose; // Timer to display headpose QStringList iniFileList; // List of INI-files, that are present in the Settings folder + QStringList protocolFileList; // List of Protocol-DLL-files, that are present in the program-folder QStringList filterFileList; // List of Filter-DLL-files, that are present in the program-folder QStringList trackerFileList; // List of Tracker-DLL-files, that are present in the program-folder @@ -137,11 +139,12 @@ private: void openurl_donation(); void about(); - void setIcon(int index); +// void setIcon(int index); void iconActivated(QSystemTrayIcon::ActivationReason reason); - void trackingSourceSelected(int index); void profileSelected(int index); + void protocolSelected(int index); void filterSelected(int index); + void trackingSourceSelected(int index); void showVideoWidget(); void showHeadPoseWidget(); diff --git a/FaceTrackNoIR/FaceTrackNoIR.qrc b/FaceTrackNoIR/FaceTrackNoIR.qrc index bc1b34f4..32169124 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.qrc +++ b/FaceTrackNoIR/FaceTrackNoIR.qrc @@ -6,15 +6,8 @@ UIElements/Curves.png images/rotation_DOFs.png images/translation_DOFs.png - images/FlightGear.ico images/330px-6DOF_en.png - images/Freetrack.ico images/FaceTrackNoIR.ico - images/Mouse.ico - images/FS9.ico - images/FSX.ico - images/PPJoy.ico - images/TrackIR.ico UIElements/aboutFaceTrackNoIR.png diff --git a/FaceTrackNoIR/FaceTrackNoIR.ui b/FaceTrackNoIR/FaceTrackNoIR.ui index 3e367e4e..d670efea 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.ui +++ b/FaceTrackNoIR/FaceTrackNoIR.ui @@ -1937,7 +1937,7 @@ background:none; Game protocol - + 10 @@ -2221,7 +2221,7 @@ background:none; btnStartTracker btnStopTracker btnShowEngineControls - iconcomboBox + iconcomboProtocol diff --git a/FaceTrackNoIR/images/FlightGear.ico b/FaceTrackNoIR/images/FlightGear.ico deleted file mode 100644 index f96c0f88..00000000 Binary files a/FaceTrackNoIR/images/FlightGear.ico and /dev/null differ diff --git a/FaceTrackNoIR/images/Freetrack.ico b/FaceTrackNoIR/images/Freetrack.ico deleted file mode 100644 index 02554c3d..00000000 Binary files a/FaceTrackNoIR/images/Freetrack.ico and /dev/null differ diff --git a/FaceTrackNoIR/images/PPJoy.ico b/FaceTrackNoIR/images/PPJoy.ico deleted file mode 100644 index f94f8d65..00000000 Binary files a/FaceTrackNoIR/images/PPJoy.ico and /dev/null differ diff --git a/FaceTrackNoIR/images/TrackIR.ico b/FaceTrackNoIR/images/TrackIR.ico deleted file mode 100644 index 99e02e7b..00000000 Binary files a/FaceTrackNoIR/images/TrackIR.ico and /dev/null differ diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index e529b243..49417733 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -23,7 +23,9 @@ *********************************************************************************/ /* Modifications (last one on top): - 20120317 - WVR: The Filter and Tracker-code was moved to separate DLL's. The calling-method + 20120427 - WVR: The Protocol-code was already in separate DLLs, but the ListBox was still filled ´statically´. Now, a Dir() of the + EXE-folder is done, to locate Protocol-DLLs. The Icons were also moved to the DLLs + 20120317 - WVR: The Filter and Tracker-code was moved to separate DLLs. The calling-method was changed accordingly. The face-tracker member-functions NotifyZeroed and refreshVideo were added, as requested by Stanislaw. @@ -108,7 +110,7 @@ IFilterPtr Tracker::pFilter; // Pointer to Filter instance (in DLL) /** constructor **/ -Tracker::Tracker( int clientID, int facetrackerID, FaceTrackNoIR *parent ) { +Tracker::Tracker( FaceTrackNoIR *parent ) { QString libName; importGetTracker getIT; QLibrary *trackerLib; @@ -121,11 +123,6 @@ QFrame *video_frame; // Retieve the pointer to the parent mainApp = parent; - // Remember the selected client, from the ListBox - // If the Tracker runs, this can NOT be changed... - selectedClient = (FTNoIR_Client) clientID; -// selectedTracker = (FTNoIR_Face_Tracker) facetrackerID; - // Create events m_StopThread = CreateEvent(0, TRUE, FALSE, 0); m_WaitThread = CreateEvent(0, TRUE, FALSE, 0); @@ -149,26 +146,6 @@ QFrame *video_frame; video_frame = mainApp->getVideoWidget(); qDebug() << "Tracker::setup VideoFrame = " << video_frame; - //// - //// Select the Tracker-engine DLL - //// - //switch (selectedTracker) { - // case FT_SM_FACEAPI: - // libName = QString("FTNoIR_Tracker_SM.dll"); - // break; - - // case FT_FTNOIR: - // libName = QString("FTNoIR_Tracker_UDP.dll"); - // break; - - // case FT_VISAGE: - // libName = QString("FTNoIR_Tracker_Visage.dll"); - // break; - - // default: - // break; - //} - // // Load the Tracker-engine DLL, get the tracker-class from it and do stuff... // @@ -191,51 +168,10 @@ QFrame *video_frame; } } - // - // Initialize all server-handles. Only start the server, that was selected in the GUI. - // - libName.clear(); - switch (selectedClient) { - case FREE_TRACK: - libName = QString("FTNoIR_Protocol_FT.dll"); - break; - - case FLIGHTGEAR: - libName = QString("FTNoIR_Protocol_FG.dll"); - break; - - case FTNOIR: - libName = QString("FTNoIR_Protocol_FTN.dll"); - break; - - case PPJOY: - libName = QString("FTNoIR_Protocol_PPJOY.dll"); - break; - - case TRACKIR: - libName = QString("FTNoIR_Protocol_FTIR.dll"); - break; - - case SIMCONNECT: - libName = QString("FTNoIR_Protocol_SC.dll"); - break; - - case FSUIPC: - libName = QString("FTNoIR_Protocol_FSUIPC.dll"); - break; - - case MOUSE: - libName = QString("FTNoIR_Protocol_MOUSE.dll"); - break; - - default: - // should never be reached - break; - } - // // Load the DLL with the protocol-logic and retrieve a pointer to the Protocol-class. // + libName = mainApp->getCurrentProtocolName(); if (!libName.isEmpty()) { protocolLib = new QLibrary(libName); getProtocol = (importGetProtocol) protocolLib->resolve("GetProtocol"); diff --git a/FaceTrackNoIR/tracker.h b/FaceTrackNoIR/tracker.h index fa0c5111..a69218a1 100644 --- a/FaceTrackNoIR/tracker.h +++ b/FaceTrackNoIR/tracker.h @@ -147,7 +147,7 @@ private: HANDLE m_StopThread; HANDLE m_WaitThread; - FTNoIR_Client selectedClient; +// FTNoIR_Client selectedClient; // FTNoIR_Face_Tracker selectedTracker; static T6DOF current_camera; // Used for filtering @@ -204,7 +204,7 @@ protected: void run(); public: - Tracker( int clientID, int facetrackerID, FaceTrackNoIR *parent ); + Tracker( FaceTrackNoIR *parent ); ~Tracker(); void setup(); diff --git a/List of compatible games.xls b/List of compatible games.xls index 1cfdcba3..9ac4b5cc 100644 Binary files a/List of compatible games.xls and b/List of compatible games.xls differ diff --git a/faceAPI/FaceAPI2FSX.vcproj b/faceAPI/FaceAPI2FSX.vcproj index ce6249d9..6ce63d45 100644 --- a/faceAPI/FaceAPI2FSX.vcproj +++ b/faceAPI/FaceAPI2FSX.vcproj @@ -146,7 +146,7 @@ AdditionalDependencies="smft32.lib user32.lib" OutputFile="..\bin\$(ProjectName).exe" LinkIncremental="1" - AdditionalLibraryDirectories=""C:\Program Files (x86)\SeeingMachines\FaceTrackingAPI_NC 3.2\API\bin"" + AdditionalLibraryDirectories=""D:\Program Files (x86)\SeeingMachines\FaceTrackingAPI_NC 3.2\API\bin"" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" -- cgit v1.2.3