|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Maps LED colour output to a physical controller. More...
#include <ControllerLEDMapping.h>
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 |
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.
| Ship::ControllerLEDMapping::ControllerLEDMapping | ( | PhysicalDeviceType | physicalDeviceType, |
| uint8_t | portIndex, | ||
| uint8_t | colorSource, | ||
| Color_RGB8 | savedColor | ||
| ) |
Constructs a ControllerLEDMapping.
| physicalDeviceType | The type of physical device this mapping targets. |
| portIndex | The controller port index this mapping is assigned to. |
| colorSource | The LED colour source mode (LED_COLOR_SOURCE_OFF/SET/GAME). |
| savedColor | The user-saved LED colour. |
| Ship::ControllerLEDMapping::~ControllerLEDMapping | ( | ) |
|
pure virtual |
Removes this mapping from the application configuration.
Implemented in Ship::SDLLEDMapping.
| uint8_t Ship::ControllerLEDMapping::GetColorSource | ( | ) |
Returns the current LED colour source mode.
|
pure virtual |
Returns a unique string identifier for this LED mapping.
Implemented in Ship::SDLLEDMapping.
| Color_RGB8 Ship::ControllerLEDMapping::GetSavedColor | ( | ) |
Returns the previously saved LED colour.
|
pure virtual |
Persists this mapping to the application configuration.
Implemented in Ship::SDLLEDMapping.
| void Ship::ControllerLEDMapping::SetColorSource | ( | uint8_t | colorSource | ) |
Sets the LED colour source mode.
| colorSource | The colour source constant (LED_COLOR_SOURCE_OFF/SET/GAME). |
|
pure virtual |
Applies the given colour to the physical device LED.
| color | The RGB colour to set. |
Implemented in Ship::SDLLEDMapping.
| void Ship::ControllerLEDMapping::SetPortIndex | ( | uint8_t | portIndex | ) |
Sets the controller port index for this mapping.
| portIndex | The new port index. |
| void Ship::ControllerLEDMapping::SetSavedColor | ( | Color_RGB8 | colorToSave | ) |
Saves a colour for later restoration.
| colorToSave | The RGB colour to persist. |
|
protected |
|
protected |
|
protected |