Add multiple input profile support

Only supported in the Qt frontend.
This commit is contained in:
Valentin Vanelslande 2018-12-28 19:24:56 -05:00
parent 3989c17cb0
commit 7c95032e3a
10 changed files with 415 additions and 165 deletions

View file

@ -7,6 +7,7 @@
#include <array>
#include <string>
#include <unordered_map>
#include <vector>
#include "common/common_types.h"
#include "core/hle/service/cam/cam.h"
@ -92,11 +93,8 @@ static const std::array<const char*, NumAnalogs> mapping = {{
}};
} // namespace NativeAnalog
struct Values {
// CheckNew3DS
bool is_new_3ds;
// Controls
struct InputProfile {
std::string name;
std::array<std::string, NativeButton::NumButtons> buttons;
std::array<std::string, NativeAnalog::NumAnalogs> analogs;
std::string motion_device;
@ -104,6 +102,23 @@ struct Values {
std::string udp_input_address;
u16 udp_input_port;
u8 udp_pad_index;
};
struct Values {
// CheckNew3DS
bool is_new_3ds;
// Current controls
std::array<std::string, NativeButton::NumButtons> buttons;
std::array<std::string, NativeAnalog::NumAnalogs> analogs;
std::string motion_device;
std::string touch_device;
std::string udp_input_address;
u16 udp_input_port;
u8 udp_pad_index;
int profile; ///< The current input profile index
std::vector<InputProfile> profiles; ///< The list of input profiles
// Core
bool use_cpu_jit;
@ -176,4 +191,11 @@ static constexpr int REGION_VALUE_AUTO_SELECT = -1;
void Apply();
void LogSettings();
// input profiles
void LoadProfile(int index);
void SaveProfile(int index);
void CreateProfile(std::string name);
void DeleteProfile(int index);
void RenameCurrentProfile(std::string new_name);
} // namespace Settings