]> git.defcon.no Git - rctxduino/blob - tools/jstt/jstt.h
The code is now functional for the 4 first channels, also applied some simple pulldow...
[rctxduino] / tools / jstt / jstt.h
1 #ifndef JSTT_H
2 #define JSTT_H
3
4 #include <QMainWindow>
5 #include <QStringList>
6 #include <SDL/SDL.h>
7 #include <QTimer>
8 #include <QProgressBar>
9 #include <QLabel>
10
11 #define eventTimeout 100
12 #define percentBar(value) (((32768 + value) * 100) / 65536)
13
14 namespace Ui {
15 class jstt;
16 }
17
18 class jstt : public QMainWindow {
19 Q_OBJECT
20 public:
21 jstt(QWidget *parent = 0);
22 ~jstt();
23
24 protected:
25
26 private:
27 void init();
28 void jsOpen(int js);
29 void jsClose();
30 bool jsIsOpen() { return joystick != NULL; }
31
32 Ui::jstt *ui;
33 SDL_Joystick *joystick;
34 QTimer jsPullTimer;
35 QProgressBar *bars[4];
36 QLabel *labels[4];
37
38 private slots:
39 void on_Joysticks_currentIndexChanged(int index) { jsOpen(index); }
40 void on_actionQuit_triggered();
41 void on_actionHelp_triggered();
42 void on_actionAbout_triggered();
43 void processJs();
44 };
45
46 #endif // JSTT_H