diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 13:39:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-19 13:39:50 +0200 |
commit | a8ffbb76f3e3bbca547fccf5135323e06cae9d2a (patch) | |
tree | cd77a5302cb4ead5995a2a86d5b5b6324ebf43ff /ftnoir_protocol_ftn | |
parent | 0f0d663c6263a59e2cb14f555a00b39b19c134e7 (diff) |
update modules to refactored API
Diffstat (limited to 'ftnoir_protocol_ftn')
-rw-r--r-- | ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp | 4 | ||||
-rw-r--r-- | ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 19 | ||||
-rw-r--r-- | ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp | 3 |
3 files changed, 11 insertions, 15 deletions
diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp index ccff1ba5..c8759bc1 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp @@ -33,7 +33,7 @@ FTNoIR_Protocol::FTNoIR_Protocol() { } -void FTNoIR_Protocol::sendHeadposeToGame(const double *headpose) { +void FTNoIR_Protocol::pose(const double *headpose) { int destPort = s.port; QHostAddress destIP(QString("%1.%2.%3.%4").arg( QString::number(static_cast<int>(s.ip1)), @@ -43,7 +43,7 @@ void FTNoIR_Protocol::sendHeadposeToGame(const double *headpose) { outSocket.writeDatagram((const char *) headpose, sizeof( double[6] ), destIP, destPort); } -bool FTNoIR_Protocol::checkServerInstallationOK() +bool FTNoIR_Protocol::correct() { return outSocket.bind(QHostAddress::Any, 0, QUdpSocket::ShareAddress | QUdpSocket::ReuseAddressHint); } diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index c14a7dba..587f0034 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -53,9 +53,9 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - bool checkServerInstallationOK(); - void sendHeadposeToGame(const double *headpose); - QString getGameName() { + bool correct(); + void pose(const double *headpose); + QString game_name() { return "UDP Tracker"; } private: @@ -64,13 +64,13 @@ private: }; // Widget that has controls for FTNoIR protocol client-settings. -class FTNControls: public QWidget, public IProtocolDialog +class FTNControls: public IProtocolDialog { Q_OBJECT public: FTNControls(); - void registerProtocol(IProtocol *) {} - void unRegisterProtocol() {} + void register_protocol(IProtocol *) {} + void unregister_protocol() {} private: Ui::UICFTNControls ui; settings s; @@ -82,9 +82,6 @@ private slots: class FTNoIR_ProtocolDll : public Metadata { public: - void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("UDP"); } - void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("UDP"); } - void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("opentrack UDP protocol"); } - - void getIcon(QIcon *icon) { *icon = QIcon(":/images/facetracknoir.png"); } + 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 index 8af12ad7..4637223d 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp @@ -25,8 +25,7 @@ #include "ftnoir_protocol_ftn.h" #include "facetracknoir/plugin-support.h" -FTNControls::FTNControls() : - QWidget() +FTNControls::FTNControls() { ui.setupUi( this ); |