diff options
Diffstat (limited to 'src/input_common/tas/tas_poller.h')
| -rw-r--r-- | src/input_common/tas/tas_poller.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/input_common/tas/tas_poller.h b/src/input_common/tas/tas_poller.h new file mode 100644 index 000000000..09e426cef --- /dev/null +++ b/src/input_common/tas/tas_poller.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | // Copyright 2021 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 <memory> | ||
| 8 | #include "core/frontend/input.h" | ||
| 9 | #include "input_common/tas/tas_input.h" | ||
| 10 | |||
| 11 | namespace InputCommon { | ||
| 12 | |||
| 13 | /** | ||
| 14 | * A button device factory representing a tas bot. It receives tas events and forward them | ||
| 15 | * to all button devices it created. | ||
| 16 | */ | ||
| 17 | class TasButtonFactory final : public Input::Factory<Input::ButtonDevice> { | ||
| 18 | public: | ||
| 19 | explicit TasButtonFactory(std::shared_ptr<TasInput::Tas> tas_input_); | ||
| 20 | |||
| 21 | /** | ||
| 22 | * Creates a button device from a button press | ||
| 23 | * @param params contains parameters for creating the device: | ||
| 24 | * - "code": the code of the key to bind with the button | ||
| 25 | */ | ||
| 26 | std::unique_ptr<Input::ButtonDevice> Create(const Common::ParamPackage& params) override; | ||
| 27 | |||
| 28 | private: | ||
| 29 | std::shared_ptr<TasInput::Tas> tas_input; | ||
| 30 | }; | ||
| 31 | |||
| 32 | /// An analog device factory that creates analog devices from tas | ||
| 33 | class TasAnalogFactory final : public Input::Factory<Input::AnalogDevice> { | ||
| 34 | public: | ||
| 35 | explicit TasAnalogFactory(std::shared_ptr<TasInput::Tas> tas_input_); | ||
| 36 | |||
| 37 | std::unique_ptr<Input::AnalogDevice> Create(const Common::ParamPackage& params) override; | ||
| 38 | |||
| 39 | private: | ||
| 40 | std::shared_ptr<TasInput::Tas> tas_input; | ||
| 41 | }; | ||
| 42 | |||
| 43 | } // namespace InputCommon | ||