summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.h')
-rw-r--r--ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.h b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.h
index 2474fb35..4251435c 100644
--- a/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.h
+++ b/ftnoir_tracker_libevdev/ftnoir_tracker_libevdev.h
@@ -4,6 +4,9 @@
#include "facetracknoir/plugin-api.hpp"
#include "facetracknoir/options.h"
#include "./ui_ftnoir_libevdev.h"
+#include <QThread>
+#include <QMutex>
+#include <QMutexLocker>
using namespace options;
struct settings {
@@ -15,41 +18,42 @@ struct settings {
{}
};
-class FTNoIR_Tracker : public ITracker
+class FTNoIR_Tracker : public ITracker, private QThread
{
public:
- FTNoIR_Tracker();
+ FTNoIR_Tracker();
~FTNoIR_Tracker() override;
- void StartTracker(QFrame *);
- void GetHeadPoseData(double *data);
+ void start_tracker(QFrame *);
+ void data(double *data);
private:
+ void run() override;
struct libevdev* node;
int fd;
settings s;
bool success;
- int a_min[6], a_max[6];
+ int a_min[6], a_max[6], values[6];
+ QMutex mtx;
+ volatile bool should_quit;
};
-class TrackerControls: public QWidget, public ITrackerDialog
+class TrackerControls: public ITrackerDialog
{
Q_OBJECT
public:
- TrackerControls();
- void registerTracker(ITracker *) {}
- void unRegisterTracker() {}
+ TrackerControls();
+ void register_tracker(ITracker *) {}
+ void unregister_tracker() {}
private:
- Ui::ui_libevdev_tracker_dialog ui;
+ Ui::ui_libevdev_tracker_dialog ui;
settings s;
private slots:
- void doOK();
- void doCancel();
+ void doOK();
+ void doCancel();
};
class FTNoIR_TrackerDll : public Metadata
{
public:
- void getFullName(QString *strToBeFilled);
- void getShortName(QString *strToBeFilled);
- void getDescription(QString *strToBeFilled);
- void getIcon(QIcon *icon);
+ QString name() { return QString("libevdev joystick input"); }
+ QIcon icon() { return QIcon(":/images/facetracknoir.png"); }
};