input_profiles: Implement input profiles

This commit is contained in:
Morph
2020-09-23 09:52:25 -04:00
parent 75eaab2e0f
commit 57d89e291d
13 changed files with 506 additions and 127 deletions

View File

@ -26,6 +26,8 @@ class QString;
class QTimer;
class QWidget;
class InputProfiles;
namespace InputCommon {
class InputSubsystem;
}
@ -45,7 +47,7 @@ class ConfigureInputPlayer : public QWidget {
public:
explicit ConfigureInputPlayer(QWidget* parent, std::size_t player_index, QWidget* bottom_row,
InputCommon::InputSubsystem* input_subsystem_,
bool debug = false);
InputProfiles* profiles_, bool debug = false);
~ConfigureInputPlayer() override;
/// Save all button configurations to settings file.
@ -116,6 +118,21 @@ private:
/// Gets the default controller mapping for this device and auto configures the input to match.
void UpdateMappingWithDefaults();
/// Creates a controller profile.
void CreateProfile();
/// Deletes the selected controller profile.
void DeleteProfile();
/// Loads the selected controller profile.
void LoadProfile();
/// Saves the current controller configuration into a selected controller profile.
void SaveProfile();
/// Refreshes the list of controller profiles.
void RefreshInputProfiles();
std::unique_ptr<Ui::ConfigureInputPlayer> ui;
std::size_t player_index;
@ -123,6 +140,8 @@ private:
InputCommon::InputSubsystem* input_subsystem;
InputProfiles* profiles;
std::unique_ptr<QTimer> timeout_timer;
std::unique_ptr<QTimer> poll_timer;