kodi
DeadzoneFilter.h
1 /*
2  * Copyright (C) 2016-2024 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 namespace PERIPHERALS
12 {
13 class CPeripheral;
14 }
15 
16 namespace KODI
17 {
18 namespace JOYSTICK
19 {
20 class IButtonMap;
21 
44 {
45 public:
46  CDeadzoneFilter(IButtonMap* buttonMap, PERIPHERALS::CPeripheral* peripheral);
47 
54  float FilterAxis(unsigned int axisIndex, float axisValue);
55 
56 private:
65  bool GetDeadzone(unsigned int axisIndex,
66  float& result,
67  const char* featureName,
68  const char* settingName);
69 
76  static float ApplyDeadzone(float value, float deadzone);
77 
78  // Construction parameters
79  IButtonMap* const m_buttonMap;
80  PERIPHERALS::CPeripheral* const m_peripheral;
81 };
82 } // namespace JOYSTICK
83 } // namespace KODI
Definition: RetroPlayerInput.h:15
Button map interface to translate between the driver's raw button/hat/axis elements and physical joys...
Definition: IButtonMap.h:29
Analog axis deadzone filtering.
Definition: DeadzoneFilter.h:43
Definition: AudioDecoder.h:18
Definition: Peripheral.h:71