mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-14 20:27:51 +00:00
yuzu: config: Vibrate the controller while configuring vibration strength
This commit is contained in:
parent
c597d37bbf
commit
6b132458dc
5 changed files with 95 additions and 8 deletions
|
@ -15,11 +15,16 @@ namespace Ui {
|
|||
class ConfigureVibration;
|
||||
}
|
||||
|
||||
namespace Core::HID {
|
||||
enum class ControllerTriggerType;
|
||||
class HIDCore;
|
||||
} // namespace Core::HID
|
||||
|
||||
class ConfigureVibration : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureVibration(QWidget* parent);
|
||||
explicit ConfigureVibration(QWidget* parent, Core::HID::HIDCore& hid_core_);
|
||||
~ConfigureVibration() override;
|
||||
|
||||
void ApplyConfiguration();
|
||||
|
@ -27,14 +32,21 @@ public:
|
|||
private:
|
||||
void changeEvent(QEvent* event) override;
|
||||
void RetranslateUI();
|
||||
void VibrateController(Core::HID::ControllerTriggerType type, std::size_t player_index);
|
||||
void StopVibrations();
|
||||
|
||||
std::unique_ptr<Ui::ConfigureVibration> ui;
|
||||
|
||||
static constexpr std::size_t NUM_PLAYERS = 8;
|
||||
|
||||
// Groupboxes encapsulating the vibration strength spinbox.
|
||||
/// Groupboxes encapsulating the vibration strength spinbox.
|
||||
std::array<QGroupBox*, NUM_PLAYERS> vibration_groupboxes;
|
||||
|
||||
// Spinboxes representing the vibration strength percentage.
|
||||
/// Spinboxes representing the vibration strength percentage.
|
||||
std::array<QSpinBox*, NUM_PLAYERS> vibration_spinboxes;
|
||||
|
||||
/// Callback index to stop the controllers events
|
||||
std::array<int, NUM_PLAYERS> controller_callback_key;
|
||||
|
||||
Core::HID::HIDCore& hid_core;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue