| 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 |
#include "input/joysticks/JoystickTypes.h" |
| 12 |
#include "input/joysticks/interfaces/IInputReceiver.h" |
| 13 |
|
| 14 |
#include <map> |
| 15 |
|
| 16 |
namespace KODI |
| 17 |
{ |
| 18 |
namespace JOYSTICK |
| 19 |
{ |
| 20 |
class IDriverReceiver; |
| 21 |
class IButtonMap; |
| 22 |
|
| 23 |
/*! |
| 24 |
* \ingroup joystick |
| 25 |
* |
| 26 |
* \brief Class to translate input events from higher-level features to driver primitives |
| 27 |
* |
| 28 |
* A button map is used to translate controller features to driver primitives. |
| 29 |
* The button map has been abstracted away behind the IButtonMap interface |
| 30 |
* so that it can be provided by an add-on. |
| 31 |
*/ |
| 32 |
class CDriverReceiving : public IInputReceiver |
| 33 |
{ |
| 34 |
public: |
| 35 |
CDriverReceiving(IDriverReceiver* receiver, IButtonMap* buttonMap); |
| 36 |
|
| 37 |
~CDriverReceiving() override = default; |
| 38 |
|
| 39 |
// implementation of IInputReceiver |
| 40 |
bool SetRumbleState(const FeatureName& feature, float magnitude) override; |
| 41 |
|
| 42 |
private: |
| 43 |
IDriverReceiver* const m_receiver; |
| 44 |
IButtonMap* const m_buttonMap; |
| 45 |
}; |
| 46 |
} // namespace JOYSTICK |
| 47 |
} // namespace KODI |