From 8e442abcd71b7de741f615eac4fa1bd9fa63390e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 3 Jul 2015 15:40:51 +0200 Subject: simconnect: try set camera without event notification --- ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'ftnoir_protocol_sc') diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index 02ad497d..4d76df03 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -43,20 +43,20 @@ FTNoIR_Protocol::~FTNoIR_Protocol() void FTNoIR_Protocol::run() { - if (SUCCEEDED(simconnect_open(&hSimConnect, "FaceTrackNoIR", NULL, 0, 0, 0))) { + if (!SUCCEEDED(simconnect_open(&hSimConnect, "FaceTrackNoIR", NULL, 0, 0, 0))) + return; +#if 0 simconnect_subscribetosystemevent(hSimConnect, EVENT_PING, "Frame"); simconnect_mapclienteventtosimevent(hSimConnect, EVENT_INIT, ""); simconnect_addclienteventtonotificationgroup(hSimConnect, GROUP0, EVENT_INIT, false); simconnect_setnotificationgrouppriority(hSimConnect, GROUP0, SIMCONNECT_GROUP_PRIORITY_HIGHEST); - } - else - return; +#endif while (!should_stop) { (void) (simconnect_calldispatch(hSimConnect, processNextSimconnectEvent, reinterpret_cast(this))); - Sleep(3); + Sleep(1); } (void) simconnect_close(hSimConnect); @@ -217,25 +217,6 @@ void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData case SIMCONNECT_RECV_ID_EVENT_FRAME: self.handle(); break; - case SIMCONNECT_RECV_ID_EXCEPTION: - { - SIMCONNECT_RECV_EXCEPTION *except = (SIMCONNECT_RECV_EXCEPTION*)pData; - - switch (except->dwException) - { - case SIMCONNECT_EXCEPTION_ERROR: - qDebug() << "Camera error"; - break; - - default: - qDebug() << "Exception"; - break; - } - break; - } - - case SIMCONNECT_RECV_ID_QUIT: - break; } } -- cgit v1.2.3