diff options
author | bunnei <bunneidev@gmail.com> | 2020-08-27 20:58:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 20:58:44 +0200 |
commit | 3db9a259771a44278ff34168ba140c2c7815a1cf (patch) | |
tree | e341942ba33f882468837d763004ae7de5fe0053 /src/input_common/udp | |
parent | Merge pull request #4577 from lioncash/asserts (diff) | |
parent | input_common/main: Add "/Mouse" to the display name (diff) | |
download | yuzu-3db9a259771a44278ff34168ba140c2c7815a1cf.tar yuzu-3db9a259771a44278ff34168ba140c2c7815a1cf.tar.gz yuzu-3db9a259771a44278ff34168ba140c2c7815a1cf.tar.bz2 yuzu-3db9a259771a44278ff34168ba140c2c7815a1cf.tar.lz yuzu-3db9a259771a44278ff34168ba140c2c7815a1cf.tar.xz yuzu-3db9a259771a44278ff34168ba140c2c7815a1cf.tar.zst yuzu-3db9a259771a44278ff34168ba140c2c7815a1cf.zip |
Diffstat (limited to 'src/input_common/udp')
-rw-r--r-- | src/input_common/udp/udp.cpp | 14 | ||||
-rw-r--r-- | src/input_common/udp/udp.h | 7 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/input_common/udp/udp.cpp b/src/input_common/udp/udp.cpp index 8c6ef1394..4b347e47e 100644 --- a/src/input_common/udp/udp.cpp +++ b/src/input_common/udp/udp.cpp @@ -77,10 +77,11 @@ State::State() { std::make_unique<Client>(status, Settings::values.udp_input_address, Settings::values.udp_input_port, Settings::values.udp_pad_index); - Input::RegisterFactory<Input::TouchDevice>("cemuhookudp", - std::make_shared<UDPTouchFactory>(status)); - Input::RegisterFactory<Input::MotionDevice>("cemuhookudp", - std::make_shared<UDPMotionFactory>(status)); + motion_factory = std::make_shared<UDPMotionFactory>(status); + touch_factory = std::make_shared<UDPTouchFactory>(status); + + Input::RegisterFactory<Input::MotionDevice>("cemuhookudp", motion_factory); + Input::RegisterFactory<Input::TouchDevice>("cemuhookudp", touch_factory); } State::~State() { @@ -88,6 +89,11 @@ State::~State() { Input::UnregisterFactory<Input::MotionDevice>("cemuhookudp"); } +std::vector<Common::ParamPackage> State::GetInputDevices() const { + // TODO support binding udp devices + return {}; +} + void State::ReloadUDPClient() { client->ReloadSocket(Settings::values.udp_input_address, Settings::values.udp_input_port, Settings::values.udp_pad_index); diff --git a/src/input_common/udp/udp.h b/src/input_common/udp/udp.h index 4f83f0441..672a5c812 100644 --- a/src/input_common/udp/udp.h +++ b/src/input_common/udp/udp.h @@ -5,19 +5,26 @@ #pragma once #include <memory> +#include <vector> +#include "common/param_package.h" namespace InputCommon::CemuhookUDP { class Client; +class UDPMotionFactory; +class UDPTouchFactory; class State { public: State(); ~State(); void ReloadUDPClient(); + std::vector<Common::ParamPackage> GetInputDevices() const; private: std::unique_ptr<Client> client; + std::shared_ptr<UDPMotionFactory> motion_factory; + std::shared_ptr<UDPTouchFactory> touch_factory; }; std::unique_ptr<State> Init(); |