summaryrefslogtreecommitdiffhomepage
path: root/tracker-qt-gamepad/test.h
blob: ffa9ac441cc9a2ca4b09d7ddfc48bc7ec3bc99e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include "ui_test.h"
#include "api/plugin-api.hpp"
#include "compat/timer.hpp"

#include <cmath>

class gamepad_tracker : public ITracker
{
public:
    gamepad_tracker();
    ~gamepad_tracker() override;
    void start_tracker(QFrame *) override;
    void data(double *data) override;

private:
    static constexpr double r2d = 180 / M_PI;
    static constexpr double d2r = M_PI / 180;

    static const double incr[6];
    double last_x[6];
    Timer t;
};

class gamepad_dialog : public ITrackerDialog
{
    Q_OBJECT

    Ui::test_ui ui;
public:
    gamepad_dialog();
    void register_tracker(ITracker *) override {}
    void unregister_tracker() override {}
private slots:
    void doOK();
    void doCancel();
};

class gamepad_metadata : public Metadata
{
public:
    QString name() { return QString(QCoreApplication::translate("gamepad_metadata", "Gamepad input")); }
    QIcon icon() { return QIcon(":/images/facetracknoir.png"); }
};