2017-02-09 03:15:43 +00:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "Common/IniFile.h"
|
|
|
|
|
|
|
|
namespace ControllerEmu
|
|
|
|
{
|
2017-02-26 20:00:24 +00:00
|
|
|
class BooleanSetting;
|
2017-02-09 03:15:43 +00:00
|
|
|
class Control;
|
2017-02-26 20:00:24 +00:00
|
|
|
class NumericSetting;
|
2017-02-09 03:15:43 +00:00
|
|
|
|
2017-02-25 05:35:02 +00:00
|
|
|
enum class GroupType
|
2017-02-09 03:15:43 +00:00
|
|
|
{
|
2017-02-25 05:35:02 +00:00
|
|
|
Other,
|
|
|
|
Stick,
|
|
|
|
MixedTriggers,
|
|
|
|
Buttons,
|
|
|
|
Force,
|
2019-01-01 14:32:39 +00:00
|
|
|
Attachments,
|
2017-02-25 05:35:02 +00:00
|
|
|
Tilt,
|
|
|
|
Cursor,
|
|
|
|
Triggers,
|
|
|
|
Slider
|
2017-02-09 03:15:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ControlGroup
|
|
|
|
{
|
|
|
|
public:
|
2017-02-25 05:35:02 +00:00
|
|
|
explicit ControlGroup(const std::string& name, GroupType type = GroupType::Other);
|
|
|
|
ControlGroup(const std::string& name, const std::string& ui_name,
|
|
|
|
GroupType type = GroupType::Other);
|
2017-02-09 03:15:43 +00:00
|
|
|
virtual ~ControlGroup();
|
|
|
|
|
|
|
|
virtual void LoadConfig(IniFile::Section* sec, const std::string& defdev = "",
|
|
|
|
const std::string& base = "");
|
|
|
|
virtual void SaveConfig(IniFile::Section* sec, const std::string& defdev = "",
|
|
|
|
const std::string& base = "");
|
|
|
|
|
|
|
|
void SetControlExpression(int index, const std::string& expression);
|
|
|
|
|
|
|
|
const std::string name;
|
|
|
|
const std::string ui_name;
|
2017-02-25 05:35:02 +00:00
|
|
|
const GroupType type;
|
2017-02-09 03:15:43 +00:00
|
|
|
|
|
|
|
std::vector<std::unique_ptr<Control>> controls;
|
|
|
|
std::vector<std::unique_ptr<NumericSetting>> numeric_settings;
|
|
|
|
std::vector<std::unique_ptr<BooleanSetting>> boolean_settings;
|
|
|
|
};
|
|
|
|
} // namespace ControllerEmu
|