diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-20 13:34:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-20 13:34:54 -0500 |
| commit | 5838779162897606a3525eb619379a56b2eec027 (patch) | |
| tree | 3c3530e2f955545968fcc605122aa7565f4b5f1a /src/hid_core/frontend/emulated_controller.h | |
| parent | 23fd1041c1373aea8ac36236c8bc681f9483d25d (diff) | |
| parent | 2cacb9d48c98603176e52ecc94f2374a934797fb (diff) | |
Merge pull request #12660 from german77/better-vibration
service: hid: Fully implement abstract vibration
Diffstat (limited to 'src/hid_core/frontend/emulated_controller.h')
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index 90e536e07..168abe089 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h @@ -356,10 +356,27 @@ public: 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}; |
