yuzu/src/core/frontend/applets/controller.h

57 lines
1.4 KiB
C
Raw Normal View History

2022-04-23 22:49:07 +04:00
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2020-12-28 19:15:37 +04:00
#pragma once
#include <functional>
#include "common/common_types.h"
2021-11-15 05:13:48 +04:00
namespace Core::HID {
class HIDCore;
2020-12-28 19:15:37 +04:00
}
namespace Core::Frontend {
using BorderColor = std::array<u8, 4>;
using ExplainText = std::array<char, 0x81>;
struct ControllerParameters {
s8 min_players{};
s8 max_players{};
bool keep_controllers_connected{};
bool enable_single_mode{};
bool enable_border_color{};
std::vector<BorderColor> border_colors{};
bool enable_explain_text{};
std::vector<ExplainText> explain_text{};
bool allow_pro_controller{};
bool allow_handheld{};
bool allow_dual_joycons{};
bool allow_left_joycon{};
bool allow_right_joycon{};
2021-02-09 07:25:58 +04:00
bool allow_gamecube_controller{};
2020-12-28 19:15:37 +04:00
};
class ControllerApplet {
public:
virtual ~ControllerApplet();
virtual void ReconfigureControllers(std::function<void()> callback,
const ControllerParameters& parameters) const = 0;
};
class DefaultControllerApplet final : public ControllerApplet {
public:
2021-11-15 05:13:48 +04:00
explicit DefaultControllerApplet(HID::HIDCore& hid_core_);
2020-12-28 19:15:37 +04:00
~DefaultControllerApplet() override;
void ReconfigureControllers(std::function<void()> callback,
const ControllerParameters& parameters) const override;
private:
2021-11-15 05:13:48 +04:00
HID::HIDCore& hid_core;
2020-12-28 19:15:37 +04:00
};
} // namespace Core::Frontend