From c155fe9087ef1433deb6e43d040a90bc2423d60a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 14 Sep 2013 19:43:53 +0200 Subject: Remove copy-pasted per-file revision history --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.cpp') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index bb877cc6..a5a21200 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -24,16 +24,6 @@ * FTServer FTServer is the Class, that communicates headpose-data * * to games, using the FreeTrackClient.dll. * ********************************************************************************/ -/* - Modifications (last one on top): - 20110401 - WVR: Moved protocol to a DLL, convenient for installation etc. - 20101224 - WVR: Base class is no longer inheriting QThread. sendHeadposeToGame - is called from run() of Tracker.cpp - 20100601 - WVR: Added Mutex-bit in run(). Thought it wasn't so important (still do...). - 20100523 - WVR: Implemented the Freetrack-protocol just like Freetrack does. Earlier - FaceTrackNoIR only worked with an adapted DLL, with a putdata function. - Now it works direcly in shared memory! -*/ #include "ftnoir_protocol_wine.h" #include #include -- cgit v1.2.3 From a8dd32cbf76aa5082e8bb8af0fe5218242282c26 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 14 Sep 2013 19:44:26 +0200 Subject: Remove incorrect copyright information --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 26 ---------------------- .../ftnoir_protocol_wine_dialog.cpp | 24 -------------------- ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp | 24 -------------------- 3 files changed, 74 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.cpp') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index a5a21200..96a15b93 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -1,29 +1,3 @@ -/******************************************************************************** -* 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 . * -* * -* FTServer FTServer is the Class, that communicates headpose-data * -* to games, using the FreeTrackClient.dll. * -********************************************************************************/ #include "ftnoir_protocol_wine.h" #include #include diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp index f833af1d..ecbc2137 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine_dialog.cpp @@ -1,27 +1,3 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2012 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 . * -* * -********************************************************************************/ #include "ftnoir_protocol_wine.h" #include #include "facetracknoir/global-settings.h" diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp index bd07ba79..dd7f17a6 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine_dll.cpp @@ -1,27 +1,3 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2012 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 . * -* * -********************************************************************************/ #include "ftnoir_protocol_wine.h" #include #include "facetracknoir/global-settings.h" -- cgit v1.2.3 From 9ddf5d3ba5024c0266b910365e86c6fa58e9d266 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 19 Sep 2013 12:23:57 +0200 Subject: proto-wine: use compat-shm::success() --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.cpp') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index 96a15b93..698c2236 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -7,7 +7,7 @@ /** constructor **/ FTNoIR_Protocol::FTNoIR_Protocol() : lck_shm(WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM)), shm(NULL), gameid(0) { - if (lck_shm.mem != (void*) -1) { + if (lck_shm.success()) { shm = (WineSHM*) lck_shm.mem; memset(shm, 0, sizeof(*shm)); } @@ -53,7 +53,7 @@ void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose // bool FTNoIR_Protocol::checkServerInstallationOK() { - return lck_shm.mem != (void*)-1; + return lck_shm.success(); } //////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From da46cf18a2c7ad56c53e9c02014f75c818d39ea3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 16 Oct 2013 23:30:47 +0200 Subject: change protocol ABI: sprinkle const. ABI BREAKAGE! Signed-off-by: Stanislaw Halik --- facetracknoir/tracker.cpp | 2 +- ftnoir_protocol_base/ftnoir_protocol_base.h | 2 +- ftnoir_protocol_fg/ftnoir_protocol_fg.cpp | 6 +----- ftnoir_protocol_fg/ftnoir_protocol_fg.h | 2 +- ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp | 2 +- ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp | 2 +- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 6 +++--- ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp | 2 +- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp | 2 +- ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h | 4 ++-- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 2 +- ftnoir_protocol_wine/ftnoir_protocol_wine.h | 8 ++++---- 12 files changed, 18 insertions(+), 22 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.cpp') diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index 53b3ffd3..25b42ece 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -149,7 +149,7 @@ void Tracker::run() { // Send the headpose to the game if (Libraries->pProtocol) { gameoutput_camera = output_camera; - Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes, newpose ); // degrees & centimeters + Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes ); // degrees & centimeters } } } diff --git a/ftnoir_protocol_base/ftnoir_protocol_base.h b/ftnoir_protocol_base/ftnoir_protocol_base.h index 79f0800c..5db49f01 100644 --- a/ftnoir_protocol_base/ftnoir_protocol_base.h +++ b/ftnoir_protocol_base/ftnoir_protocol_base.h @@ -41,7 +41,7 @@ struct IProtocol { virtual ~IProtocol() {} virtual bool checkServerInstallationOK() = 0; - virtual void sendHeadposeToGame( double *headpose, double *rawheadpose ) = 0; + virtual void sendHeadposeToGame( const double* headpose ) = 0; virtual QString getGameName() = 0; }; diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp index 5aa3487e..08e7370b 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.cpp @@ -63,11 +63,7 @@ void FTNoIR_Protocol::loadSettings() { } -void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose ) { - int no_bytes; - QHostAddress sender; - quint16 senderPort; - +void FTNoIR_Protocol::sendHeadposeToGame(const double* headpose) { FlightData.x = headpose[TX] * 1e-2; FlightData.y = headpose[TY] * 1e-2; FlightData.z = headpose[TZ] * 1e-2; diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h index f399904b..43d1b05a 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.h @@ -46,7 +46,7 @@ public: FTNoIR_Protocol(); ~FTNoIR_Protocol(); bool checkServerInstallationOK(); - void sendHeadposeToGame( double *headpose, double *rawheadpose ); + void sendHeadposeToGame(const double *headpose); QString getGameName() { return "FlightGear"; } diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp index cefc9bf8..45123540 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg_dialog.cpp @@ -91,7 +91,7 @@ void FGControls::doOK() { } // override show event -void FGControls::showEvent ( QShowEvent * event ) { +void FGControls::showEvent ( QShowEvent * ) { loadSettings(); } diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp index 3d04dfd0..80cbfa0a 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp @@ -66,7 +66,7 @@ void FTNoIR_Protocol::loadSettings() { // // Update Headpose in Game. // -void FTNoIR_Protocol::sendHeadposeToGame(double *headpose, double *rawheadpose ) { +void FTNoIR_Protocol::sendHeadposeToGame(const double *headpose) { int no_bytes; double test_data[6]; // diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index 4c1c34cd..4e814ddf 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -45,7 +45,7 @@ public: FTNoIR_Protocol(); ~FTNoIR_Protocol(); bool checkServerInstallationOK(); - void sendHeadposeToGame( double *headpose, double *rawheadpose ); + void sendHeadposeToGame(const double *headpose); QString getGameName() { return "UDP Tracker"; } @@ -65,9 +65,9 @@ public: explicit FTNControls(); virtual ~FTNControls(); - void showEvent ( QShowEvent * event ); + void showEvent (QShowEvent *); void Initialize(QWidget *parent); - void registerProtocol(IProtocol *protocol) {} + void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} private: diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp index 0b61fd48..3b4e851c 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp @@ -84,7 +84,7 @@ void FTNControls::doOK() { } // override show event -void FTNControls::showEvent ( QShowEvent * event ) { +void FTNControls::showEvent ( QShowEvent * ) { loadSettings(); } diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index fc01552e..70fde395 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -70,7 +70,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol() libevdev_free(dev); } -void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose ) { +void FTNoIR_Protocol::sendHeadposeToGame(const double* headpose) { static const int axes[] = { /* translation goes first */ ABS_X, ABS_Y, ABS_Z, ABS_RX, ABS_RY, ABS_RZ diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index e753269e..3c6f591c 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -25,7 +25,7 @@ public: bool checkServerInstallationOK() { return dev != NULL; } - void sendHeadposeToGame( double *headpose, double *rawheadpose ); + void sendHeadposeToGame(const double *headpose); QString getGameName() { return "Virtual joystick for Linux"; } @@ -45,7 +45,7 @@ public: void showEvent ( QShowEvent *) {} void Initialize(QWidget *); - void registerProtocol(IProtocol *l) {} + void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} private: diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index 698c2236..c5d0754f 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -25,7 +25,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol() shm_unlink("/" WINE_SHM_NAME); } -void FTNoIR_Protocol::sendHeadposeToGame( double *headpose, double *rawheadpose ) { +void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { if (shm) { lck_shm.lock(); diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.h b/ftnoir_protocol_wine/ftnoir_protocol_wine.h index 300501ad..01bfc93d 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.h +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.h @@ -51,7 +51,7 @@ public: ~FTNoIR_Protocol(); bool checkServerInstallationOK(); - void sendHeadposeToGame(double* headpose, double* rawheadpose ); + void sendHeadposeToGame(const double* headpose); QString getGameName() { QMutexLocker foo(&game_name_mutex); return connected_game; @@ -72,9 +72,9 @@ class FTControls: public QWidget, public IProtocolDialog public: FTControls(); - void showEvent ( QShowEvent * event ) {show();} - void Initialize(QWidget *parent) {show();} - void registerProtocol(IProtocol *protocol) {} + void showEvent ( QShowEvent * ) {show();} + void Initialize(QWidget *) {show();} + void registerProtocol(IProtocol *) {} void unRegisterProtocol() {} private: -- cgit v1.2.3 From 4bde5b3cfc82348d822bcd99a0ca6bab022b2933 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Oct 2013 18:12:24 +0200 Subject: improve wine wrapper subprocess handling Signed-off-by: Stanislaw Halik --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.cpp') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index c5d0754f..d9c3f1e0 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -19,9 +19,14 @@ FTNoIR_Protocol::~FTNoIR_Protocol() { if (shm) { shm->stop = true; - wrapper.waitForFinished(2000); + wrapper.waitForFinished(100); + } + wrapper.terminate(); + if (!wrapper.waitForFinished(100)) + { + wrapper.kill(); + wrapper.waitForFinished(42); } - wrapper.kill(); shm_unlink("/" WINE_SHM_NAME); } -- cgit v1.2.3 From b66000f27178f515455a7a62f294062ef81d1ca4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 30 Nov 2013 18:32:37 +0100 Subject: Don't unlink shm in wine proto Reported-by: runningman84 Issue: github issue #11 --- ftnoir_protocol_wine/ftnoir_protocol_wine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftnoir_protocol_wine/ftnoir_protocol_wine.cpp') diff --git a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp index d9c3f1e0..58ffe974 100644 --- a/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp +++ b/ftnoir_protocol_wine/ftnoir_protocol_wine.cpp @@ -27,7 +27,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol() wrapper.kill(); wrapper.waitForFinished(42); } - shm_unlink("/" WINE_SHM_NAME); + //shm_unlink("/" WINE_SHM_NAME); } void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { -- cgit v1.2.3