From a8ffbb76f3e3bbca547fccf5135323e06cae9d2a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Oct 2014 13:39:50 +0200 Subject: update modules to refactored API --- ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp | 4 ++-- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 19 ++++++++----------- ftnoir_protocol_ftn/ftnoir_protocol_ftn_dialog.cpp | 3 +-- 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'ftnoir_protocol_ftn') 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(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 ); -- cgit v1.2.3