2017-02-09 03:15:43 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-02-09 03:15:43 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
|
2020-02-09 02:36:26 +00:00
|
|
|
#include "InputCommon/ControlReference/ControlReference.h"
|
2017-02-09 03:15:43 +00:00
|
|
|
|
|
|
|
namespace ControllerEmu
|
|
|
|
{
|
2023-05-29 23:31:19 +00:00
|
|
|
enum class Translatability
|
2018-04-10 15:22:30 +00:00
|
|
|
{
|
|
|
|
DoNotTranslate,
|
|
|
|
Translate
|
|
|
|
};
|
|
|
|
|
2017-02-09 03:15:43 +00:00
|
|
|
class Control
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~Control();
|
|
|
|
|
2020-02-09 02:36:26 +00:00
|
|
|
template <typename T = ControlState>
|
2021-05-04 20:47:55 +00:00
|
|
|
T GetState() const
|
2020-02-09 02:36:26 +00:00
|
|
|
{
|
|
|
|
return control_ref->GetState<T>();
|
|
|
|
}
|
|
|
|
|
2017-02-09 03:15:43 +00:00
|
|
|
std::unique_ptr<ControlReference> const control_ref;
|
2018-04-10 15:22:30 +00:00
|
|
|
const Translatability translate;
|
2017-02-09 03:15:43 +00:00
|
|
|
const std::string name;
|
2017-04-30 12:53:33 +00:00
|
|
|
const std::string ui_name;
|
2017-02-09 03:15:43 +00:00
|
|
|
|
|
|
|
protected:
|
2019-10-27 16:04:08 +00:00
|
|
|
Control(std::unique_ptr<ControlReference> ref, Translatability translate, std::string name,
|
|
|
|
std::string ui_name);
|
|
|
|
Control(std::unique_ptr<ControlReference> ref, Translatability translate, std::string name);
|
2017-02-09 03:15:43 +00:00
|
|
|
};
|
2020-02-09 02:36:26 +00:00
|
|
|
|
2017-02-09 03:15:43 +00:00
|
|
|
} // namespace ControllerEmu
|