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

Factory for creating ControllerLEDMapping instances. More...

#include <LEDMappingFactory.h>

Static Public Member Functions

static std::shared_ptr< ControllerLEDMappingCreateLEDMappingFromConfig (uint8_t portIndex, std::string id, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck)
 Deserializes an LED mapping from the configuration string.
 
static std::shared_ptr< ControllerLEDMappingCreateLEDMappingFromSDLInput (uint8_t portIndex, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck)
 Creates an LED mapping from live SDL input for interactive binding.
 

Detailed Description

Factory for creating ControllerLEDMapping instances.

LEDMappingFactory provides static helpers to create ControllerLEDMapping instances that map game controller LED output states to physical controller LED devices. It supports deserializing LED mappings from persisted configuration and creating mappings from live SDL input events during interactive binding.

LED mappings enable visual feedback (e.g., lighting or color changes) on physical controllers in response to in-game events.

All factory methods require a ConsoleVariable and ControlDeck to track state and configuration.

Typical usage (within ControlDeck or ConfigUI):

portIndex, mappingId, consoleVariable, controlDeck);
static std::shared_ptr< ControllerLEDMapping > CreateLEDMappingFromConfig(uint8_t portIndex, std::string id, std::shared_ptr< ConsoleVariable > consoleVariable, std::shared_ptr< ControlDeck > controlDeck)
Deserializes an LED mapping from the configuration string.

Member Function Documentation

◆ CreateLEDMappingFromConfig()

static std::shared_ptr< ControllerLEDMapping > Ship::LEDMappingFactory::CreateLEDMappingFromConfig ( uint8_t  portIndex,
std::string  id,
std::shared_ptr< ConsoleVariable consoleVariable,
std::shared_ptr< ControlDeck controlDeck 
)
static

Deserializes an LED mapping from the configuration string.

Parameters
portIndexThe controller port index (0-based).
idConfiguration string encoding the LED output target.
consoleVariableConsoleVariable for persisting the mapping.
controlDeckControlDeck for physical device access.
Returns
The deserialized mapping, or nullptr if the configuration string is invalid.

◆ CreateLEDMappingFromSDLInput()

static std::shared_ptr< ControllerLEDMapping > Ship::LEDMappingFactory::CreateLEDMappingFromSDLInput ( uint8_t  portIndex,
std::shared_ptr< ConsoleVariable consoleVariable,
std::shared_ptr< ControlDeck controlDeck 
)
static

Creates an LED mapping from live SDL input for interactive binding.

Parameters
portIndexThe controller port index (0-based).
consoleVariableConsoleVariable for persisting the mapping.
controlDeckControlDeck for physical device access.
Returns
The newly created mapping, or nullptr if no LED device is detected.

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