11 #include "games/addons/GameClientSubsystem.h" 12 #include "games/controllers/ControllerTypes.h" 13 #include "games/controllers/types/ControllerTree.h" 14 #include "peripherals/PeripheralTypes.h" 15 #include "utils/Observer.h" 22 class CCriticalSection;
35 class CGameClientController;
36 class CGameClientHardware;
37 class CGameClientJoystick;
38 class CGameClientKeyboard;
39 class CGameClientMouse;
40 class CGameClientTopology;
42 class IGameInputCallback;
52 using JoystickMap = std::map<PortAddress, std::shared_ptr<CGameClientJoystick>>;
56 CCriticalSection& clientAccess);
66 bool HasFeature(
const std::string& controllerId,
const std::string& featureName)
const;
67 bool AcceptsInput()
const;
69 float GetPortActivation(
const std::string& portAddress);
74 bool SupportsKeyboard()
const;
75 bool SupportsMouse()
const;
76 int GetPlayerLimit()
const;
77 bool ConnectController(
const std::string& portAddress,
const ControllerPtr& controller);
78 bool DisconnectController(
const std::string& portAddress);
83 const JoystickMap& GetJoystickMap()
const {
return m_joysticks; }
84 void CloseJoysticks(PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
87 bool OpenKeyboard(
const ControllerPtr& controller,
const PERIPHERALS::PeripheralPtr& keyboard);
88 bool IsKeyboardOpen()
const;
92 bool OpenMouse(
const ControllerPtr& controller,
const PERIPHERALS::PeripheralPtr& mouse);
93 bool IsMouseOpen()
const;
97 bool HasAgent()
const;
100 void HardwareReset();
109 bool OpenJoystick(
const std::string& portAddress,
const ControllerPtr& controller);
110 void CloseJoysticks(
const CPortNode& port, PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
111 void CloseJoystick(
const std::string& portAddress,
112 PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
115 bool SetRumble(
const std::string& portAddress,
const std::string& feature,
float magnitude);
123 std::unique_ptr<CGameClientTopology> m_topology;
124 using ControllerLayoutMap = std::map<std::string, std::unique_ptr<CGameClientController>>;
125 ControllerLayoutMap m_controllerLayouts;
137 JoystickMap m_joysticks;
142 std::unique_ptr<CPortManager> m_portManager;
150 mutable std::recursive_mutex m_portMutex;
157 std::unique_ptr<CGameClientKeyboard> m_keyboard;
164 std::unique_ptr<CGameClientMouse> m_mouse;
172 std::unique_ptr<CGameClientHardware> m_hardware;
Base class for game client subsystems.
Definition: GameClientSubsystem.h:39
Collection of nodes that can be connected to this port.
Definition: PortNode.h:28
Interface between Kodi and Game add-ons.
Definition: GameClient.h:116
Definition: AudioDecoder.h:18
std::shared_ptr< CController > ControllerPtr
Smart pointer to a game controller (CController)
Definition: ControllerTypes.h:25
A branch in the controller tree.
Definition: ControllerHub.h:25
Game instance.
Definition: game.h:1228
Definition: Observer.h:44
std::vector< ControllerPtr > ControllerVector
Vector of smart pointers to a game controller (CController)
Definition: ControllerTypes.h:32