diff options
author | german77 <juangerman-13@hotmail.com> | 2021-09-21 02:43:16 +0200 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2021-11-25 03:30:23 +0100 |
commit | c3f54ff2329d79bdbb273678b5123cf0b1cd090c (patch) | |
tree | 671542346e2f692b2cef8dc4da6ccdb0b9e21dc2 /src/core/hid/hid_core.h | |
parent | yuzu_cmd: Use new input (diff) | |
download | yuzu-c3f54ff2329d79bdbb273678b5123cf0b1cd090c.tar yuzu-c3f54ff2329d79bdbb273678b5123cf0b1cd090c.tar.gz yuzu-c3f54ff2329d79bdbb273678b5123cf0b1cd090c.tar.bz2 yuzu-c3f54ff2329d79bdbb273678b5123cf0b1cd090c.tar.lz yuzu-c3f54ff2329d79bdbb273678b5123cf0b1cd090c.tar.xz yuzu-c3f54ff2329d79bdbb273678b5123cf0b1cd090c.tar.zst yuzu-c3f54ff2329d79bdbb273678b5123cf0b1cd090c.zip |
Diffstat (limited to 'src/core/hid/hid_core.h')
-rw-r--r-- | src/core/hid/hid_core.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/core/hid/hid_core.h b/src/core/hid/hid_core.h new file mode 100644 index 000000000..f11f48b61 --- /dev/null +++ b/src/core/hid/hid_core.h @@ -0,0 +1,60 @@ +// Copyright 2021 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <memory> + +#include "core/hid/emulated_console.h" +#include "core/hid/emulated_controller.h" +#include "core/hid/emulated_devices.h" + +namespace Core::HID { + +class HIDCore { +public: + explicit HIDCore(); + ~HIDCore(); + + YUZU_NON_COPYABLE(HIDCore); + YUZU_NON_MOVEABLE(HIDCore); + + EmulatedController* GetEmulatedController(NpadIdType npad_id_type); + const EmulatedController* GetEmulatedController(NpadIdType npad_id_type) const; + + EmulatedController* GetEmulatedControllerByIndex(std::size_t index); + const EmulatedController* GetEmulatedControllerByIndex(std::size_t index) const; + + EmulatedConsole* GetEmulatedConsole(); + const EmulatedConsole* GetEmulatedConsole() const; + + EmulatedDevices* GetEmulatedDevices(); + const EmulatedDevices* GetEmulatedDevices() const; + + void SetSupportedStyleTag(NpadStyleTag style_tag); + NpadStyleTag GetSupportedStyleTag() const; + + // Reloads all input devices from settings + void ReloadInputDevices(); + + // Removes all callbacks from input common + void UnloadInputDevices(); + +private: + std::unique_ptr<EmulatedController> player_1; + std::unique_ptr<EmulatedController> player_2; + std::unique_ptr<EmulatedController> player_3; + std::unique_ptr<EmulatedController> player_4; + std::unique_ptr<EmulatedController> player_5; + std::unique_ptr<EmulatedController> player_6; + std::unique_ptr<EmulatedController> player_7; + std::unique_ptr<EmulatedController> player_8; + std::unique_ptr<EmulatedController> other; + std::unique_ptr<EmulatedController> handheld; + std::unique_ptr<EmulatedConsole> console; + std::unique_ptr<EmulatedDevices> devices; + NpadStyleTag supported_style_tag; +}; + +} // namespace Core::HID |