summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
diff options
context:
space:
mode:
authorOatmealDome <OatmealDome@users.noreply.github.com>2025-01-07 16:55:55 -0500
committerGitHub <noreply@github.com>2025-01-07 16:55:55 -0500
commit696b363f478961bb18420b79ef9f09eabd600e55 (patch)
tree18f9f1c178a08ca694f42867288e78b01732c5c5 /Source/Core/InputCommon/ControllerInterface/CoreDevice.h
parentb35f7af355dad22b1b2d408c5d17d781e506686f (diff)
parentf12846a0e93ea9ad69f884fb850cce379bc5bed0 (diff)
Merge pull request #13162 from jordan-woyak/non-blocking-input-detection
DolphinQt/InputCommon: Make input mapping and output testing non-blocking.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.h')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/CoreDevice.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
index cd8256396e..0370fce894 100644
--- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
+++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
@@ -245,5 +245,32 @@ protected:
mutable std::recursive_mutex m_devices_mutex;
std::vector<std::shared_ptr<Device>> m_devices;
};
+
+class InputDetector
+{
+public:
+ using Detection = DeviceContainer::InputDetection;
+
+ InputDetector();
+ ~InputDetector();
+
+ void Start(const DeviceContainer& container, const std::vector<std::string>& device_strings);
+ void Update(std::chrono::milliseconds initial_wait, std::chrono::milliseconds confirmation_wait,
+ std::chrono::milliseconds maximum_wait);
+ bool IsComplete() const;
+
+ const std::vector<Detection>& GetResults() const;
+
+ // move-return'd to prevent copying.
+ std::vector<Detection> TakeResults();
+
+private:
+ struct Impl;
+
+ Clock::time_point m_start_time;
+ std::vector<Detection> m_detections;
+ std::unique_ptr<Impl> m_state;
+};
+
} // namespace Core
} // namespace ciface