diff options
Diffstat (limited to 'FTNoIR_Protocol_FTN')
-rw-r--r-- | FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp | 18 | ||||
-rw-r--r-- | FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h | 13 | ||||
-rw-r--r-- | FTNoIR_Protocol_FTN/ftnoir_protocol_ftn_dialog.cpp | 2 |
3 files changed, 21 insertions, 12 deletions
diff --git a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp index bcda3dbc..cfb6c618 100644 --- a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp +++ b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.cpp @@ -35,13 +35,13 @@ #include <QFile>
/** constructor **/
-FTNoIR_Protocol_FTN::FTNoIR_Protocol_FTN()
+FTNoIR_Protocol::FTNoIR_Protocol()
{
loadSettings();
}
/** destructor **/
-FTNoIR_Protocol_FTN::~FTNoIR_Protocol_FTN()
+FTNoIR_Protocol::~FTNoIR_Protocol()
{
if (inSocket != 0) {
inSocket->close();
@@ -55,12 +55,12 @@ FTNoIR_Protocol_FTN::~FTNoIR_Protocol_FTN() }
/** helper to Auto-destruct **/
-void FTNoIR_Protocol_FTN::Release()
+void FTNoIR_Protocol::Release()
{
delete this;
}
-void FTNoIR_Protocol_FTN::Initialize()
+void FTNoIR_Protocol::Initialize()
{
return;
}
@@ -68,7 +68,7 @@ void FTNoIR_Protocol_FTN::Initialize() //
// Load the current Settings from the currently 'active' INI-file.
//
-void FTNoIR_Protocol_FTN::loadSettings() {
+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();
@@ -86,7 +86,7 @@ void FTNoIR_Protocol_FTN::loadSettings() { //
// Update Headpose in Game.
//
-void FTNoIR_Protocol_FTN::sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData *rawheadpose ) {
+void FTNoIR_Protocol::sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData *rawheadpose ) {
int no_bytes;
QHostAddress sender;
quint16 senderPort;
@@ -137,7 +137,7 @@ quint16 senderPort; // Check if the Client DLL exists and load it (to test it), if so.
// Returns 'true' if all seems OK.
//
-bool FTNoIR_Protocol_FTN::checkServerInstallationOK( HANDLE handle )
+bool FTNoIR_Protocol::checkServerInstallationOK( HANDLE handle )
{
// Init. the data
TestData.x = 0.0f;
@@ -179,7 +179,7 @@ bool FTNoIR_Protocol_FTN::checkServerInstallationOK( HANDLE handle ) //
// Return a name, if present the name from the Game, that is connected...
//
-void FTNoIR_Protocol_FTN::getNameFromGame( char *dest )
+void FTNoIR_Protocol::getNameFromGame( char *dest )
{
sprintf_s(dest, 99, "FaceTrackNoIR");
return;
@@ -196,5 +196,5 @@ void FTNoIR_Protocol_FTN::getNameFromGame( char *dest ) FTNOIR_PROTOCOL_BASE_EXPORT IProtocolPtr __stdcall GetProtocol()
{
- return new FTNoIR_Protocol_FTN;
+ return new FTNoIR_Protocol;
}
diff --git a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h index 3eb65f5f..24f760c5 100644 --- a/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h +++ b/FTNoIR_Protocol_FTN/FTNoIR_Protocol_FTN.h @@ -39,11 +39,11 @@ #include "Windows.h"
#include "math.h"
-class FTNoIR_Protocol_FTN : public IProtocol
+class FTNoIR_Protocol : public IProtocol
{
public:
- FTNoIR_Protocol_FTN();
- ~FTNoIR_Protocol_FTN();
+ FTNoIR_Protocol();
+ ~FTNoIR_Protocol();
void Release();
void Initialize();
@@ -77,6 +77,12 @@ public: void Release(); // Member functions which are accessible from outside the DLL
void Initialize(QWidget *parent);
+ void registerProtocol(IProtocol *protocol) {
+ theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol
+ };
+ void unRegisterProtocol() {
+ theProtocol = NULL; // Reset the pointer
+ };
private:
Ui::UICFTNControls ui;
@@ -85,6 +91,7 @@ private: /** helper **/
bool settingsDirty;
+ FTNoIR_Protocol *theProtocol;
private slots:
void doOK();
diff --git a/FTNoIR_Protocol_FTN/ftnoir_protocol_ftn_dialog.cpp b/FTNoIR_Protocol_FTN/ftnoir_protocol_ftn_dialog.cpp index a2e7813b..58dbfbad 100644 --- a/FTNoIR_Protocol_FTN/ftnoir_protocol_ftn_dialog.cpp +++ b/FTNoIR_Protocol_FTN/ftnoir_protocol_ftn_dialog.cpp @@ -59,6 +59,8 @@ QWidget() connect(ui.spinIPFourthNibble, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));
connect(ui.spinPortNumber, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()));
+ theProtocol = NULL;
+
// Load the settings from the current .INI-file
loadSettings();
}
|