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_libevdev | |
parent | 0f0d663c6263a59e2cb14f555a00b39b19c134e7 (diff) |
update modules to refactored API
Diffstat (limited to 'ftnoir_protocol_libevdev')
4 files changed, 11 insertions, 29 deletions
diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp index 1840fa03..8b7db62a 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.cpp @@ -69,7 +69,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol() libevdev_free(dev); } -void FTNoIR_Protocol::sendHeadposeToGame(const double* headpose) { +void FTNoIR_Protocol::pose(const double* headpose) { static const int axes[] = { /* translation goes first */ ABS_X, ABS_Y, ABS_Z, ABS_RX, ABS_RY, ABS_RZ diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index e613885a..af6b3142 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -20,11 +20,11 @@ class FTNoIR_Protocol : public IProtocol public: FTNoIR_Protocol(); ~FTNoIR_Protocol() override; - bool checkServerInstallationOK() { + bool correct() { return dev != NULL; } - void sendHeadposeToGame(const double *headpose); - QString getGameName() { + void pose(const double *headpose); + QString game_name() { return "Virtual joystick for Linux"; } private: @@ -32,14 +32,13 @@ private: struct libevdev_uinput* uidev; }; -class LibevdevControls: public QWidget, public IProtocolDialog +class LibevdevControls: public IProtocolDialog { Q_OBJECT public: - - explicit LibevdevControls(); - void registerProtocol(IProtocol *) {} - void unRegisterProtocol() {} + LibevdevControls(); + void register_protocol(IProtocol *) {} + void unregister_protocol() {} private: Ui::UICLibevdevControls ui; @@ -50,18 +49,9 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Protocol DLL. Functions used to get general info on the Protocol -//******************************************************************************************************* class FTNoIR_ProtocolDll : public Metadata { public: - FTNoIR_ProtocolDll(); - ~FTNoIR_ProtocolDll(); - - void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("libevdev"); } - void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("libevdev"); } - void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("libevdev"); } - - void getIcon(QIcon *icon) { *icon = QIcon(":/images/linux.png"); } + QString name() { return QString("libevdev joystick receiver"); } + QIcon icon() { return QIcon(":/images/linux.png"); } }; diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp index d522610b..15e8097c 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dialog.cpp @@ -1,7 +1,7 @@ #include "ftnoir_protocol_libevdev.h" #include "facetracknoir/plugin-support.h" -LibevdevControls::LibevdevControls() : QWidget() +LibevdevControls::LibevdevControls() { ui.setupUi( this ); connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp index e258b077..75898715 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev_dll.cpp @@ -2,14 +2,6 @@ #include <QDebug> #include "facetracknoir/plugin-support.h" -FTNoIR_ProtocolDll::FTNoIR_ProtocolDll() { -} - -FTNoIR_ProtocolDll::~FTNoIR_ProtocolDll() -{ - -} - extern "C" OPENTRACK_EXPORT Metadata* GetMetadata() { return new FTNoIR_ProtocolDll; |