Merge pull request #4538 from valentinvanelslande/profiles
Add multiple input profile support
This commit is contained in:
commit
95a57a2fe3
14 changed files with 518 additions and 280 deletions
|
@ -2,6 +2,7 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <utility>
|
||||
#include "audio_core/dsp_interface.h"
|
||||
#include "core/core.h"
|
||||
#include "core/gdbstub/gdbstub.h"
|
||||
|
@ -101,4 +102,32 @@ void LogSettings() {
|
|||
LogSetting("Debugging_GdbstubPort", Settings::values.gdbstub_port);
|
||||
}
|
||||
|
||||
void LoadProfile(int index) {
|
||||
Settings::values.current_input_profile = Settings::values.input_profiles[index];
|
||||
Settings::values.current_input_profile_index = index;
|
||||
}
|
||||
|
||||
void SaveProfile(int index) {
|
||||
Settings::values.input_profiles[index] = Settings::values.current_input_profile;
|
||||
}
|
||||
|
||||
void CreateProfile(std::string name) {
|
||||
Settings::InputProfile profile = values.current_input_profile;
|
||||
profile.name = std::move(name);
|
||||
Settings::values.input_profiles.push_back(std::move(profile));
|
||||
Settings::values.current_input_profile_index =
|
||||
static_cast<int>(Settings::values.input_profiles.size()) - 1;
|
||||
Settings::LoadProfile(Settings::values.current_input_profile_index);
|
||||
}
|
||||
|
||||
void DeleteProfile(int index) {
|
||||
Settings::values.input_profiles.erase(Settings::values.input_profiles.begin() + index);
|
||||
Settings::LoadProfile(0);
|
||||
}
|
||||
|
||||
void RenameCurrentProfile(std::string new_name) {
|
||||
Settings::values.input_profiles[Settings::values.current_input_profile_index].name =
|
||||
std::move(new_name);
|
||||
}
|
||||
|
||||
} // namespace Settings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue