summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_joystick
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-19 13:39:50 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-10-19 13:39:50 +0200
commita8ffbb76f3e3bbca547fccf5135323e06cae9d2a (patch)
treecd77a5302cb4ead5995a2a86d5b5b6324ebf43ff /ftnoir_tracker_joystick
parent0f0d663c6263a59e2cb14f555a00b39b19c134e7 (diff)
update modules to refactored API
Diffstat (limited to 'ftnoir_tracker_joystick')
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp6
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.h24
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp21
3 files changed, 10 insertions, 41 deletions
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
index bb1076dd..97f36b67 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp
@@ -25,7 +25,7 @@ void FTNoIR_Tracker::reload()
g_pJoystick = nullptr;
g_pDI = nullptr;
- StartTracker(frame);
+ start_tracker(frame);
}
FTNoIR_Tracker::~FTNoIR_Tracker()
@@ -81,7 +81,7 @@ static BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance
return stop ? DIENUM_STOP : DIENUM_CONTINUE;
}
-void FTNoIR_Tracker::StartTracker(QFrame* frame)
+void FTNoIR_Tracker::start_tracker(QFrame* frame)
{
QMutexLocker foo(&mtx);
this->frame = frame;
@@ -144,7 +144,7 @@ fail:
qDebug() << "joy init failure";
}
-void FTNoIR_Tracker::GetHeadPoseData(double *data)
+void FTNoIR_Tracker::data(double *data)
{
QMutexLocker foo(&mtx);
DIJOYSTATE js = {0};
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
index 04a933db..03bcc383 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
@@ -43,8 +43,8 @@ class FTNoIR_Tracker : public ITracker
public:
FTNoIR_Tracker();
~FTNoIR_Tracker();
- void StartTracker(QFrame *frame);
- void GetHeadPoseData(double *data);
+ void start_tracker(QFrame *frame);
+ void data(double *data);
void reload();
LPDIRECTINPUT8 g_pDI;
LPDIRECTINPUTDEVICE8 g_pJoystick;
@@ -56,17 +56,13 @@ public:
static constexpr int AXIS_MAX = 65535;
};
-class TrackerControls: public QWidget, public ITrackerDialog
+class TrackerControls: public ITrackerDialog
{
Q_OBJECT
public:
TrackerControls();
- void registerTracker(ITracker *foo) {
- tracker = dynamic_cast<FTNoIR_Tracker*>(foo);
- }
- void unRegisterTracker() {
- tracker = NULL;
- }
+ void register_tracker(ITracker *foo) {}
+ void unregister_tracker() {}
QList<GUID> guids;
Ui::UIJoystickControls ui;
FTNoIR_Tracker* tracker;
@@ -79,13 +75,7 @@ private slots:
class FTNoIR_TrackerDll : public Metadata
{
public:
- void getFullName(QString *strToBeFilled);
- void getShortName(QString *strToBeFilled);
- void getDescription(QString *strToBeFilled);
- void getIcon(QIcon *icon);
-private:
- QString trackerFullName; // Trackers' name and description
- QString trackerShortName;
- QString trackerDescription;
+ QString name() { return QString("Joystick input"); }
+ QIcon icon() { return QIcon(":/images/facetracknoir.png"); }
};
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp
index af1a9679..c2328a90 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_dll.cpp
@@ -1,27 +1,6 @@
#include "ftnoir_tracker_joystick.h"
-#include <QDebug>
#include "facetracknoir/plugin-support.h"
-void FTNoIR_TrackerDll::getFullName(QString *strToBeFilled)
-{
- *strToBeFilled = "Joystick";
-}
-
-void FTNoIR_TrackerDll::getShortName(QString *strToBeFilled)
-{
- *strToBeFilled = "Joystick";
-}
-
-void FTNoIR_TrackerDll::getDescription(QString *strToBeFilled)
-{
- *strToBeFilled = "Joystick";
-}
-
-void FTNoIR_TrackerDll::getIcon(QIcon *icon)
-{
- *icon = QIcon(":/images/facetracknoir.png");
-}
-
extern "C" OPENTRACK_EXPORT Metadata* GetMetadata()
{
return new FTNoIR_TrackerDll;