service: hid: Fully implement abstract vibration

This commit is contained in:
Narr the Reg 2024-01-10 22:06:54 -06:00 committed by german77
parent fa21d6ee85
commit e2313faec9
31 changed files with 905 additions and 448 deletions

View file

@ -355,11 +355,28 @@ public:
/// Returns the latest ntag status from the controller
const NfcState& GetNfc() const;
/**
* Sends an on/off vibration to the left device
* @return true if vibration had no errors
*/
bool SetVibration(bool should_vibrate);
/**
* Sends an GC vibration to the left device
* @return true if vibration had no errors
*/
bool SetVibration(u32 slot, Core::HID::VibrationGcErmCommand erm_command);
/**
* Sends a specific vibration to the output device
* @return true if vibration had no errors
*/
bool SetVibration(std::size_t device_index, VibrationValue vibration);
bool SetVibration(DeviceIndex device_index, const VibrationValue& vibration);
/**
* @return The last sent vibration
*/
VibrationValue GetActualVibrationValue(DeviceIndex device_index) const;
/**
* Sends a small vibration to the output device
@ -564,6 +581,7 @@ private:
f32 motion_sensitivity{Core::HID::MotionInput::IsAtRestStandard};
u32 turbo_button_state{0};
std::size_t nfc_handles{0};
VibrationValue last_vibration_value{DEFAULT_VIBRATION_VALUE};
// Temporary values to avoid doing changes while the controller is in configuring mode
NpadStyleIndex tmp_npad_type{NpadStyleIndex::None};