From aa066bdd4622d4f6824fee864f6be6806813f04d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 30 Oct 2015 07:37:41 +0100 Subject: move to subdirectory-based build system Closes #224 --- ftnoir_protocol_ftn/ftnoir_ftncontrols.ui | 266 --------------------- ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp | 34 --- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 69 ------ ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp | 42 ---- 4 files changed, 411 deletions(-) delete mode 100644 ftnoir_protocol_ftn/ftnoir_ftncontrols.ui delete mode 100644 ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp delete mode 100644 ftnoir_protocol_ftn/ftnoir_protocol_ftn.h delete mode 100644 ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp (limited to 'ftnoir_protocol_ftn') diff --git a/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui b/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui deleted file mode 100644 index ca811e99..00000000 --- a/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui +++ /dev/null @@ -1,266 +0,0 @@ - - - UICFTNControls - - - Qt::NonModal - - - - 0 - 0 - 411 - 169 - - - - UDP protocol settings - - - - :/images/facetracknoir.png:/images/facetracknoir.png - - - Qt::LeftToRight - - - false - - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - IP-address remote PC - - - - - - - Port-number - - - - - - - 1000 - - - 10000 - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Enter IP-address and port-number for the remote PC. - - - true - - - - - - - Remember: you may have to change firewall-settings too! - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - QLayout::SetDefaultConstraint - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - OK - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Cancel - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - - spinIPFirstNibble - spinIPSecondNibble - spinIPThirdNibble - spinIPFourthNibble - spinPortNumber - btnOK - btnCancel - - - - - - - startEngineClicked() - stopEngineClicked() - cameraSettingsClicked() - - diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp deleted file mode 100644 index db852f55..00000000 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#include "ftnoir_protocol_ftn.h" -#include -#include "opentrack/plugin-api.hpp" - -FTNoIR_Protocol::FTNoIR_Protocol() -{ -} - -void FTNoIR_Protocol::pose(const double *headpose) { - int destPort = s.port; - QHostAddress destIP(QString("%1.%2.%3.%4").arg( - QString::number(static_cast(s.ip1)), - QString::number(static_cast(s.ip2)), - QString::number(static_cast(s.ip3)), - QString::number(static_cast(s.ip4)))); - outSocket.writeDatagram((const char *) headpose, sizeof( double[6] ), destIP, destPort); -} - -bool FTNoIR_Protocol::correct() -{ - return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); -} - -OPENTRACK_DECLARE_PROTOCOL(FTNoIR_Protocol, FTNControls, FTNoIR_ProtocolDll) diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h deleted file mode 100644 index 7fe6c225..00000000 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#pragma once - -#include "ui_ftnoir_ftncontrols.h" -#include -#include -#include -#include -#include "opentrack/plugin-api.hpp" -#include "opentrack/options.hpp" -using namespace options; - -struct settings : opts { - value ip1, ip2, ip3, ip4, port; - settings() : - opts("udp-proto"), - ip1(b, "ip1", 192), - ip2(b, "ip2", 168), - ip3(b, "ip3", 0), - ip4(b, "ip4", 2), - port(b, "port", 4242) - {} -}; - -class FTNoIR_Protocol : public IProtocol -{ -public: - FTNoIR_Protocol(); - bool correct(); - void pose(const double *headpose); - QString game_name() { - return "UDP Tracker"; - } -private: - QUdpSocket outSocket; - settings s; -}; - -// Widget that has controls for FTNoIR protocol client-settings. -class FTNControls: public IProtocolDialog -{ - Q_OBJECT -public: - FTNControls(); - void register_protocol(IProtocol *) {} - void unregister_protocol() {} -private: - Ui::UICFTNControls ui; - settings s; -private slots: - void doOK(); - void doCancel(); -}; - -class FTNoIR_ProtocolDll : public Metadata -{ -public: - QString name() { return QString("UDP receiver"); } - QIcon icon() { return QIcon(":/images/facetracknoir.png"); } -}; diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp deleted file mode 100644 index 77a1508a..00000000 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#include "ftnoir_protocol_ftn.h" -#include "opentrack/plugin-api.hpp" - -FTNControls::FTNControls() -{ - ui.setupUi( this ); - - tie_setting(s.ip1, ui.spinIPFirstNibble); - tie_setting(s.ip2, ui.spinIPSecondNibble); - tie_setting(s.ip3, ui.spinIPThirdNibble); - tie_setting(s.ip4, ui.spinIPFourthNibble); - tie_setting(s.port, ui.spinPortNumber); - - connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); - connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); -} - -// -// OK clicked on server-dialog -// -void FTNControls::doOK() { - s.b->save(); - this->close(); -} - -// -// Cancel clicked on server-dialog -// -void FTNControls::doCancel() { - s.b->reload(); - this->close(); -} -- cgit v1.2.3