|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Maps an SDL gamepad's haptic motors to a controller rumble output. More...
#include <SDLRumbleMapping.h>
Public Member Functions | |
| SDLRumbleMapping (uint8_t portIndex, uint8_t lowFrequencyIntensityPercentage, uint8_t highFrequencyIntensityPercentage, std::shared_ptr< ControlDeck > controlDeck=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr) | |
| Constructs an SDL rumble mapping. | |
| void | StartRumble () override |
| Starts the rumble effect with the configured intensities. | |
| void | StopRumble () override |
| Stops any active rumble effect. | |
| void | SetLowFrequencyIntensity (uint8_t intensityPercentage) override |
| Sets the low-frequency motor intensity. | |
| void | SetHighFrequencyIntensity (uint8_t intensityPercentage) override |
| Sets the high-frequency motor intensity. | |
| std::string | GetRumbleMappingId () 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::ControllerRumbleMapping | |
| ControllerRumbleMapping (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, uint8_t lowFrequencyIntensityPercentage, uint8_t highFrequencyIntensityPercentage) | |
| Constructs a ControllerRumbleMapping. | |
| ~ControllerRumbleMapping () | |
| uint8_t | GetLowFrequencyIntensityPercentage () |
| Returns the current low-frequency rumble intensity percentage. | |
| uint8_t | GetHighFrequencyIntensityPercentage () |
| Returns the current high-frequency rumble intensity percentage. | |
| bool | HighFrequencyIntensityIsDefault () |
| Checks whether the high-frequency intensity is at its default value. | |
| bool | LowFrequencyIntensityIsDefault () |
| Checks whether the low-frequency intensity is at its default value. | |
| void | ResetHighFrequencyIntensityToDefault () |
| Resets high-frequency rumble intensity to DEFAULT_HIGH_FREQUENCY_RUMBLE_PERCENTAGE. | |
| void | ResetLowFrequencyIntensityToDefault () |
| Resets low-frequency rumble intensity to DEFAULT_LOW_FREQUENCY_RUMBLE_PERCENTAGE. | |
| 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< ConsoleVariable > | mConsoleVariable |
| std::shared_ptr< ControlDeck > | mControlDeck |
Protected Attributes inherited from Ship::ControllerRumbleMapping | |
| uint8_t | mPortIndex |
| uint8_t | mLowFrequencyIntensityPercentage |
| uint8_t | mHighFrequencyIntensityPercentage |
Protected Attributes inherited from Ship::ControllerMapping | |
| PhysicalDeviceType | mPhysicalDeviceType |
Maps an SDL gamepad's haptic motors to a controller rumble output.
Controls the low-frequency and high-frequency rumble motors through the SDL haptic API, with configurable intensity percentages.
| Ship::SDLRumbleMapping::SDLRumbleMapping | ( | uint8_t | portIndex, |
| uint8_t | lowFrequencyIntensityPercentage, | ||
| uint8_t | highFrequencyIntensityPercentage, | ||
| std::shared_ptr< ControlDeck > | controlDeck = nullptr, |
||
| std::shared_ptr< ConsoleVariable > | consoleVariable = nullptr |
||
| ) |
Constructs an SDL rumble mapping.
| portIndex | The controller port index. |
| lowFrequencyIntensityPercentage | Intensity of the low-frequency motor (0–100). |
| highFrequencyIntensityPercentage | Intensity of the high-frequency motor (0–100). |
|
overridevirtual |
Removes this mapping from the application configuration.
Implements Ship::ControllerRumbleMapping.
|
overridevirtual |
Returns the human-readable name of the SDL gamepad device.
Reimplemented from Ship::ControllerMapping.
|
overridevirtual |
Returns the unique string identifier for this mapping.
Implements Ship::ControllerRumbleMapping.
|
overridevirtual |
Persists this mapping to the application configuration.
Implements Ship::ControllerRumbleMapping.
|
overridevirtual |
Sets the high-frequency motor intensity.
| intensityPercentage | The intensity percentage (0–100). |
Reimplemented from Ship::ControllerRumbleMapping.
|
overridevirtual |
Sets the low-frequency motor intensity.
| intensityPercentage | The intensity percentage (0–100). |
Reimplemented from Ship::ControllerRumbleMapping.
|
overridevirtual |
Starts the rumble effect with the configured intensities.
Implements Ship::ControllerRumbleMapping.
|
overridevirtual |
Stops any active rumble effect.
Implements Ship::ControllerRumbleMapping.
|
protected |
|
protected |