diff options
| author | 2021-10-11 00:43:11 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:24 -0600 | |
| commit | 06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch) | |
| tree | 867fa1153c7285c858cdb5bd7f60f08266532a88 /src/core/hid/emulated_controller.h | |
| parent | core: Update input interpreter (diff) | |
| download | yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.gz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.xz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.zip | |
core/hid: Add output devices
Diffstat (limited to 'src/core/hid/emulated_controller.h')
| -rw-r--r-- | src/core/hid/emulated_controller.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index 94db9b00b..322d2cab0 100644 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h | |||
| @@ -33,12 +33,14 @@ using ControllerMotionDevices = | |||
| 33 | using TriggerDevices = | 33 | using TriggerDevices = |
| 34 | std::array<std::unique_ptr<Input::InputDevice>, Settings::NativeTrigger::NumTriggers>; | 34 | std::array<std::unique_ptr<Input::InputDevice>, Settings::NativeTrigger::NumTriggers>; |
| 35 | using BatteryDevices = std::array<std::unique_ptr<Input::InputDevice>, 2>; | 35 | using BatteryDevices = std::array<std::unique_ptr<Input::InputDevice>, 2>; |
| 36 | using OutputDevices = std::array<std::unique_ptr<Input::OutputDevice>, 2>; | ||
| 36 | 37 | ||
| 37 | using ButtonParams = std::array<Common::ParamPackage, Settings::NativeButton::NumButtons>; | 38 | using ButtonParams = std::array<Common::ParamPackage, Settings::NativeButton::NumButtons>; |
| 38 | using StickParams = std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs>; | 39 | using StickParams = std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs>; |
| 39 | using ControllerMotionParams = std::array<Common::ParamPackage, Settings::NativeMotion::NumMotions>; | 40 | using ControllerMotionParams = std::array<Common::ParamPackage, Settings::NativeMotion::NumMotions>; |
| 40 | using TriggerParams = std::array<Common::ParamPackage, Settings::NativeTrigger::NumTriggers>; | 41 | using TriggerParams = std::array<Common::ParamPackage, Settings::NativeTrigger::NumTriggers>; |
| 41 | using BatteryParams = std::array<Common::ParamPackage, 2>; | 42 | using BatteryParams = std::array<Common::ParamPackage, 2>; |
| 43 | using OutputParams = std::array<Common::ParamPackage, 2>; | ||
| 42 | 44 | ||
| 43 | using ButtonValues = std::array<Input::ButtonStatus, Settings::NativeButton::NumButtons>; | 45 | using ButtonValues = std::array<Input::ButtonStatus, Settings::NativeButton::NumButtons>; |
| 44 | using SticksValues = std::array<Input::StickStatus, Settings::NativeAnalog::NumAnalogs>; | 46 | using SticksValues = std::array<Input::StickStatus, Settings::NativeAnalog::NumAnalogs>; |
| @@ -94,6 +96,7 @@ struct ControllerStatus { | |||
| 94 | ControllerColors colors_state{}; | 96 | ControllerColors colors_state{}; |
| 95 | BatteryLevelState battery_state{}; | 97 | BatteryLevelState battery_state{}; |
| 96 | }; | 98 | }; |
| 99 | |||
| 97 | enum class ControllerTriggerType { | 100 | enum class ControllerTriggerType { |
| 98 | Button, | 101 | Button, |
| 99 | Stick, | 102 | Stick, |
| @@ -137,6 +140,9 @@ public: | |||
| 137 | /// Gets the NpadType for this controller. | 140 | /// Gets the NpadType for this controller. |
| 138 | NpadType GetNpadType() const; | 141 | NpadType GetNpadType() const; |
| 139 | 142 | ||
| 143 | /// Gets the NpadType for this controller. | ||
| 144 | LedPattern GetLedPattern() const; | ||
| 145 | |||
| 140 | void Connect(); | 146 | void Connect(); |
| 141 | void Disconnect(); | 147 | void Disconnect(); |
| 142 | 148 | ||
| @@ -179,7 +185,9 @@ public: | |||
| 179 | BatteryLevelState GetBattery() const; | 185 | BatteryLevelState GetBattery() const; |
| 180 | 186 | ||
| 181 | bool SetVibration(std::size_t device_index, VibrationValue vibration); | 187 | bool SetVibration(std::size_t device_index, VibrationValue vibration); |
| 182 | int TestVibration(std::size_t device_index); | 188 | bool TestVibration(std::size_t device_index); |
| 189 | |||
| 190 | void SetLedPattern(); | ||
| 183 | 191 | ||
| 184 | int SetCallback(ControllerUpdateCallback update_callback); | 192 | int SetCallback(ControllerUpdateCallback update_callback); |
| 185 | void DeleteCallback(int key); | 193 | void DeleteCallback(int key); |
| @@ -215,13 +223,14 @@ private: | |||
| 215 | ControllerMotionParams motion_params; | 223 | ControllerMotionParams motion_params; |
| 216 | TriggerParams trigger_params; | 224 | TriggerParams trigger_params; |
| 217 | BatteryParams battery_params; | 225 | BatteryParams battery_params; |
| 226 | OutputParams output_params; | ||
| 218 | 227 | ||
| 219 | ButtonDevices button_devices; | 228 | ButtonDevices button_devices; |
| 220 | StickDevices stick_devices; | 229 | StickDevices stick_devices; |
| 221 | ControllerMotionDevices motion_devices; | 230 | ControllerMotionDevices motion_devices; |
| 222 | TriggerDevices trigger_devices; | 231 | TriggerDevices trigger_devices; |
| 223 | BatteryDevices battery_devices; | 232 | BatteryDevices battery_devices; |
| 224 | // VibrationDevices vibration_devices; | 233 | OutputDevices output_devices; |
| 225 | 234 | ||
| 226 | mutable std::mutex mutex; | 235 | mutable std::mutex mutex; |
| 227 | std::unordered_map<int, ControllerUpdateCallback> callback_list; | 236 | std::unordered_map<int, ControllerUpdateCallback> callback_list; |