2020-08-21 07:39:24 -04:00
|
|
|
// Copyright 2020 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
|
|
|
|
2020-09-25 19:13:10 -04:00
|
|
|
namespace Service::SM {
|
|
|
|
class ServiceManager;
|
|
|
|
}
|
|
|
|
|
2020-08-21 07:39:24 -04:00
|
|
|
namespace Core::Frontend {
|
|
|
|
|
|
|
|
using BorderColor = std::array<u8, 4>;
|
2020-08-27 01:21:48 -04:00
|
|
|
using ExplainText = std::array<char, 0x81>;
|
2020-08-21 07:39:24 -04:00
|
|
|
|
|
|
|
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{};
|
2020-08-27 01:21:48 -04:00
|
|
|
bool enable_explain_text{};
|
|
|
|
std::vector<ExplainText> explain_text{};
|
2020-08-21 07:39:24 -04:00
|
|
|
bool allow_pro_controller{};
|
|
|
|
bool allow_handheld{};
|
|
|
|
bool allow_dual_joycons{};
|
|
|
|
bool allow_left_joycon{};
|
|
|
|
bool allow_right_joycon{};
|
|
|
|
};
|
|
|
|
|
|
|
|
class ControllerApplet {
|
|
|
|
public:
|
|
|
|
virtual ~ControllerApplet();
|
|
|
|
|
|
|
|
virtual void ReconfigureControllers(std::function<void()> callback,
|
2020-10-26 19:36:58 -04:00
|
|
|
const ControllerParameters& parameters) const = 0;
|
2020-08-21 07:39:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class DefaultControllerApplet final : public ControllerApplet {
|
|
|
|
public:
|
2020-09-25 19:13:10 -04:00
|
|
|
explicit DefaultControllerApplet(Service::SM::ServiceManager& service_manager_);
|
2020-08-21 07:39:24 -04:00
|
|
|
~DefaultControllerApplet() override;
|
|
|
|
|
|
|
|
void ReconfigureControllers(std::function<void()> callback,
|
2020-10-26 19:36:58 -04:00
|
|
|
const ControllerParameters& parameters) const override;
|
2020-09-25 19:13:10 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
Service::SM::ServiceManager& service_manager;
|
2020-08-21 07:39:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Core::Frontend
|