diff options
Diffstat (limited to 'src/common/input.h')
| -rw-r--r-- | src/common/input.h | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/common/input.h b/src/common/input.h index bb42aaacc..213aa2384 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2017 Citra Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | // Refer to the license.txt file included. | ||
| 4 | 3 | ||
| 5 | #pragma once | 4 | #pragma once |
| 6 | 5 | ||
| @@ -28,7 +27,7 @@ enum class InputType { | |||
| 28 | Color, | 27 | Color, |
| 29 | Vibration, | 28 | Vibration, |
| 30 | Nfc, | 29 | Nfc, |
| 31 | Ir, | 30 | IrSensor, |
| 32 | }; | 31 | }; |
| 33 | 32 | ||
| 34 | // Internal battery charge level | 33 | // Internal battery charge level |
| @@ -53,6 +52,15 @@ enum class PollingMode { | |||
| 53 | IR, | 52 | IR, |
| 54 | }; | 53 | }; |
| 55 | 54 | ||
| 55 | enum class CameraFormat { | ||
| 56 | Size320x240, | ||
| 57 | Size160x120, | ||
| 58 | Size80x60, | ||
| 59 | Size40x30, | ||
| 60 | Size20x15, | ||
| 61 | None, | ||
| 62 | }; | ||
| 63 | |||
| 56 | // Vibration reply from the controller | 64 | // Vibration reply from the controller |
| 57 | enum class VibrationError { | 65 | enum class VibrationError { |
| 58 | None, | 66 | None, |
| @@ -68,6 +76,13 @@ enum class PollingError { | |||
| 68 | Unknown, | 76 | Unknown, |
| 69 | }; | 77 | }; |
| 70 | 78 | ||
| 79 | // Ir camera reply from the controller | ||
| 80 | enum class CameraError { | ||
| 81 | None, | ||
| 82 | NotSupported, | ||
| 83 | Unknown, | ||
| 84 | }; | ||
| 85 | |||
| 71 | // Hint for amplification curve to be used | 86 | // Hint for amplification curve to be used |
| 72 | enum class VibrationAmplificationType { | 87 | enum class VibrationAmplificationType { |
| 73 | Linear, | 88 | Linear, |
| @@ -176,6 +191,12 @@ struct LedStatus { | |||
| 176 | bool led_4{}; | 191 | bool led_4{}; |
| 177 | }; | 192 | }; |
| 178 | 193 | ||
| 194 | // Raw data fom camera | ||
| 195 | struct CameraStatus { | ||
| 196 | CameraFormat format{CameraFormat::None}; | ||
| 197 | std::vector<u8> data{}; | ||
| 198 | }; | ||
| 199 | |||
| 179 | // List of buttons to be passed to Qt that can be translated | 200 | // List of buttons to be passed to Qt that can be translated |
| 180 | enum class ButtonNames { | 201 | enum class ButtonNames { |
| 181 | Undefined, | 202 | Undefined, |
| @@ -233,6 +254,7 @@ struct CallbackStatus { | |||
| 233 | BodyColorStatus color_status{}; | 254 | BodyColorStatus color_status{}; |
| 234 | BatteryStatus battery_status{}; | 255 | BatteryStatus battery_status{}; |
| 235 | VibrationStatus vibration_status{}; | 256 | VibrationStatus vibration_status{}; |
| 257 | CameraStatus camera_status{}; | ||
| 236 | }; | 258 | }; |
| 237 | 259 | ||
| 238 | // Triggered once every input change | 260 | // Triggered once every input change |
| @@ -281,6 +303,10 @@ public: | |||
| 281 | virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) { | 303 | virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) { |
| 282 | return PollingError::NotSupported; | 304 | return PollingError::NotSupported; |
| 283 | } | 305 | } |
| 306 | |||
| 307 | virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) { | ||
| 308 | return CameraError::NotSupported; | ||
| 309 | } | ||
| 284 | }; | 310 | }; |
| 285 | 311 | ||
| 286 | /// An abstract class template for a factory that can create input devices. | 312 | /// An abstract class template for a factory that can create input devices. |