diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-07 21:36:10 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-07 21:36:10 +0200 |
commit | 0bc78d53028f5ac68b9ab454347b8ad453988c08 (patch) | |
tree | 913abe48caeaf01e08707dfa4d0ef6aac3903b24 /proto-udp/ftnoir_protocol_ftn.h | |
parent | bf5954132b776b19b20586b0a4b2b622ab0642ea (diff) |
rename several protocols from abbreviated names
Diffstat (limited to 'proto-udp/ftnoir_protocol_ftn.h')
-rw-r--r-- | proto-udp/ftnoir_protocol_ftn.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/proto-udp/ftnoir_protocol_ftn.h b/proto-udp/ftnoir_protocol_ftn.h new file mode 100644 index 00000000..383b4ed7 --- /dev/null +++ b/proto-udp/ftnoir_protocol_ftn.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_ftncontrols.h" +#include <QThread> +#include <QUdpSocket> +#include <QMessageBox> +#include <cmath> +#include "api/plugin-api.hpp" +#include "options/options.hpp" +using namespace options; + +struct settings : opts { + value<int> 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 udp : public IProtocol +{ +public: + udp(); + bool correct(); + void pose(const double *headpose); + QString game_name() { + return QCoreApplication::translate("udp", "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 udpDll : public Metadata +{ +public: + QString name() { return QString(QCoreApplication::translate("udpDll", "UDP receiver")); } + QIcon icon() { return QIcon(":/images/facetracknoir.png"); } +}; |