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" 21 class CCriticalSection;
34 class CGameClientController;
35 class CGameClientHardware;
36 class CGameClientJoystick;
37 class CGameClientKeyboard;
38 class CGameClientMouse;
39 class CGameClientTopology;
41 class IGameInputCallback;
48 using JoystickMap = std::map<PortAddress, std::shared_ptr<CGameClientJoystick>>;
52 CCriticalSection& clientAccess);
62 bool HasFeature(
const std::string& controllerId,
const std::string& featureName)
const;
63 bool AcceptsInput()
const;
69 bool SupportsKeyboard()
const;
70 bool SupportsMouse()
const;
71 int GetPlayerLimit()
const;
72 bool ConnectController(
const std::string& portAddress,
const ControllerPtr& controller);
73 bool DisconnectController(
const std::string& portAddress);
78 const JoystickMap& GetJoystickMap()
const {
return m_joysticks; }
79 void CloseJoysticks(PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
82 bool OpenKeyboard(
const ControllerPtr& controller,
const PERIPHERALS::PeripheralPtr& keyboard);
83 bool IsKeyboardOpen()
const;
87 bool OpenMouse(
const ControllerPtr& controller,
const PERIPHERALS::PeripheralPtr& mouse);
88 bool IsMouseOpen()
const;
92 bool HasAgent()
const;
103 void SetControllerLayouts(
const ControllerVector& controllers);
104 bool OpenJoystick(
const std::string& portAddress,
const ControllerPtr& controller);
105 void CloseJoysticks(
const CPortNode& port, PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
106 void CloseJoystick(
const std::string& portAddress,
107 PERIPHERALS::EventLockHandlePtr& inputHandlingLock);
110 bool SetRumble(
const std::string& portAddress,
const std::string& feature,
float magnitude);
113 static ControllerVector GetControllers(
const CGameClient& gameClient);
118 std::unique_ptr<CGameClientTopology> m_topology;
119 using ControllerLayoutMap = std::map<std::string, std::unique_ptr<CGameClientController>>;
120 ControllerLayoutMap m_controllerLayouts;
132 JoystickMap m_joysticks;
135 std::unique_ptr<CPortManager> m_portManager;
142 std::unique_ptr<CGameClientKeyboard> m_keyboard;
149 std::unique_ptr<CGameClientMouse> m_mouse;
157 std::unique_ptr<CGameClientHardware> m_hardware;
Base class for game client subsystems.
Definition: GameClientSubsystem.h:37
Collection of nodes that can be connected to this port.
Definition: PortNode.h:26
Interface between Kodi and Game add-ons.
Definition: GameClient.h:115
Controller configuration window.
Definition: AudioDecoder.h:18
A branch in the controller tree.
Definition: ControllerHub.h:23
Game instance.
Definition: game.h:1223
Definition: Observer.h:44