diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-30 09:01:32 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-30 09:01:32 +0100 |
commit | d785d3616500d5846ac8c5f5a6347da832a593b4 (patch) | |
tree | ac670a125c5b880ad7e4b4f24a8635da4e66f0da /protocol-fg/ftnoir_protocol_fg.h | |
parent | 232c2ba8aca7900eaa950c48813ddfaca8a749a8 (diff) | |
parent | 9b736d361bcde7a2ddaf3fe54b471c0e658e94f4 (diff) |
Merge branch 'unstable' into trackhat
* unstable:
cmake: cleanup hydra
rename gui directory
move to subdirectory-based build system
cmake: switch to GNU CC 5.2.0 in mingw-w64 toolchain file
rift-080: forgot ovr_Initialize()
rift 025: fix name
Diffstat (limited to 'protocol-fg/ftnoir_protocol_fg.h')
-rw-r--r-- | protocol-fg/ftnoir_protocol_fg.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/protocol-fg/ftnoir_protocol_fg.h b/protocol-fg/ftnoir_protocol_fg.h new file mode 100644 index 00000000..de528270 --- /dev/null +++ b/protocol-fg/ftnoir_protocol_fg.h @@ -0,0 +1,69 @@ +/* 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_fgcontrols.h" +#include "fgtypes.h" +#include <QThread> +#include <QUdpSocket> +#include <QMessageBox> +#include "opentrack/plugin-api.hpp" +#include "opentrack/options.hpp" +using namespace options; + +struct settings : opts { + value<int> ip1, ip2, ip3, ip4; + value<int> port; + settings() : + opts("flightgear-proto"), + ip1(b, "ip1", 192), + ip2(b, "ip2", 168), + ip3(b, "ip3", 0), + ip4(b, "ip4", 2), + port(b, "port", 5542) + {} +}; + +class FTNoIR_Protocol : public IProtocol +{ +public: + bool correct(); + void pose(const double *headpose); + QString game_name() { + return "FlightGear"; + } +private: + settings s; + TFlightGearData FlightData; + QUdpSocket outSocket; +}; + +// Widget that has controls for FTNoIR protocol client-settings. +class FGControls: public IProtocolDialog +{ + Q_OBJECT +public: + FGControls(); + void register_protocol(IProtocol *) {} + void unregister_protocol() {} +private: + Ui::UICFGControls ui; + settings s; +private slots: + void doOK(); + void doCancel(); +}; + +class FTNoIR_ProtocolDll : public Metadata +{ +public: + QString name() { return QString("FlightGear"); } + QIcon icon() { return QIcon(":/images/flightgear.png"); } +}; |