Kodi Docs 20.0
Kodi is an open source media player and entertainment hub.

Base class for joystick feature primitives More...

Classes

class  kodi::addon::JoystickFeature
 

Functions

 kodi::addon::JoystickFeature::JoystickFeature (const std::string &name="", JOYSTICK_FEATURE_TYPE type=JOYSTICK_FEATURE_TYPE_UNKNOWN)
 Class constructor. More...
 
 kodi::addon::JoystickFeature::JoystickFeature (const JoystickFeature &other)
 Class copy constructor. More...
 
JoystickFeaturekodi::addon::JoystickFeature::operator= (const JoystickFeature &rhs)
 Copy data from another JoystickFeature class to here. More...
 
bool kodi::addon::JoystickFeature::operator== (const JoystickFeature &other) const
 Compare this with another class of this type. More...
 
const std::string & kodi::addon::JoystickFeature::Name (void) const
 Get name of feature. More...
 
JOYSTICK_FEATURE_TYPE kodi::addon::JoystickFeature::Type (void) const
 Get name of feature. More...
 
bool kodi::addon::JoystickFeature::IsValid () const
 Check this feature is valid. More...
 
void kodi::addon::JoystickFeature::SetName (const std::string &name)
 Set name of feature. More...
 
void kodi::addon::JoystickFeature::SetType (JOYSTICK_FEATURE_TYPE type)
 Set type of feature. More...
 
void kodi::addon::JoystickFeature::SetInvalid (void)
 Set type as invalid. More...
 
const DriverPrimitivekodi::addon::JoystickFeature::Primitive (JOYSTICK_FEATURE_PRIMITIVE which) const
 Get primitive of feature by wanted type. More...
 
void kodi::addon::JoystickFeature::SetPrimitive (JOYSTICK_FEATURE_PRIMITIVE which, const DriverPrimitive &primitive)
 Set primitive for feature by wanted type. More...
 
std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & kodi::addon::JoystickFeature::Primitives ()
 Get all primitives on this class. More...
 
const std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & kodi::addon::JoystickFeature::Primitives () const
 Get all primitives on this class (as constant). More...
 

Detailed Description

Base class for joystick feature primitives

Class for joystick features. A feature can be:

  1. scalar [1]
  2. analog stick
  3. accelerometer
  4. motor
  5. relative pointer [2]
  6. absolute pointer
  7. wheel
  8. throttle
  9. keyboard key

[1] All three driver primitives (buttons, hats and axes) have a state that can be represented using a single scalar value. For this reason, features that map to a single primitive are called "scalar features".

[2] Relative pointers are similar to analog sticks, but they use relative distances instead of positions.

Function Documentation

◆ IsValid()

bool kodi::addon::JoystickFeature::IsValid ( ) const
inline

Check this feature is valid.

Returns
True if valid (type != JOYSTICK_FEATURE_TYPE_UNKNOWN), false otherwise

◆ JoystickFeature() [1/2]

kodi::addon::JoystickFeature::JoystickFeature ( const JoystickFeature other)
inline

Class copy constructor.

Parameters
[in]otherOther class to copy on construct here

◆ JoystickFeature() [2/2]

kodi::addon::JoystickFeature::JoystickFeature ( const std::string &  name = "",
JOYSTICK_FEATURE_TYPE  type = JOYSTICK_FEATURE_TYPE_UNKNOWN 
)
inline

Class constructor.

Parameters
[in]name[optional] Name of the feature
[in]type[optional] Type of the feature, JOYSTICK_FEATURE_TYPE_UNKNOWN as default

◆ Name()

const std::string & kodi::addon::JoystickFeature::Name ( void  ) const
inline

Get name of feature.

Returns
Name of feature

◆ operator=()

JoystickFeature & kodi::addon::JoystickFeature::operator= ( const JoystickFeature rhs)
inline

Copy data from another JoystickFeature class to here.

Parameters
[in]otherOther class to copy here

◆ operator==()

bool kodi::addon::JoystickFeature::operator== ( const JoystickFeature other) const
inline

Compare this with another class of this type.

Parameters
[in]otherOther class to compare
Returns
True if they are equal, false otherwise

◆ Primitive()

const DriverPrimitive & kodi::addon::JoystickFeature::Primitive ( JOYSTICK_FEATURE_PRIMITIVE  which) const
inline

Get primitive of feature by wanted type.

Parameters
[in]whichType of feature, defined with JOYSTICK_FEATURE_PRIMITIVE
Returns
Primitive of asked type

◆ Primitives() [1/2]

std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & kodi::addon::JoystickFeature::Primitives ( )
inline

Get all primitives on this class.

Returns
Array list of primitives

◆ Primitives() [2/2]

const std::array< DriverPrimitive, JOYSTICK_PRIMITIVE_MAX > & kodi::addon::JoystickFeature::Primitives ( ) const
inline

Get all primitives on this class (as constant).

Returns
Constant a´rray list of primitives

◆ SetInvalid()

void kodi::addon::JoystickFeature::SetInvalid ( void  )
inline

Set type as invalid.

◆ SetName()

void kodi::addon::JoystickFeature::SetName ( const std::string &  name)
inline

Set name of feature.

Parameters
[in]nameName of feature

◆ SetPrimitive()

void kodi::addon::JoystickFeature::SetPrimitive ( JOYSTICK_FEATURE_PRIMITIVE  which,
const DriverPrimitive primitive 
)
inline

Set primitive for feature by wanted type.

Parameters
[in]whichType of feature, defined with JOYSTICK_FEATURE_PRIMITIVE
[in]primitiveThe with DriverPrimitive defined primitive to set

◆ SetType()

void kodi::addon::JoystickFeature::SetType ( JOYSTICK_FEATURE_TYPE  type)
inline

Set type of feature.

Parameters
[in]typeType of feature

◆ Type()

JOYSTICK_FEATURE_TYPE kodi::addon::JoystickFeature::Type ( void  ) const
inline

Get name of feature.

Returns
Type of feature defined with JOYSTICK_FEATURE_TYPE