mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
76d83ffbec
This allows for better compiler errors, where the compiler will state a copy or move couldn't occur due to the relevant function being deleted. Previously a compiler would warn about the relevant function not being accessible (which, while true, isn't as informative as it could be).
84 lines
2.5 KiB
C++
84 lines
2.5 KiB
C++
// Copyright 2021 yuzu Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "common/common_funcs.h"
|
|
#include "core/hid/hid_types.h"
|
|
|
|
namespace Core::HID {
|
|
class EmulatedConsole;
|
|
class EmulatedController;
|
|
class EmulatedDevices;
|
|
} // namespace Core::HID
|
|
|
|
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;
|
|
|
|
/// Counts the connected players from P1-P8
|
|
s8 GetPlayerCount() const;
|
|
|
|
/// Returns the first connected npad id
|
|
NpadIdType GetFirstNpadId() const;
|
|
|
|
/// Returns the first disconnected npad id
|
|
NpadIdType GetFirstDisconnectedNpadId() const;
|
|
|
|
/// Sets all emulated controllers into configuring mode.
|
|
void EnableAllControllerConfiguration();
|
|
|
|
/// Sets all emulated controllers into normal mode.
|
|
void DisableAllControllerConfiguration();
|
|
|
|
/// Reloads all input devices from settings
|
|
void ReloadInputDevices();
|
|
|
|
/// Removes all callbacks from input common
|
|
void UnloadInputDevices();
|
|
|
|
/// Number of emulated controllers
|
|
static constexpr std::size_t available_controllers{10};
|
|
|
|
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{NpadStyleSet::All};
|
|
};
|
|
|
|
} // namespace Core::HID
|