11 #include "Peripheral.h" 12 #include "XBDateTime.h" 14 #include "input/joysticks/interfaces/IDriverReceiver.h" 15 #include "threads/CriticalSection.h" 21 #define JOYSTICK_PORT_UNKNOWN (-1) 27 class CDeadzoneFilter;
28 class CKeymapHandling;
29 class CRumbleGenerator;
51 bool InitialiseFeature(
const PeripheralFeature feature)
override;
52 void OnUserNotification()
override;
53 bool TestFeature(PeripheralFeature feature)
override;
55 bool bPromiscuous)
override;
58 IKeymap* GetKeymap(
const std::string& controllerId)
override;
60 KODI::GAME::ControllerPtr ControllerProfile()
const override;
62 bool OnButtonMotion(
unsigned int buttonIndex,
bool bPressed);
63 bool OnHatMotion(
unsigned int hatIndex, KODI::JOYSTICK::HAT_STATE state);
64 bool OnAxisMotion(
unsigned int axisIndex,
float position);
65 void OnInputFrame(
void);
68 bool SetMotorState(
unsigned int motorIndex,
float magnitude)
override;
73 const std::string&
Provider(
void)
const {
return m_strProvider; }
89 unsigned int ButtonCount(
void)
const {
return m_buttonCount; }
90 unsigned int HatCount(
void)
const {
return m_hatCount; }
91 unsigned int AxisCount(
void)
const {
return m_axisCount; }
92 unsigned int MotorCount(
void)
const {
return m_motorCount; }
93 bool SupportsPowerOff(
void)
const {
return m_supportsPowerOff; }
98 void SetProvider(
const std::string& provider) { m_strProvider = provider; }
99 void SetRequestedPort(
int port) { m_requestedPort = port; }
100 void SetButtonCount(
unsigned int buttonCount) { m_buttonCount = buttonCount; }
101 void SetHatCount(
unsigned int hatCount) { m_hatCount = hatCount; }
102 void SetAxisCount(
unsigned int axisCount) { m_axisCount = axisCount; }
103 void SetMotorCount(
unsigned int motorCount);
104 void SetSupportsPowerOff(
bool bSupportsPowerOff);
107 void InitializeDeadzoneFiltering();
118 std::string m_strProvider;
120 unsigned int m_buttonCount;
121 unsigned int m_hatCount;
122 unsigned int m_axisCount;
123 unsigned int m_motorCount;
124 bool m_supportsPowerOff;
128 std::unique_ptr<KODI::JOYSTICK::CKeymapHandling> m_appInput;
129 std::unique_ptr<KODI::JOYSTICK::CRumbleGenerator> m_rumbleGenerator;
130 std::unique_ptr<KODI::JOYSTICK::IInputHandler> m_joystickMonitor;
131 std::unique_ptr<KODI::JOYSTICK::IButtonMap> m_buttonMap;
132 std::unique_ptr<KODI::JOYSTICK::CDeadzoneFilter> m_deadzoneFilter;
133 std::vector<DriverHandler> m_driverHandlers;
136 CCriticalSection m_handlerMutex;
Definition: PeripheralTypes.h:318
const std::string & Provider(void) const
Get the name of the driver or API providing this joystick.
Definition: PeripheralJoystick.h:73
unsigned int ButtonCount(void) const
Get the number of elements reported by the driver.
Definition: PeripheralJoystick.h:89
int RequestedPort(void) const
Get the specific port number requested by this joystick.
Definition: PeripheralJoystick.h:84
Definition: RetroPlayerInput.h:15
Interface defining methods to handle joystick events for raw driver elements (buttons, hats, axes)
Definition: IDriverHandler.h:21
Interface for mapping buttons to Kodi actions.
Definition: IKeymap.h:22
void SetProvider(const std::string &provider)
Set joystick properties.
Definition: PeripheralJoystick.h:98
Definition: PeripheralJoystick.h:40
Definition: PeripheralJoystick.h:111
Controller configuration window.
Definition: AudioDecoder.h:18
CDateTime LastActive() override
Return the last time this peripheral was active.
Definition: PeripheralJoystick.h:59
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
Definition: PeripheralBus.h:34
Definition: Peripheral.h:62
Interface for sending input events to joystick drivers.
Definition: IDriverReceiver.h:19
Definition: Peripherals.h:49