From f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Wed, 22 Jul 2020 10:39:53 -0400 Subject: =?UTF-8?q?Project=20Mj=C3=B6lnir:=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: James Rowe Co-authored-by: Its-Rei --- src/input_common/udp/udp.cpp | 15 +++++++++++---- src/input_common/udp/udp.h | 7 +++++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'src/input_common/udp') diff --git a/src/input_common/udp/udp.cpp b/src/input_common/udp/udp.cpp index 8c6ef1394..60cf47123 100644 --- a/src/input_common/udp/udp.cpp +++ b/src/input_common/udp/udp.cpp @@ -77,10 +77,11 @@ State::State() { std::make_unique(status, Settings::values.udp_input_address, Settings::values.udp_input_port, Settings::values.udp_pad_index); - Input::RegisterFactory("cemuhookudp", - std::make_shared(status)); - Input::RegisterFactory("cemuhookudp", - std::make_shared(status)); + motion_factory = std::make_shared(status); + touch_factory = std::make_shared(status); + + Input::RegisterFactory("cemuhookudp", motion_factory); + Input::RegisterFactory("cemuhookudp", touch_factory); } State::~State() { @@ -88,6 +89,12 @@ State::~State() { Input::UnregisterFactory("cemuhookudp"); } +std::vector State::GetInputDevices() { + std::vector devices = {}; + // TODO support binding udp devices + return devices; +} + 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..24f6e0857 100644 --- a/src/input_common/udp/udp.h +++ b/src/input_common/udp/udp.h @@ -5,19 +5,26 @@ #pragma once #include +#include +#include "common/param_package.h" namespace InputCommon::CemuhookUDP { class Client; +class UDPMotionFactory; +class UDPTouchFactory; class State { public: State(); ~State(); void ReloadUDPClient(); + std::vector GetInputDevices(); private: std::unique_ptr client; + std::shared_ptr motion_factory; + std::shared_ptr touch_factory; }; std::unique_ptr Init(); -- cgit v1.2.3