summaryrefslogtreecommitdiff
path: root/src/input_common/udp/udp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common/udp/udp.h')
-rw-r--r--src/input_common/udp/udp.h54
1 files changed, 43 insertions, 11 deletions
diff --git a/src/input_common/udp/udp.h b/src/input_common/udp/udp.h
index 4f83f0441..ea3fd4175 100644
--- a/src/input_common/udp/udp.h
+++ b/src/input_common/udp/udp.h
@@ -1,25 +1,57 @@
1// Copyright 2018 Citra Emulator Project 1// Copyright 2020 yuzu Emulator Project
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#pragma once 5#pragma once
6 6
7#include <memory> 7#include <memory>
8#include "core/frontend/input.h"
9#include "input_common/udp/client.h"
8 10
9namespace InputCommon::CemuhookUDP { 11namespace InputCommon {
10 12
11class Client; 13/// A motion device factory that creates motion devices from udp clients
12 14class UDPMotionFactory final : public Input::Factory<Input::MotionDevice> {
13class State {
14public: 15public:
15 State(); 16 explicit UDPMotionFactory(std::shared_ptr<CemuhookUDP::Client> client_);
16 ~State(); 17
17 void ReloadUDPClient(); 18 std::unique_ptr<Input::MotionDevice> Create(const Common::ParamPackage& params) override;
19
20 Common::ParamPackage GetNextInput();
21
22 /// For device input configuration/polling
23 void BeginConfiguration();
24 void EndConfiguration();
25
26 bool IsPolling() const {
27 return polling;
28 }
18 29
19private: 30private:
20 std::unique_ptr<Client> client; 31 std::shared_ptr<CemuhookUDP::Client> client;
32 bool polling = false;
21}; 33};
22 34
23std::unique_ptr<State> Init(); 35/// A touch device factory that creates touch devices from udp clients
36class UDPTouchFactory final : public Input::Factory<Input::TouchDevice> {
37public:
38 explicit UDPTouchFactory(std::shared_ptr<CemuhookUDP::Client> client_);
39
40 std::unique_ptr<Input::TouchDevice> Create(const Common::ParamPackage& params) override;
41
42 Common::ParamPackage GetNextInput();
43
44 /// For device input configuration/polling
45 void BeginConfiguration();
46 void EndConfiguration();
47
48 bool IsPolling() const {
49 return polling;
50 }
51
52private:
53 std::shared_ptr<CemuhookUDP::Client> client;
54 bool polling = false;
55};
24 56
25} // namespace InputCommon::CemuhookUDP 57} // namespace InputCommon