xbmc
DeadzoneFilter.h
1 /*
2  * Copyright (C) 2016-2018 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 
43 {
44 public:
45  CDeadzoneFilter(IButtonMap* buttonMap, PERIPHERALS::CPeripheral* peripheral);
46 
53  float FilterAxis(unsigned int axisIndex, float axisValue);
54 
55 private:
64  bool GetDeadzone(unsigned int axisIndex,
65  float& result,
66  const char* featureName,
67  const char* settingName);
68 
75  static float ApplyDeadzone(float value, float deadzone);
76 
77  // Construction parameters
78  IButtonMap* const m_buttonMap;
79  PERIPHERALS::CPeripheral* const m_peripheral;
80 };
81 } // namespace JOYSTICK
82 } // 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:28
Analog axis deadzone filtering.
Definition: DeadzoneFilter.h:42
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: Peripheral.h:62