summaryrefslogtreecommitdiffhomepage
path: root/tracker-joystick/ftnoir_tracker_joystick.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:12:55 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-22 15:55:42 +0100
commit7075c9a3612f39edf4f068705f7a1ebc4ad0614e (patch)
tree78de586c3b37de8d48264db74878136820912ec2 /tracker-joystick/ftnoir_tracker_joystick.h
parent38a7253d20f7e29760e536e7e172a43d413a9372 (diff)
tracker/joy: use the centralized joystick state worker
Most of the code can be removed.
Diffstat (limited to 'tracker-joystick/ftnoir_tracker_joystick.h')
-rw-r--r--tracker-joystick/ftnoir_tracker_joystick.h37
1 files changed, 5 insertions, 32 deletions
diff --git a/tracker-joystick/ftnoir_tracker_joystick.h b/tracker-joystick/ftnoir_tracker_joystick.h
index 29e65af1..18ac349e 100644
--- a/tracker-joystick/ftnoir_tracker_joystick.h
+++ b/tracker-joystick/ftnoir_tracker_joystick.h
@@ -12,21 +12,12 @@
#include <QMessageBox>
#include <QSettings>
#include <QList>
-#include <QMutex>
#include <QFrame>
#include <QStringList>
#include <cmath>
#include "opentrack/plugin-api.hpp"
-#ifndef DIRECTINPUT_VERSION
-# define DIRECTINPUT_VERSION 0x800
-#endif
-#include <windows.h>
-#include <commctrl.h>
-#include <basetsd.h>
-#include <dinput.h>
-#include <oleauto.h>
-#include <shellapi.h>
+#include "opentrack/win32-joystick-shortcuts.hpp"
#include "opentrack-compat/options.hpp"
using namespace options;
@@ -46,35 +37,17 @@ 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:
FTNoIR_Tracker();
~FTNoIR_Tracker();
- void start_tracker(QFrame *frame);
+ void start_tracker(QFrame *);
void data(double *data);
- void reload();
- LPDIRECTINPUT8 g_pDI;
- LPDIRECTINPUTDEVICE8 g_pJoystick;
- QMutex mtx;
- QFrame* frame;
- DIDEVICEINSTANCE def;
- int iter; // XXX bad style
settings s;
- QString guid_to_check;
- static constexpr int AXIS_MAX = 65535;
+ QString guid;
+ static constexpr int AXIS_MAX = win32_joy_ctx::joy_axis_size - 1;
+ win32_joy_ctx joy_ctx;
};
class TrackerControls: public ITrackerDialog