libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
SDLRumbleMapping.h
Go to the documentation of this file.
2#include "SDLMapping.h"
3#include <memory>
4
5namespace Ship {
6class ConsoleVariable;
7class ControlDeck;
8
16 public:
23 SDLRumbleMapping(uint8_t portIndex, uint8_t lowFrequencyIntensityPercentage,
24 uint8_t highFrequencyIntensityPercentage, std::shared_ptr<ControlDeck> controlDeck = nullptr,
25 std::shared_ptr<ConsoleVariable> consoleVariable = nullptr);
26
28 void StartRumble() override;
29
31 void StopRumble() override;
32
37 void SetLowFrequencyIntensity(uint8_t intensityPercentage) override;
38
43 void SetHighFrequencyIntensity(uint8_t intensityPercentage) override;
44
46 std::string GetRumbleMappingId() override;
47
49 void SaveToConfig() override;
50
52 void EraseFromConfig() override;
53
55 std::string GetPhysicalDeviceName() override;
56
57 protected:
58 std::shared_ptr<ConsoleVariable> mConsoleVariable;
59 std::shared_ptr<ControlDeck> mControlDeck;
60
61 private:
62 uint16_t mLowFrequencyIntensity;
63 uint16_t mHighFrequencyIntensity;
64};
65} // namespace Ship
Maps rumble (haptic feedback) output to a physical controller.
Definition ControllerRumbleMapping.h:18
Maps an SDL gamepad's haptic motors to a controller rumble output.
Definition SDLRumbleMapping.h:15
std::shared_ptr< ConsoleVariable > mConsoleVariable
Definition SDLRumbleMapping.h:58
void EraseFromConfig() override
Removes this mapping from the application configuration.
void SetHighFrequencyIntensity(uint8_t intensityPercentage) override
Sets the high-frequency motor intensity.
void SetLowFrequencyIntensity(uint8_t intensityPercentage) override
Sets the low-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 StopRumble() override
Stops any active rumble effect.
std::string GetPhysicalDeviceName() override
Returns the human-readable name of the SDL gamepad device.
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.
std::shared_ptr< ControlDeck > mControlDeck
Definition SDLRumbleMapping.h:59
void StartRumble() override
Starts the rumble effect with the configured intensities.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14