AntiMicroX
joyaxisxml.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13 
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef JOYAXISXML_H
19 #define JOYAXISXML_H
20 
21 #include <QObject>
22 #include <QPointer>
23 
24 class JoyAxis;
25 class JoyButtonXml;
26 class QXmlStreamReader;
27 class QXmlStreamWriter;
28 
29 class JoyAxisXml : public QObject
30 {
31  Q_OBJECT
32 
33  public:
34  explicit JoyAxisXml(JoyAxis *axis, QObject *parent = nullptr);
35  ~JoyAxisXml();
36 
37  virtual void readConfig(QXmlStreamReader *xml);
38  virtual void writeConfig(QXmlStreamWriter *xml);
39 
40  virtual bool readMainConfig(QXmlStreamReader *xml);
41  virtual bool readButtonConfig(QXmlStreamReader *xml);
42 
43  private:
45  QPointer<JoyButtonXml> joyButtonXmlNAxis;
46  QPointer<JoyButtonXml> joyButtonXmlPAxis;
47 };
48 
49 #endif // JOYAXISXML_H
JoyAxisXml::readButtonConfig
virtual bool readButtonConfig(QXmlStreamReader *xml)
Definition: joyaxisxml.cpp:192
JoyAxis::updateCurrentThrottledValue
void updateCurrentThrottledValue(int newValue)
Definition: joyaxis.cpp:255
joyaxisbutton.h
GlobalVariables::JoyAxis::AXISMAXZONE
static const int AXISMAXZONE
Definition: globalvariables.h:120
JoyAxis::setDeadZone
void setDeadZone(int value)
Definition: joyaxis.cpp:354
JoyAxis::setThrottle
void setThrottle(int value)
Set throttle value for axis.
Definition: joyaxis.cpp:388
JoyAxis::getIndex
int getIndex()
Definition: joyaxis.cpp:317
JoyAxis::setCurrentRawValue
void setCurrentRawValue(int value)
Definition: joyaxis.cpp:581
JoyAxis
Represents single axis of of joystick (or other input)
Definition: joyaxis.h:40
JoyAxis::getHapticTrigger
virtual HapticTriggerPs5 * getHapticTrigger() const
Always returns nullptr for JoyAxis base objects.
Definition: joyaxis.cpp:307
JoyAxis::getRealJoyIndex
int getRealJoyIndex()
Definition: joyaxis.cpp:251
JoyAxis::NormalThrottle
@ NormalThrottle
Definition: joyaxis.h:52
HapticTriggerPs5::from_string
static HapticTriggerModePs5 from_string(const QString &mode)
Converts a HapticTriggerModePs5 from string representation.
Definition: haptictriggerps5.cpp:336
InputDevice::setCalibrationStatus
void setCalibrationStatus(int axisNum, JoyAxis::ThrottleTypes throttle)
Definition: inputdevice.cpp:1368
JoyAxisXml::joyButtonXmlNAxis
QPointer< JoyButtonXml > joyButtonXmlNAxis
Definition: joyaxisxml.h:45
InputDevice::hasCalibrationThrottle
bool hasCalibrationThrottle(int axisNum)
Definition: inputdevice.cpp:1343
JoyAxis::NegativeHalfThrottle
@ NegativeHalfThrottle
Definition: joyaxis.h:50
joybuttonxml.h
joyaxisxml.h
JoyAxisXml::writeConfig
virtual void writeConfig(QXmlStreamWriter *xml)
Definition: joyaxisxml.cpp:69
InputDevice
Abstract class representing a hardware input device, e.g a joystick or controller.
Definition: inputdevice.h:50
JoyAxis::PositiveThrottle
@ PositiveThrottle
Definition: joyaxis.h:53
JoyAxis::getDeadZone
int getDeadZone()
Definition: joyaxis.cpp:365
JoyAxis::getMaxZoneValue
int getMaxZoneValue()
Definition: joyaxis.cpp:382
JoyAxis::calculateThrottledValue
int calculateThrottledValue(int value)
Definition: joyaxis.cpp:257
JoyAxisXml
Definition: joyaxisxml.h:29
GlobalVariables::JoyAxis::AXISDEADZONE
static const int AXISDEADZONE
Definition: globalvariables.h:119
HapticTriggerPs5::to_string
static QString to_string(HapticTriggerModePs5 mode)
Returns string representation of a HapticTriggerModePs5 object.
Definition: haptictriggerps5.cpp:361
JoyAxis::getThrottle
int getThrottle()
Definition: joyaxis.cpp:423
JoyAxis::getPAxisButton
JoyAxisButton * getPAxisButton()
Definition: joyaxis.cpp:459
haptictriggerps5.h
JoyAxisXml::~JoyAxisXml
~JoyAxisXml()
Definition: joyaxisxml.cpp:37
JoyAxis::getParentSet
SetJoystick * getParentSet()
Definition: joyaxis.cpp:777
JoyAxis::setMaxZoneValue
void setMaxZoneValue(int value)
Definition: joyaxis.cpp:367
JoyAxisXml::readMainConfig
virtual bool readMainConfig(QXmlStreamReader *xml)
Definition: joyaxisxml.cpp:127
JoyAxis::getXmlName
virtual QString getXmlName()
Definition: joyaxis.cpp:769
JoyAxis::setHapticTriggerMode
virtual void setHapticTriggerMode(HapticTriggerModePs5)
Changes the haptic trigger effect mode.
Definition: joyaxis.cpp:313
JoyAxis::PositiveHalfThrottle
@ PositiveHalfThrottle
Definition: joyaxis.h:54
JoyAxis::isDefault
virtual bool isDefault()
Definition: joyaxis.cpp:565
JoyAxisXml::joyButtonXmlPAxis
QPointer< JoyButtonXml > joyButtonXmlPAxis
Definition: joyaxisxml.h:46
inputdevice.h
JoyAxisXml::readConfig
virtual void readConfig(QXmlStreamReader *xml)
Definition: joyaxisxml.cpp:45
JoyAxis::NegativeThrottle
@ NegativeThrottle
Definition: joyaxis.h:51
JoyAxisXml::JoyAxisXml
JoyAxisXml(JoyAxis *axis, QObject *parent=nullptr)
Definition: joyaxisxml.cpp:29
joyaxis.h
SetJoystick::getInputDevice
InputDevice * getInputDevice() const
Definition: setjoystick.cpp:931
JoyAxis::ThrottleTypes
ThrottleTypes
Definition: joyaxis.h:48
JoyAxis::getNAxisButton
JoyAxisButton * getNAxisButton()
Definition: joyaxis.cpp:461
JoyAxis::hasHapticTrigger
virtual bool hasHapticTrigger() const
Checks if the axis supports haptic trigger feedback.
Definition: joyaxis.cpp:302
JoyAxisButton::getXmlName
virtual QString getXmlName()
Definition: joyaxisbutton.cpp:84
HapticTriggerPs5::get_mode
HapticTriggerModePs5 get_mode() const
Returns the current haptic feedback effect mode.
Definition: haptictriggerps5.cpp:243
JoyAxis::getCurrentThrottledDeadValue
int getCurrentThrottledDeadValue()
Definition: joyaxis.cpp:483
JoyButtonXml
Definition: joybuttonxml.h:27
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
JoyAxisXml::m_joyAxis
JoyAxis * m_joyAxis
Definition: joyaxisxml.h:44
HapticTriggerPs5
Represents a single haptic trigger effect on a PS5 controller. See https://gist.github....
Definition: haptictriggerps5.h:33
JoyAxis::getCurrentRawValue
int getCurrentRawValue()
Definition: joyaxis.cpp:463