diff options
Diffstat (limited to 'tracker-joystick/ftnoir_tracker_joystick.h')
-rw-r--r-- | tracker-joystick/ftnoir_tracker_joystick.h | 37 |
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 |