summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_joystick/ftnoir_tracker_joystick.h')
-rw-r--r--ftnoir_tracker_joystick/ftnoir_tracker_joystick.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
index 0958246a..75305f07 100644
--- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
+++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.h
@@ -14,6 +14,7 @@
#include <QList>
#include <QMutex>
#include <QFrame>
+#include <QStringList>
#include <cmath>
#include "opentrack/plugin-api.hpp"
#ifndef DIRECTINPUT_VERSION
@@ -30,11 +31,12 @@
using namespace options;
struct settings : opts {
- value<QString> joyid;
+ value<QString> joyid, guid;
value<int> joy_1, joy_2, joy_3, joy_4, joy_5, joy_6;
settings() :
opts("tracker-joystick"),
joyid(b, "joy-id", ""),
+ guid(b, "joy-guid", ""),
joy_1(b, "axis-map-1", 1),
joy_2(b, "axis-map-2", 2),
joy_3(b, "axis-map-3", 3),
@@ -44,6 +46,18 @@ struct settings : opts {
{}
};
+template<typename = void>
+QString guid_to_string(const GUID guid)
+{
+ char buf[40] = {0};
+ wchar_t szGuidW[40] = {0};
+
+ StringFromGUID2(guid, szGuidW, 40);
+ WideCharToMultiByte(0, 0, szGuidW, -1, buf, 40, NULL, NULL);
+
+ return QString(buf);
+}
+
class FTNoIR_Tracker : public ITracker
{
public:
@@ -59,6 +73,7 @@ public:
DIDEVICEINSTANCE def;
int iter; // XXX bad style
settings s;
+ QString guid_to_check;
static constexpr int AXIS_MAX = 65535;
};
@@ -69,10 +84,14 @@ public:
TrackerControls();
void register_tracker(ITracker *) {}
void unregister_tracker() {}
- QList<GUID> guids;
Ui::UIJoystickControls ui;
FTNoIR_Tracker* tracker;
settings s;
+ struct joys {
+ QString name;
+ QString guid;
+ };
+ QList<joys> _joys;
private slots:
void doOK();
void doCancel();