summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_sc
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-03 15:21:49 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-03 15:21:49 +0200
commit8bdd22bccfb8df345d0a03f6c575bfc792027874 (patch)
tree0172c4268a99673d2ae405089cb50289c8c3e80f /ftnoir_protocol_sc
parent9201417e9973f901a39195507cf2935a529e821e (diff)
simconnect: don't race against initializationopentrack-2.3-rc13
Issue: #174
Diffstat (limited to 'ftnoir_protocol_sc')
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.cpp8
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.h2
2 files changed, 2 insertions, 8 deletions
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
index 8e35248e..02ad497d 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
@@ -31,9 +31,8 @@
static QLibrary SCClientLib;
-FTNoIR_Protocol::FTNoIR_Protocol() : should_stop(false), hSimConnect(nullptr), should_start(false)
+FTNoIR_Protocol::FTNoIR_Protocol() : should_stop(false), hSimConnect(nullptr)
{
- start();
}
FTNoIR_Protocol::~FTNoIR_Protocol()
@@ -44,9 +43,6 @@ FTNoIR_Protocol::~FTNoIR_Protocol()
void FTNoIR_Protocol::run()
{
- if (!should_start)
- return;
-
if (SUCCEEDED(simconnect_open(&hSimConnect, "FaceTrackNoIR", NULL, 0, 0, 0))) {
simconnect_subscribetosystemevent(hSimConnect, EVENT_PING, "Frame");
@@ -185,7 +181,7 @@ bool FTNoIR_Protocol::correct()
qDebug() << "FTNoIR_Protocol::correct() says: SimConnect functions resolved in DLL!";
- should_start = true;
+ start();
return true;
}
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h
index 3ced16e5..b65bac85 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h
@@ -126,8 +126,6 @@ private:
HANDLE hSimConnect; // Handle to SimConnect
static void CALLBACK processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext);
settings s;
-
- bool should_start;
};
class SCControls: public IProtocolDialog