Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <Peripheral.h>
Public Member Functions | |
CPeripheral (CPeripherals &manager, const PeripheralScanResult &scanResult, CPeripheralBus *bus) | |
~CPeripheral (void) override | |
bool | operator== (const CPeripheral &right) const |
bool | operator!= (const CPeripheral &right) const |
bool | operator== (const PeripheralScanResult &right) const |
bool | operator!= (const PeripheralScanResult &right) const |
const std::string & | FileLocation (void) const |
const std::string & | Location (void) const |
int | VendorId (void) const |
const char * | VendorIdAsString (void) const |
int | ProductId (void) const |
const char * | ProductIdAsString (void) const |
PeripheralType | Type (void) const |
PeripheralBusType | GetBusType (void) const |
const std::string & | DeviceName (void) const |
bool | IsHidden (void) const |
void | SetHidden (bool bSetTo=true) |
const std::string & | GetVersionInfo (void) const |
virtual std::string | GetIcon () const |
Get an icon for this peripheral. | |
bool | HasFeature (const PeripheralFeature feature) const |
Check whether this device has the given feature. | |
void | GetFeatures (std::vector< PeripheralFeature > &features) const |
Get all features that are supported by this device. | |
bool | Initialise (void) |
Initialises the peripheral. | |
virtual bool | InitialiseFeature (const PeripheralFeature feature) |
Initialise one of the features of this peripheral. | |
virtual void | OnUserNotification () |
Briefly activate a feature to notify the user. | |
virtual bool | TestFeature (PeripheralFeature feature) |
Briefly test one of the features of this peripheral. | |
virtual void | OnSettingChanged (const std::string &strChangedSetting) |
Called when a setting changed. | |
virtual void | OnDeviceRemoved (void) |
Called when this device is removed, before calling the destructor. | |
virtual void | GetSubdevices (PeripheralVector &subDevices) const |
Get all subdevices if this device is multifunctional. | |
virtual bool | IsMultiFunctional (void) const |
virtual void | AddSetting (const std::string &strKey, const std::shared_ptr< const CSetting > &setting, int order) |
Add a setting to this peripheral. This will overwrite a previous setting with the same key. | |
virtual bool | HasSetting (const std::string &strKey) const |
Check whether a setting is known with the given key. | |
virtual bool | HasSettings (void) const |
virtual bool | HasConfigurableSettings (void) const |
virtual const std::string | GetSettingString (const std::string &strKey) const |
Get the value of a setting. | |
virtual bool | SetSetting (const std::string &strKey, const std::string &strValue) |
virtual void | SetSettingVisible (const std::string &strKey, bool bSetTo) |
virtual bool | IsSettingVisible (const std::string &strKey) const |
virtual int | GetSettingInt (const std::string &strKey) const |
virtual bool | SetSetting (const std::string &strKey, int iValue) |
virtual bool | GetSettingBool (const std::string &strKey) const |
virtual bool | SetSetting (const std::string &strKey, bool bValue) |
virtual float | GetSettingFloat (const std::string &strKey) const |
virtual bool | SetSetting (const std::string &strKey, float fValue) |
virtual void | PersistSettings (bool bExiting=false) |
virtual void | LoadPersistedSettings (void) |
virtual void | ResetDefaultSettings (void) |
virtual std::vector< std::shared_ptr< CSetting > > | GetSettings (void) const |
virtual bool | ErrorOccured (void) const |
virtual void | RegisterJoystickDriverHandler (KODI::JOYSTICK::IDriverHandler *handler, bool bPromiscuous) |
virtual void | UnregisterJoystickDriverHandler (KODI::JOYSTICK::IDriverHandler *handler) |
virtual void | RegisterKeyboardDriverHandler (KODI::KEYBOARD::IKeyboardDriverHandler *handler, bool bPromiscuous) |
virtual void | UnregisterKeyboardDriverHandler (KODI::KEYBOARD::IKeyboardDriverHandler *handler) |
virtual void | RegisterMouseDriverHandler (KODI::MOUSE::IMouseDriverHandler *handler, bool bPromiscuous) |
virtual void | UnregisterMouseDriverHandler (KODI::MOUSE::IMouseDriverHandler *handler) |
void | RegisterInputHandler (KODI::JOYSTICK::IInputHandler *handler, bool bPromiscuous) override |
Register a handler for the provided input. | |
void | UnregisterInputHandler (KODI::JOYSTICK::IInputHandler *handler) override |
Unregister a handler. | |
void | RegisterKeyboardHandler (KODI::KEYBOARD::IKeyboardInputHandler *handler, bool bPromiscuous, bool forceDefaultMap) override |
Registers a handler to be called on keyboard input. | |
void | UnregisterKeyboardHandler (KODI::KEYBOARD::IKeyboardInputHandler *handler) override |
Unregisters handler from keyboard input. | |
void | RegisterMouseHandler (KODI::MOUSE::IMouseInputHandler *handler, bool bPromiscuous, bool forceDefaultMap) override |
Registers a handler to be called on mouse input. | |
void | UnregisterMouseHandler (KODI::MOUSE::IMouseInputHandler *handler) override |
Unregisters handler from mouse input. | |
virtual void | RegisterJoystickButtonMapper (KODI::JOYSTICK::IButtonMapper *mapper) |
virtual void | UnregisterJoystickButtonMapper (KODI::JOYSTICK::IButtonMapper *mapper) |
virtual KODI::JOYSTICK::IDriverReceiver * | GetDriverReceiver () |
virtual KODI::KEYMAP::IKeymap * | GetKeymap (const std::string &controllerId) |
virtual CDateTime | LastActive () const |
Return the last time this peripheral was active. | |
virtual KODI::GAME::ControllerPtr | ControllerProfile () const |
Get the controller profile that best represents this peripheral. | |
virtual void | SetControllerProfile (const KODI::GAME::ControllerPtr &controller) |
Set the controller profile for this peripheral. | |
Public Member Functions inherited from KODI::JOYSTICK::IInputProvider | |
virtual | ~IInputProvider ()=default |
Public Member Functions inherited from KODI::KEYBOARD::IKeyboardInputProvider | |
virtual | ~IKeyboardInputProvider ()=default |
Public Member Functions inherited from KODI::MOUSE::IMouseInputProvider | |
virtual | ~IMouseInputProvider ()=default |
Protected Member Functions | |
virtual void | ClearSettings (void) |
Friends | |
class | CGUIDialogPeripheralSettings |
CPeripheral::CPeripheral | ( | CPeripherals & | manager, |
const PeripheralScanResult & | scanResult, | ||
CPeripheralBus * | bus ) |
|
override |
|
virtual |
Add a setting to this peripheral. This will overwrite a previous setting with the same key.
strKey | The key of the setting. |
setting | The setting. |
Reimplemented in PERIPHERALS::CPeripheralImon.
|
inlinevirtual |
Get the controller profile that best represents this peripheral.
Reimplemented in PERIPHERALS::CPeripheralJoystick, PERIPHERALS::CPeripheralKeyboard, and PERIPHERALS::CPeripheralMouse.
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralJoystick.
void CPeripheral::GetFeatures | ( | std::vector< PeripheralFeature > & | features | ) | const |
Get all features that are supported by this device.
features | The features. |
|
virtual |
Get an icon for this peripheral.
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralJoystick.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Get the value of a setting.
strKey | The key to search. |
|
virtual |
Get all subdevices if this device is multifunctional.
subDevices | The subdevices. |
|
inline |
bool CPeripheral::HasFeature | ( | const PeripheralFeature | feature | ) | const |
Check whether this device has the given feature.
feature | The feature to check for. |
|
virtual |
Check whether a setting is known with the given key.
strKey | The key to search. |
Initialises the peripheral.
|
inlinevirtual |
Initialise one of the features of this peripheral.
feature | The feature to initialise. |
Reimplemented in PERIPHERALS::CPeripheralHID, PERIPHERALS::CPeripheralImon, PERIPHERALS::CPeripheralJoystick, PERIPHERALS::CPeripheralKeyboard, and PERIPHERALS::CPeripheralMouse.
|
virtual |
|
virtual |
Return the last time this peripheral was active.
Reimplemented in PERIPHERALS::CPeripheralJoystick, PERIPHERALS::CPeripheralKeyboard, and PERIPHERALS::CPeripheralMouse.
|
inline |
Called when this device is removed, before calling the destructor.
Reimplemented in PERIPHERALS::CPeripheralImon.
|
inlinevirtual |
Called when a setting changed.
strChangedSetting | The changed setting. |
Reimplemented in PERIPHERALS::CPeripheralHID, and PERIPHERALS::CPeripheralImon.
|
inlinevirtual |
Briefly activate a feature to notify the user.
Reimplemented in PERIPHERALS::CPeripheralJoystick.
bool CPeripheral::operator!= | ( | const CPeripheral & | right | ) | const |
bool CPeripheral::operator!= | ( | const PeripheralScanResult & | right | ) | const |
bool CPeripheral::operator== | ( | const CPeripheral & | right | ) | const |
bool CPeripheral::operator== | ( | const PeripheralScanResult & | right | ) | const |
|
inline |
|
overridevirtual |
Register a handler for the provided input.
handler | The handler to receive input provided by this class |
bPromiscuous | If true, receives all input (including handled input) in the background |
Implements KODI::JOYSTICK::IInputProvider.
|
virtual |
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralJoystick.
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralKeyboard.
|
overridevirtual |
Registers a handler to be called on keyboard input.
handler | The handler to receive keyboard input provided by this class |
bPromiscuous | True to observe all events without affecting the input's destination |
forceDefaultMap | Always use the default keyboard buttonmap, avoiding buttonmaps provided by add-ons |
Implements KODI::KEYBOARD::IKeyboardInputProvider.
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralMouse.
|
overridevirtual |
Registers a handler to be called on mouse input.
handler | The handler to receive mouse input provided by this class |
bPromiscuous | True to observe all events without affecting subsequent handlers |
forceDefaultMap | Always use the default keyboard buttonmap, avoiding buttonmaps provided by add-ons |
Implements KODI::MOUSE::IMouseInputProvider.
|
inlinevirtual |
Set the controller profile for this peripheral.
controller | The new controller profile |
Reimplemented in PERIPHERALS::CPeripheralJoystick.
|
virtual |
|
virtual |
|
inlinevirtual |
Briefly test one of the features of this peripheral.
feature | The feature to test. |
Reimplemented in PERIPHERALS::CPeripheralJoystick.
|
inline |
|
overridevirtual |
Unregister a handler.
handler | The handler that was receiving input |
Implements KODI::JOYSTICK::IInputProvider.
|
virtual |
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralJoystick.
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralKeyboard.
|
overridevirtual |
Unregisters handler from keyboard input.
handler | The handler that was receiving keyboard input |
Implements KODI::KEYBOARD::IKeyboardInputProvider.
|
inlinevirtual |
Reimplemented in PERIPHERALS::CPeripheralMouse.
|
overridevirtual |
Unregisters handler from mouse input.
handler | The handler that was receiving mouse input |
Implements KODI::MOUSE::IMouseInputProvider.
|
inline |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |