AntiMicroX
Loading...
Searching...
No Matches
sdleventreader.h
Go to the documentation of this file.
1/* antimicrox Gamepad to KB+M event mapper
2 * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3 * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef SDLEVENTREADER_H
20#define SDLEVENTREADER_H
21
22#include "joystick.h"
23
24class InputDevice;
26
27class SDLEventReader : public QObject
28{
30
31 public:
33 QObject *parent = nullptr);
35
36 bool isSDLOpen();
37
40 QTimer const &getPollRateTimer();
41
42 protected:
43 void initSDL();
44 void closeSDL();
45 void clearEvents();
46 int eventStatus();
47
48 signals:
50 void finished();
51 void sdlStarted();
52 void sdlClosed();
53
54 public slots:
55 void performWork();
56 void stop();
57 void refresh();
58 void updatePollRate(int tempPollRate); // (unsigned)
59 void resetJoystickMap();
60 void quit();
61 void closeDevices();
62 void haltServices();
63
64 private slots:
65 void secondaryRefresh();
66
67 private:
73
75};
76
77#endif // SDLEVENTREADER_H
Definition antimicrosettings.h:27
Abstract class representing a hardware input device, e.g a joystick or controller.
Definition inputdevice.h:51
Definition joydpadxml.h:27
Definition sdleventreader.h:28
void quit()
Definition sdleventreader.cpp:218
QTimer pollRateTimer
Definition sdleventreader.h:72
void loadSdlMappingsFromDatabase()
Loading additional gamepad mappings from database.
Definition sdleventreader.cpp:256
void haltServices()
Method to block activity on the SDLEventReader object and its thread event loop.
Definition sdleventreader.cpp:246
AntiMicroSettings * getSettings() const
Definition sdleventreader.cpp:278
AntiMicroSettings * settings
Definition sdleventreader.h:70
void clearEvents()
Definition sdleventreader.cpp:159
int pollRate
Definition sdleventreader.h:71
void resetJoystickMap()
Definition sdleventreader.cpp:216
QTimer const & getPollRateTimer()
Definition sdleventreader.cpp:280
~SDLEventReader()
Definition sdleventreader.cpp:52
int eventStatus()
Definition sdleventreader.cpp:172
void performWork()
Definition sdleventreader.cpp:121
void secondaryRefresh()
Definition sdleventreader.cpp:151
void refresh()
Definition sdleventreader.cpp:142
void stop()
Definition sdleventreader.cpp:130
bool sdlIsOpen
Definition sdleventreader.h:69
QMap< SDL_JoystickID, InputDevice * > * joysticks
Definition sdleventreader.h:68
void closeSDL()
Definition sdleventreader.cpp:101
void closeDevices()
Definition sdleventreader.cpp:227
void eventRaised()
QMap< SDL_JoystickID, InputDevice * > * getJoysticks() const
Definition sdleventreader.cpp:276
void updatePollRate(int tempPollRate)
Definition sdleventreader.cpp:201
bool isSDLOpen()
Definition sdleventreader.cpp:170
void initSDL()
Definition sdleventreader.cpp:60