diff options
author | bunnei <bunneidev@gmail.com> | 2021-09-18 16:30:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-18 16:30:06 -0700 |
commit | 6e376c27a327d8e123efafe49370a304cec20221 (patch) | |
tree | a11be198f5f4933a68c8cc5cfc183e08c3b01fcb /src/yuzu/debugger/controller.h | |
parent | 35f46fc079d9534df7850eca3ce29e89e04d8914 (diff) | |
parent | 75d8ec1e9f474ce6c2bfc0b8ebe574ca44f9f3d8 (diff) |
Merge pull request #6485 from MonsterDruide1/tas
input_common: TAS with script playback & recording
Diffstat (limited to 'src/yuzu/debugger/controller.h')
-rw-r--r-- | src/yuzu/debugger/controller.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/yuzu/debugger/controller.h b/src/yuzu/debugger/controller.h index c54750070..7742db58b 100644 --- a/src/yuzu/debugger/controller.h +++ b/src/yuzu/debugger/controller.h @@ -4,18 +4,35 @@ #pragma once +#include <QFileSystemWatcher> #include <QWidget> +#include "common/settings.h" class QAction; class QHideEvent; class QShowEvent; class PlayerControlPreview; +namespace InputCommon { +class InputSubsystem; +} + +struct ControllerInput { + std::array<std::pair<float, float>, Settings::NativeAnalog::NUM_STICKS_HID> axis_values{}; + std::array<bool, Settings::NativeButton::NumButtons> button_values{}; + bool changed{}; +}; + +struct ControllerCallback { + std::function<void(ControllerInput)> input; +}; + class ControllerDialog : public QWidget { Q_OBJECT public: - explicit ControllerDialog(QWidget* parent = nullptr); + explicit ControllerDialog(QWidget* parent = nullptr, + InputCommon::InputSubsystem* input_subsystem_ = nullptr); /// Returns a QAction that can be used to toggle visibility of this dialog. QAction* toggleViewAction(); @@ -26,6 +43,9 @@ protected: void hideEvent(QHideEvent* ev) override; private: + void InputController(ControllerInput input); QAction* toggle_view_action = nullptr; + QFileSystemWatcher* watcher = nullptr; PlayerControlPreview* widget; + InputCommon::InputSubsystem* input_subsystem; }; |