1 // Copyright 2020 yuzu Emulator Project 2 // Licensed under GPLv2 or any later version 3 // Refer to the license.txt file included. 4 5 #pragma once 6 7 #include <array> 8 #include <memory> 9 #include <QDialog> 10 11 class QGroupBox; 12 class QSpinBox; 13 14 namespace Ui { 15 class ConfigureVibration; 16 } 17 18 class ConfigureVibration : public QDialog { 19 Q_OBJECT 20 21 public: 22 explicit ConfigureVibration(QWidget* parent); 23 ~ConfigureVibration() override; 24 25 void ApplyConfiguration(); 26 27 static void SetVibrationDevices(std::size_t player_index); 28 static void SetAllVibrationDevices(); 29 30 private: 31 void changeEvent(QEvent* event) override; 32 void RetranslateUI(); 33 34 std::unique_ptr<Ui::ConfigureVibration> ui; 35 36 static constexpr std::size_t NUM_PLAYERS = 8; 37 38 // Groupboxes encapsulating the vibration strength spinbox. 39 std::array<QGroupBox*, NUM_PLAYERS> vibration_groupboxes; 40 41 // Spinboxes representing the vibration strength percentage. 42 std::array<QSpinBox*, NUM_PLAYERS> vibration_spinboxes; 43 }; 44