libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::SDLLEDMapping Class Referencefinal

Maps an SDL gamepad's LED to a controller LED output. More...

#include <SDLLEDMapping.h>

Inheritance diagram for Ship::SDLLEDMapping:
[legend]
Collaboration diagram for Ship::SDLLEDMapping:
[legend]

Public Member Functions

 SDLLEDMapping (uint8_t portIndex, uint8_t colorSource, Color_RGB8 savedColor, std::shared_ptr< ControlDeck > controlDeck=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr)
 Constructs an SDL LED mapping.
 
void SetLEDColor (Color_RGB8 color) override
 Sends an RGB colour to the gamepad LED.
 
std::string GetLEDMappingId () override
 Returns the unique string identifier for this mapping.
 
void SaveToConfig () override
 Persists this mapping to the application configuration.
 
void EraseFromConfig () override
 Removes this mapping from the application configuration.
 
std::string GetPhysicalDeviceName () override
 Returns the human-readable name of the SDL gamepad device.
 
- Public Member Functions inherited from Ship::ControllerLEDMapping
 ControllerLEDMapping (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, uint8_t colorSource, Color_RGB8 savedColor)
 Constructs a ControllerLEDMapping.
 
 ~ControllerLEDMapping ()
 
void SetColorSource (uint8_t colorSource)
 Sets the LED colour source mode.
 
uint8_t GetColorSource ()
 Returns the current LED colour source mode.
 
void SetSavedColor (Color_RGB8 colorToSave)
 Saves a colour for later restoration.
 
Color_RGB8 GetSavedColor ()
 Returns the previously saved LED colour.
 
void SetPortIndex (uint8_t portIndex)
 Sets the controller port index for this mapping.
 
- Public Member Functions inherited from Ship::ControllerMapping
 ControllerMapping (PhysicalDeviceType physicalDeviceType)
 Constructs a ControllerMapping for the given physical device type.
 
 ~ControllerMapping ()
 
PhysicalDeviceType GetPhysicalDeviceType ()
 Returns the physical device type for this mapping.
 

Protected Attributes

std::shared_ptr< ConsoleVariablemConsoleVariable
 
std::shared_ptr< ControlDeckmControlDeck
 
- Protected Attributes inherited from Ship::ControllerLEDMapping
uint8_t mPortIndex
 
uint8_t mColorSource
 
Color_RGB8 mSavedColor
 
- Protected Attributes inherited from Ship::ControllerMapping
PhysicalDeviceType mPhysicalDeviceType
 

Detailed Description

Maps an SDL gamepad's LED to a controller LED output.

Sets the RGB colour of the gamepad LED either from a fixed saved colour or from a dynamic colour source determined at runtime.

Constructor & Destructor Documentation

◆ SDLLEDMapping()

Ship::SDLLEDMapping::SDLLEDMapping ( uint8_t  portIndex,
uint8_t  colorSource,
Color_RGB8  savedColor,
std::shared_ptr< ControlDeck controlDeck = nullptr,
std::shared_ptr< ConsoleVariable consoleVariable = nullptr 
)

Constructs an SDL LED mapping.

Parameters
portIndexThe controller port index.
colorSourceIdentifier for the colour source strategy.
savedColorThe saved RGB colour used when the source is fixed.

Member Function Documentation

◆ EraseFromConfig()

void Ship::SDLLEDMapping::EraseFromConfig ( )
overridevirtual

Removes this mapping from the application configuration.

Implements Ship::ControllerLEDMapping.

◆ GetLEDMappingId()

std::string Ship::SDLLEDMapping::GetLEDMappingId ( )
overridevirtual

Returns the unique string identifier for this mapping.

Implements Ship::ControllerLEDMapping.

◆ GetPhysicalDeviceName()

std::string Ship::SDLLEDMapping::GetPhysicalDeviceName ( )
overridevirtual

Returns the human-readable name of the SDL gamepad device.

Reimplemented from Ship::ControllerMapping.

◆ SaveToConfig()

void Ship::SDLLEDMapping::SaveToConfig ( )
overridevirtual

Persists this mapping to the application configuration.

Implements Ship::ControllerLEDMapping.

◆ SetLEDColor()

void Ship::SDLLEDMapping::SetLEDColor ( Color_RGB8  color)
overridevirtual

Sends an RGB colour to the gamepad LED.

Parameters
colorThe colour to apply.

Implements Ship::ControllerLEDMapping.

Member Data Documentation

◆ mConsoleVariable

std::shared_ptr<ConsoleVariable> Ship::SDLLEDMapping::mConsoleVariable
protected

◆ mControlDeck

std::shared_ptr<ControlDeck> Ship::SDLLEDMapping::mControlDeck
protected

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