Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Wrapper class for peripheral events
To handle data of change events between add-on and Kodi. More...

Classes

class  kodi::addon::PeripheralEvent
 

Functions

 kodi::addon::PeripheralEvent::PeripheralEvent ()=default
 Constructor.
 
 kodi::addon::PeripheralEvent::PeripheralEvent (unsigned int peripheralIndex, unsigned int buttonIndex, JOYSTICK_STATE_BUTTON state)
 Constructor.
 
 kodi::addon::PeripheralEvent::PeripheralEvent (unsigned int peripheralIndex, unsigned int hatIndex, JOYSTICK_STATE_HAT state)
 Constructor.
 
 kodi::addon::PeripheralEvent::PeripheralEvent (unsigned int peripheralIndex, unsigned int axisIndex, JOYSTICK_STATE_AXIS state)
 Constructor.
 
PERIPHERAL_EVENT_TYPE kodi::addon::PeripheralEvent::Type (void) const
 Get type of event.
 
unsigned int kodi::addon::PeripheralEvent::PeripheralIndex (void) const
 Get peripheral index.
 
unsigned int kodi::addon::PeripheralEvent::DriverIndex (void) const
 Get driver index.
 
JOYSTICK_STATE_BUTTON kodi::addon::PeripheralEvent::ButtonState (void) const
 Get button state.
 
JOYSTICK_STATE_HAT kodi::addon::PeripheralEvent::HatState (void) const
 Get hat state.
 
JOYSTICK_STATE_AXIS kodi::addon::PeripheralEvent::AxisState (void) const
 Get axis state.
 
JOYSTICK_STATE_MOTOR kodi::addon::PeripheralEvent::MotorState (void) const
 Get motor state.
 
void kodi::addon::PeripheralEvent::SetType (PERIPHERAL_EVENT_TYPE type)
 Set type of event.
 
void kodi::addon::PeripheralEvent::SetPeripheralIndex (unsigned int index)
 Set peripheral index.
 
void kodi::addon::PeripheralEvent::SetDriverIndex (unsigned int index)
 Set driver index.
 
void kodi::addon::PeripheralEvent::SetButtonState (JOYSTICK_STATE_BUTTON state)
 Set button state.
 
void kodi::addon::PeripheralEvent::SetHatState (JOYSTICK_STATE_HAT state)
 Set hat state.
 
void kodi::addon::PeripheralEvent::SetAxisState (JOYSTICK_STATE_AXIS state)
 Set axis state.
 
void kodi::addon::PeripheralEvent::SetMotorState (JOYSTICK_STATE_MOTOR state)
 Set motor state.
 

Detailed Description

Wrapper class for peripheral events
To handle data of change events between add-on and Kodi.

Used on kodi::addon::CInstancePeripheral::GetEvents() and kodi::addon::CInstancePeripheral::SendEvent().


@ingroup cpp_kodi_addon_peripheral_Defs_Peripheral_PeripheralEvent

The following table contains values that can be set with class PeripheralEvent :

Name Type Set call Get call
Peripheral event type PERIPHERAL_EVENT_TYPE SetType Type
Peripheral index unsigned int SetPeripheralIndex PeripheralIndex
Peripheral event driver index unsigned int SetDriverIndex DriverIndex
Peripheral event button state JOYSTICK_STATE_BUTTON SetButtonState ButtonState
Peripheral event hat state JOYSTICK_STATE_HAT SetHatState HatState
Peripheral event axis state JOYSTICK_STATE_AXIS (float) SetAxisState AxisState
Peripheral event motor state JOYSTICK_STATE_MOTOR (float) SetMotorState MotorState

Further are several class constructors with values included.

Function Documentation

◆ AxisState()

JOYSTICK_STATE_AXIS kodi::addon::PeripheralEvent::AxisState ( void ) const
inline

Get axis state.

Returns
Axis state

◆ ButtonState()

JOYSTICK_STATE_BUTTON kodi::addon::PeripheralEvent::ButtonState ( void ) const
inline

Get button state.

Returns
Button state as JOYSTICK_STATE_BUTTON

◆ DriverIndex()

unsigned int kodi::addon::PeripheralEvent::DriverIndex ( void ) const
inline

Get driver index.

Returns
Driver index number

◆ HatState()

JOYSTICK_STATE_HAT kodi::addon::PeripheralEvent::HatState ( void ) const
inline

Get hat state.

Returns
Hat state

◆ MotorState()

JOYSTICK_STATE_MOTOR kodi::addon::PeripheralEvent::MotorState ( void ) const
inline

Get motor state.

Returns
Motor state

◆ PeripheralEvent() [1/4]

kodi::addon::PeripheralEvent::PeripheralEvent ( )
default

Constructor.

◆ PeripheralEvent() [2/4]

kodi::addon::PeripheralEvent::PeripheralEvent ( unsigned int peripheralIndex,
unsigned int axisIndex,
JOYSTICK_STATE_AXIS state )
inline

Constructor.

Parameters
[in]peripheralIndexPeripheral index
[in]axisIndexAxis index
[in]stateJoystick state axis

◆ PeripheralEvent() [3/4]

kodi::addon::PeripheralEvent::PeripheralEvent ( unsigned int peripheralIndex,
unsigned int buttonIndex,
JOYSTICK_STATE_BUTTON state )
inline

Constructor.

Parameters
[in]peripheralIndexPeripheral index
[in]buttonIndexButton index
[in]stateJoystick state button

◆ PeripheralEvent() [4/4]

kodi::addon::PeripheralEvent::PeripheralEvent ( unsigned int peripheralIndex,
unsigned int hatIndex,
JOYSTICK_STATE_HAT state )
inline

Constructor.

Parameters
[in]peripheralIndexPeripheral index
[in]hatIndexHat index
[in]stateJoystick state hat

◆ PeripheralIndex()

unsigned int kodi::addon::PeripheralEvent::PeripheralIndex ( void ) const
inline

Get peripheral index.

Returns
Peripheral index number

◆ SetAxisState()

void kodi::addon::PeripheralEvent::SetAxisState ( JOYSTICK_STATE_AXIS state)
inline

Set axis state.

Parameters
[in]stateAxis state as JOYSTICK_STATE_AXIS (float)

◆ SetButtonState()

void kodi::addon::PeripheralEvent::SetButtonState ( JOYSTICK_STATE_BUTTON state)
inline

Set button state.

Parameters
[in]stateButton state as JOYSTICK_STATE_BUTTON

◆ SetDriverIndex()

void kodi::addon::PeripheralEvent::SetDriverIndex ( unsigned int index)
inline

Set driver index.

Parameters
[in]indexDriver index number

◆ SetHatState()

void kodi::addon::PeripheralEvent::SetHatState ( JOYSTICK_STATE_HAT state)
inline

Set hat state.

Parameters
[in]stateHat state as JOYSTICK_STATE_HAT (float)

◆ SetMotorState()

void kodi::addon::PeripheralEvent::SetMotorState ( JOYSTICK_STATE_MOTOR state)
inline

Set motor state.

Parameters
[in]stateMotor state as JOYSTICK_STATE_MOTOR (float)

◆ SetPeripheralIndex()

void kodi::addon::PeripheralEvent::SetPeripheralIndex ( unsigned int index)
inline

Set peripheral index.

Parameters
[in]indexPeripheral index number

◆ SetType()

void kodi::addon::PeripheralEvent::SetType ( PERIPHERAL_EVENT_TYPE type)
inline

Set type of event.

Parameters
[in]typeType defined with PERIPHERAL_EVENT_TYPE

◆ Type()

PERIPHERAL_EVENT_TYPE kodi::addon::PeripheralEvent::Type ( void ) const
inline

Get type of event.

Returns
Type defined with PERIPHERAL_EVENT_TYPE