Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::GAME::CGameClientInput Class Reference

#include <GameClientInput.h>

Inheritance diagram for KODI::GAME::CGameClientInput:
KODI::GAME::CGameClientSubsystem Observable

Public Types

using PortAddress = std::string
 
using JoystickMap = std::map<PortAddress, std::shared_ptr<CGameClientJoystick>>
 

Public Member Functions

 CGameClientInput (CGameClient &gameClient, AddonInstance_Game &addonStruct, CCriticalSection &clientAccess)
 
 ~CGameClientInput () override
 
void Initialize ()
 
void Deinitialize ()
 
void Start (IGameInputCallback *input)
 
void Stop ()
 
bool HasFeature (const std::string &controllerId, const std::string &featureName) const
 
bool AcceptsInput () const
 
bool InputEvent (const game_input_event &event)
 
float GetPortActivation (const std::string &portAddress)
 
const CControllerTreeGetDefaultControllerTree () const
 
CControllerTree GetActiveControllerTree () const
 
bool SupportsKeyboard () const
 
bool SupportsMouse () const
 
int GetPlayerLimit () const
 
bool ConnectController (const std::string &portAddress, const ControllerPtr &controller)
 
bool DisconnectController (const std::string &portAddress)
 
void SavePorts ()
 
void ResetPorts ()
 
const JoystickMapGetJoystickMap () const
 
void CloseJoysticks (PERIPHERALS::EventLockHandlePtr &inputHandlingLock)
 
bool OpenKeyboard (const ControllerPtr &controller, const PERIPHERALS::PeripheralPtr &keyboard)
 
bool IsKeyboardOpen () const
 
void CloseKeyboard ()
 
bool OpenMouse (const ControllerPtr &controller, const PERIPHERALS::PeripheralPtr &mouse)
 
bool IsMouseOpen () const
 
void CloseMouse ()
 
bool HasAgent () const
 
void HardwareReset ()
 
bool ReceiveInputEvent (const game_input_event &eventStruct)
 
- Public Member Functions inherited from Observable
 Observable ()=default
 
virtual ~Observable ()=default
 
Observableoperator= (const Observable &observable)
 
virtual void RegisterObserver (Observer *obs)
 Register an observer.
 
virtual void UnregisterObserver (Observer *obs)
 Unregister an observer.
 
virtual void NotifyObservers (const ObservableMessage message=ObservableMessageNone)
 Send a message to all observers when m_bObservableChanged is true.
 
virtual void SetChanged (bool bSetTo=true)
 Mark an observable changed.
 
virtual bool IsObserving (const Observer &obs) const
 Check whether this observable is being observed by an observer.
 

Additional Inherited Members

- Protected Member Functions inherited from KODI::GAME::CGameClientSubsystem
 CGameClientSubsystem (CGameClient &gameClient, AddonInstance_Game &addonStruct, CCriticalSection &clientAccess)
 
virtual ~CGameClientSubsystem ()
 
CGameClientCheevosCheevos () const
 
CGameClientInputInput () const
 
CGameClientPropertiesAddonProperties () const
 
CGameClientStreamsStreams () const
 
- Protected Member Functions inherited from Observable
void SendMessage (const ObservableMessage message)
 Send a message to all observer when m_bObservableChanged is true.
 
 Observable ()=default
 
virtual ~Observable ()=default
 
Observableoperator= (const Observable &observable)
 
virtual void RegisterObserver (Observer *obs)
 Register an observer.
 
virtual void UnregisterObserver (Observer *obs)
 Unregister an observer.
 
virtual void NotifyObservers (const ObservableMessage message=ObservableMessageNone)
 Send a message to all observers when m_bObservableChanged is true.
 
virtual void SetChanged (bool bSetTo=true)
 Mark an observable changed.
 
virtual bool IsObserving (const Observer &obs) const
 Check whether this observable is being observed by an observer.
 
- Static Protected Member Functions inherited from KODI::GAME::CGameClientSubsystem
static GameClientSubsystems CreateSubsystems (CGameClient &gameClient, AddonInstance_Game &gameStruct, CCriticalSection &clientAccess)
 Create a struct with the allocated subsystems.
 
static void DestroySubsystems (GameClientSubsystems &subsystems)
 Deallocate subsystems.
 
- Protected Attributes inherited from KODI::GAME::CGameClientSubsystem
CGameClientm_gameClient
 
AddonInstance_Gamem_struct
 
CCriticalSection & m_clientAccess
 
- Protected Attributes inherited from Observable
std::atomic< boolm_bObservableChanged {false}
 
std::vector< Observer * > m_observers
 
CCriticalSection m_obsCritSection
 

Member Typedef Documentation

◆ JoystickMap

◆ PortAddress

Todo
de-duplicate

Constructor & Destructor Documentation

◆ CGameClientInput()

CGameClientInput::CGameClientInput ( CGameClient & gameClient,
AddonInstance_Game & addonStruct,
CCriticalSection & clientAccess )

◆ ~CGameClientInput()

CGameClientInput::~CGameClientInput ( )
override

Member Function Documentation

◆ AcceptsInput()

bool CGameClientInput::AcceptsInput ( ) const

◆ CloseJoysticks()

void CGameClientInput::CloseJoysticks ( PERIPHERALS::EventLockHandlePtr & inputHandlingLock)

◆ CloseKeyboard()

void CGameClientInput::CloseKeyboard ( )

◆ CloseMouse()

void CGameClientInput::CloseMouse ( )

◆ ConnectController()

bool CGameClientInput::ConnectController ( const std::string & portAddress,
const ControllerPtr & controller )

◆ Deinitialize()

void CGameClientInput::Deinitialize ( )

◆ DisconnectController()

bool CGameClientInput::DisconnectController ( const std::string & portAddress)

◆ GetActiveControllerTree()

CControllerTree CGameClientInput::GetActiveControllerTree ( ) const

◆ GetDefaultControllerTree()

const CControllerTree & CGameClientInput::GetDefaultControllerTree ( ) const

◆ GetJoystickMap()

const JoystickMap & KODI::GAME::CGameClientInput::GetJoystickMap ( ) const
inline

◆ GetPlayerLimit()

int CGameClientInput::GetPlayerLimit ( ) const

◆ GetPortActivation()

float CGameClientInput::GetPortActivation ( const std::string & portAddress)

◆ HardwareReset()

void CGameClientInput::HardwareReset ( )

◆ HasAgent()

bool CGameClientInput::HasAgent ( ) const

◆ HasFeature()

bool CGameClientInput::HasFeature ( const std::string & controllerId,
const std::string & featureName ) const

◆ Initialize()

void CGameClientInput::Initialize ( )

◆ InputEvent()

bool CGameClientInput::InputEvent ( const game_input_event & event)

◆ IsKeyboardOpen()

bool CGameClientInput::IsKeyboardOpen ( ) const

◆ IsMouseOpen()

bool CGameClientInput::IsMouseOpen ( ) const

◆ OpenKeyboard()

bool CGameClientInput::OpenKeyboard ( const ControllerPtr & controller,
const PERIPHERALS::PeripheralPtr & keyboard )

◆ OpenMouse()

bool CGameClientInput::OpenMouse ( const ControllerPtr & controller,
const PERIPHERALS::PeripheralPtr & mouse )

◆ ReceiveInputEvent()

bool CGameClientInput::ReceiveInputEvent ( const game_input_event & eventStruct)

◆ ResetPorts()

void CGameClientInput::ResetPorts ( )

◆ SavePorts()

void CGameClientInput::SavePorts ( )

◆ Start()

void CGameClientInput::Start ( IGameInputCallback * input)

◆ Stop()

void CGameClientInput::Stop ( )

◆ SupportsKeyboard()

bool CGameClientInput::SupportsKeyboard ( ) const

◆ SupportsMouse()

bool CGameClientInput::SupportsMouse ( ) const

The documentation for this class was generated from the following files: