summaryrefslogtreecommitdiffstats
path: root/src/input_common/udp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-07-22 16:39:53 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-08-26 08:32:32 +0200
commitf0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01 (patch)
tree4438688a9b9b4bc015985f2df1a731de57fe50db /src/input_common/udp
parentMerge pull request #4582 from lioncash/xbyak (diff)
downloadyuzu-f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01.tar
yuzu-f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01.tar.gz
yuzu-f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01.tar.bz2
yuzu-f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01.tar.lz
yuzu-f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01.tar.xz
yuzu-f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01.tar.zst
yuzu-f0fac0c7fb6f7dd9fe81747b3369767c8c9e7d01.zip
Diffstat (limited to 'src/input_common/udp')
-rw-r--r--src/input_common/udp/udp.cpp15
-rw-r--r--src/input_common/udp/udp.h7
2 files changed, 18 insertions, 4 deletions
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<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,12 @@ State::~State() {
Input::UnregisterFactory<Input::MotionDevice>("cemuhookudp");
}
+std::vector<Common::ParamPackage> State::GetInputDevices() {
+ std::vector<Common::ParamPackage> 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 <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();
private:
std::unique_ptr<Client> client;
+ std::shared_ptr<UDPMotionFactory> motion_factory;
+ std::shared_ptr<UDPTouchFactory> touch_factory;
};
std::unique_ptr<State> Init();