InputProfile.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2018 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. class InputConfig;
  5. namespace ControllerEmu
  6. {
  7. class EmulatedController;
  8. }
  9. #include <string>
  10. #include <vector>
  11. namespace InputProfile
  12. {
  13. std::vector<std::string> GetProfilesFromSetting(const std::string& setting,
  14. const std::string& root);
  15. enum class CycleDirection : int
  16. {
  17. Forward = 1,
  18. Backward = -1
  19. };
  20. class ProfileCycler
  21. {
  22. public:
  23. void NextWiimoteProfile(int controller_index);
  24. void PreviousWiimoteProfile(int controller_index);
  25. void NextWiimoteProfileForGame(int controller_index);
  26. void PreviousWiimoteProfileForGame(int controller_index);
  27. private:
  28. void CycleProfile(CycleDirection cycle_direction, InputConfig* device_configuration,
  29. int& profile_index, int controller_index);
  30. void CycleProfileForGame(CycleDirection cycle_direction, InputConfig* device_configuration,
  31. int& profile_index, const std::string& setting, int controller_index);
  32. std::vector<std::string> GetProfilesForDevice(InputConfig* device_configuration);
  33. std::string GetProfile(CycleDirection cycle_direction, int& profile_index,
  34. const std::vector<std::string>& profiles);
  35. std::vector<std::string> GetMatchingProfilesFromSetting(const std::string& setting,
  36. const std::vector<std::string>& profiles,
  37. InputConfig* device_configuration);
  38. void UpdateToProfile(const std::string& profile_filename,
  39. ControllerEmu::EmulatedController* controller,
  40. InputConfig* device_configuration);
  41. std::string GetWiimoteInputProfilesForGame(int controller_index);
  42. int m_wiimote_profile_index = 0;
  43. };
  44. } // namespace InputProfile