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

Maps LED colour output to a physical controller. More...

#include <ControllerLEDMapping.h>

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

Public Member Functions

 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.
 
virtual void SetLEDColor (Color_RGB8 color)=0
 Applies the given colour to the physical device LED.
 
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.
 
virtual std::string GetLEDMappingId ()=0
 Returns a unique string identifier for this LED mapping.
 
virtual void SaveToConfig ()=0
 Persists this mapping to the application configuration.
 
virtual void EraseFromConfig ()=0
 Removes this mapping from the application configuration.
 
- Public Member Functions inherited from Ship::ControllerMapping
 ControllerMapping (PhysicalDeviceType physicalDeviceType)
 Constructs a ControllerMapping for the given physical device type.
 
 ~ControllerMapping ()
 
virtual std::string GetPhysicalDeviceName ()
 Returns a human-readable name for the physical device associated with this mapping.
 
PhysicalDeviceType GetPhysicalDeviceType ()
 Returns the physical device type for this mapping.
 

Protected Attributes

uint8_t mPortIndex
 
uint8_t mColorSource
 
Color_RGB8 mSavedColor
 
- Protected Attributes inherited from Ship::ControllerMapping
PhysicalDeviceType mPhysicalDeviceType
 

Detailed Description

Maps LED colour output to a physical controller.

Manages the colour source mode (off, user-set, or game-driven) and the saved colour value. Subclasses implement the device-specific LED colour update for their hardware.

Constructor & Destructor Documentation

◆ ControllerLEDMapping()

Ship::ControllerLEDMapping::ControllerLEDMapping ( PhysicalDeviceType  physicalDeviceType,
uint8_t  portIndex,
uint8_t  colorSource,
Color_RGB8  savedColor 
)

Constructs a ControllerLEDMapping.

Parameters
physicalDeviceTypeThe type of physical device this mapping targets.
portIndexThe controller port index this mapping is assigned to.
colorSourceThe LED colour source mode (LED_COLOR_SOURCE_OFF/SET/GAME).
savedColorThe user-saved LED colour.

◆ ~ControllerLEDMapping()

Ship::ControllerLEDMapping::~ControllerLEDMapping ( )

Member Function Documentation

◆ EraseFromConfig()

virtual void Ship::ControllerLEDMapping::EraseFromConfig ( )
pure virtual

Removes this mapping from the application configuration.

Implemented in Ship::SDLLEDMapping.

◆ GetColorSource()

uint8_t Ship::ControllerLEDMapping::GetColorSource ( )

Returns the current LED colour source mode.

Returns
The colour source constant.

◆ GetLEDMappingId()

virtual std::string Ship::ControllerLEDMapping::GetLEDMappingId ( )
pure virtual

Returns a unique string identifier for this LED mapping.

Returns
The mapping identifier string.

Implemented in Ship::SDLLEDMapping.

◆ GetSavedColor()

Color_RGB8 Ship::ControllerLEDMapping::GetSavedColor ( )

Returns the previously saved LED colour.

Returns
The saved Color_RGB8 value.

◆ SaveToConfig()

virtual void Ship::ControllerLEDMapping::SaveToConfig ( )
pure virtual

Persists this mapping to the application configuration.

Implemented in Ship::SDLLEDMapping.

◆ SetColorSource()

void Ship::ControllerLEDMapping::SetColorSource ( uint8_t  colorSource)

Sets the LED colour source mode.

Parameters
colorSourceThe colour source constant (LED_COLOR_SOURCE_OFF/SET/GAME).

◆ SetLEDColor()

virtual void Ship::ControllerLEDMapping::SetLEDColor ( Color_RGB8  color)
pure virtual

Applies the given colour to the physical device LED.

Parameters
colorThe RGB colour to set.

Implemented in Ship::SDLLEDMapping.

◆ SetPortIndex()

void Ship::ControllerLEDMapping::SetPortIndex ( uint8_t  portIndex)

Sets the controller port index for this mapping.

Parameters
portIndexThe new port index.

◆ SetSavedColor()

void Ship::ControllerLEDMapping::SetSavedColor ( Color_RGB8  colorToSave)

Saves a colour for later restoration.

Parameters
colorToSaveThe RGB colour to persist.

Member Data Documentation

◆ mColorSource

uint8_t Ship::ControllerLEDMapping::mColorSource
protected

◆ mPortIndex

uint8_t Ship::ControllerLEDMapping::mPortIndex
protected

◆ mSavedColor

Color_RGB8 Ship::ControllerLEDMapping::mSavedColor
protected

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