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

Maps rumble (haptic feedback) output to a physical controller. More...

#include <ControllerRumbleMapping.h>

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

Public Member Functions

 ControllerRumbleMapping (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, uint8_t lowFrequencyIntensityPercentage, uint8_t highFrequencyIntensityPercentage)
 Constructs a ControllerRumbleMapping.
 
 ~ControllerRumbleMapping ()
 
virtual void StartRumble ()=0
 Activates rumble on the physical device.
 
virtual void StopRumble ()=0
 Deactivates rumble on the physical device.
 
virtual void SetLowFrequencyIntensity (uint8_t intensityPercentage)
 Sets the low-frequency rumble intensity.
 
virtual void SetHighFrequencyIntensity (uint8_t intensityPercentage)
 Sets the high-frequency rumble intensity.
 
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.
 
virtual std::string GetRumbleMappingId ()=0
 Returns a unique string identifier for this rumble 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 mLowFrequencyIntensityPercentage
 
uint8_t mHighFrequencyIntensityPercentage
 
- Protected Attributes inherited from Ship::ControllerMapping
PhysicalDeviceType mPhysicalDeviceType
 

Detailed Description

Maps rumble (haptic feedback) output to a physical controller.

Provides low-frequency and high-frequency rumble intensity control. Subclasses implement the device-specific start/stop rumble behaviour for their hardware.

Constructor & Destructor Documentation

◆ ControllerRumbleMapping()

Ship::ControllerRumbleMapping::ControllerRumbleMapping ( PhysicalDeviceType  physicalDeviceType,
uint8_t  portIndex,
uint8_t  lowFrequencyIntensityPercentage,
uint8_t  highFrequencyIntensityPercentage 
)

Constructs a ControllerRumbleMapping.

Parameters
physicalDeviceTypeThe type of physical device this mapping targets.
portIndexThe controller port index this mapping is assigned to.
lowFrequencyIntensityPercentageInitial low-frequency rumble intensity percentage.
highFrequencyIntensityPercentageInitial high-frequency rumble intensity percentage.

◆ ~ControllerRumbleMapping()

Ship::ControllerRumbleMapping::~ControllerRumbleMapping ( )

Member Function Documentation

◆ EraseFromConfig()

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

Removes this mapping from the application configuration.

Implemented in Ship::SDLRumbleMapping.

◆ GetHighFrequencyIntensityPercentage()

uint8_t Ship::ControllerRumbleMapping::GetHighFrequencyIntensityPercentage ( )

Returns the current high-frequency rumble intensity percentage.

Returns
The intensity percentage.

◆ GetLowFrequencyIntensityPercentage()

uint8_t Ship::ControllerRumbleMapping::GetLowFrequencyIntensityPercentage ( )

Returns the current low-frequency rumble intensity percentage.

Returns
The intensity percentage.

◆ GetRumbleMappingId()

virtual std::string Ship::ControllerRumbleMapping::GetRumbleMappingId ( )
pure virtual

Returns a unique string identifier for this rumble mapping.

Returns
The mapping identifier string.

Implemented in Ship::SDLRumbleMapping.

◆ HighFrequencyIntensityIsDefault()

bool Ship::ControllerRumbleMapping::HighFrequencyIntensityIsDefault ( )

Checks whether the high-frequency intensity is at its default value.

Returns
true if at default, false otherwise.

◆ LowFrequencyIntensityIsDefault()

bool Ship::ControllerRumbleMapping::LowFrequencyIntensityIsDefault ( )

Checks whether the low-frequency intensity is at its default value.

Returns
true if at default, false otherwise.

◆ ResetHighFrequencyIntensityToDefault()

void Ship::ControllerRumbleMapping::ResetHighFrequencyIntensityToDefault ( )

Resets high-frequency rumble intensity to DEFAULT_HIGH_FREQUENCY_RUMBLE_PERCENTAGE.

◆ ResetLowFrequencyIntensityToDefault()

void Ship::ControllerRumbleMapping::ResetLowFrequencyIntensityToDefault ( )

Resets low-frequency rumble intensity to DEFAULT_LOW_FREQUENCY_RUMBLE_PERCENTAGE.

◆ SaveToConfig()

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

Persists this mapping to the application configuration.

Implemented in Ship::SDLRumbleMapping.

◆ SetHighFrequencyIntensity()

virtual void Ship::ControllerRumbleMapping::SetHighFrequencyIntensity ( uint8_t  intensityPercentage)
virtual

Sets the high-frequency rumble intensity.

Parameters
intensityPercentageThe intensity as a percentage (0–100).

Reimplemented in Ship::SDLRumbleMapping.

◆ SetLowFrequencyIntensity()

virtual void Ship::ControllerRumbleMapping::SetLowFrequencyIntensity ( uint8_t  intensityPercentage)
virtual

Sets the low-frequency rumble intensity.

Parameters
intensityPercentageThe intensity as a percentage (0–100).

Reimplemented in Ship::SDLRumbleMapping.

◆ SetPortIndex()

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

Sets the controller port index for this mapping.

Parameters
portIndexThe new port index.

◆ StartRumble()

virtual void Ship::ControllerRumbleMapping::StartRumble ( )
pure virtual

Activates rumble on the physical device.

Implemented in Ship::SDLRumbleMapping.

◆ StopRumble()

virtual void Ship::ControllerRumbleMapping::StopRumble ( )
pure virtual

Deactivates rumble on the physical device.

Implemented in Ship::SDLRumbleMapping.

Member Data Documentation

◆ mHighFrequencyIntensityPercentage

uint8_t Ship::ControllerRumbleMapping::mHighFrequencyIntensityPercentage
protected

◆ mLowFrequencyIntensityPercentage

uint8_t Ship::ControllerRumbleMapping::mLowFrequencyIntensityPercentage
protected

◆ mPortIndex

uint8_t Ship::ControllerRumbleMapping::mPortIndex
protected

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