ControllerConfigDiag.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Copyright 2010 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <array>
  6. #include <map>
  7. #include <wx/dialog.h>
  8. #include "Common/SysConf.h"
  9. #include "Core/ConfigManager.h"
  10. #include "Core/HW/SI_GCAdapter.h"
  11. #include "Core/HW/Wiimote.h"
  12. class InputConfig;
  13. class wxButton;
  14. class wxStaticBoxSizer;
  15. class ControllerConfigDiag : public wxDialog
  16. {
  17. public:
  18. ControllerConfigDiag(wxWindow* const parent);
  19. ~ControllerConfigDiag();
  20. private:
  21. void RefreshRealWiimotes(wxCommandEvent& event);
  22. void ConfigEmulatedWiimote(wxCommandEvent& event);
  23. void SelectSource(wxCommandEvent& event);
  24. void RevertSource();
  25. void Save(wxCommandEvent& event);
  26. void OnSensorBarPos(wxCommandEvent& event)
  27. {
  28. SConfig::GetInstance().m_SYSCONF->SetData("BT.BAR", event.GetInt());
  29. event.Skip();
  30. }
  31. void OnSensorBarSensitivity(wxCommandEvent& event)
  32. {
  33. SConfig::GetInstance().m_SYSCONF->SetData("BT.SENS", event.GetInt());
  34. event.Skip();
  35. }
  36. void OnSpeakerVolume(wxCommandEvent& event)
  37. {
  38. SConfig::GetInstance().m_SYSCONF->SetData("BT.SPKV", event.GetInt());
  39. event.Skip();
  40. }
  41. void OnMotor(wxCommandEvent& event)
  42. {
  43. SConfig::GetInstance().m_SYSCONF->SetData("BT.MOT", event.GetInt());
  44. event.Skip();
  45. }
  46. void OnContinuousScanning(wxCommandEvent& event)
  47. {
  48. SConfig::GetInstance().m_WiimoteContinuousScanning = event.IsChecked();
  49. WiimoteReal::Initialize();
  50. event.Skip();
  51. }
  52. void OnEnableSpeaker(wxCommandEvent& event)
  53. {
  54. SConfig::GetInstance().m_WiimoteEnableSpeaker = event.IsChecked();
  55. event.Skip();
  56. }
  57. void OnGameCubeAdapter(wxCommandEvent& event)
  58. {
  59. SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked();
  60. event.Skip();
  61. }
  62. void OnAdapterRumble(wxCommandEvent& event)
  63. {
  64. SConfig::GetInstance().m_AdapterRumble = event.IsChecked();
  65. }
  66. wxStaticBoxSizer* CreateGamecubeSizer();
  67. wxStaticBoxSizer* CreateWiimoteConfigSizer();
  68. wxStaticBoxSizer* CreateBalanceBoardSizer();
  69. wxStaticBoxSizer* CreateRealWiimoteSizer();
  70. wxStaticBoxSizer* CreateGeneralWiimoteSettingsSizer();
  71. void Cancel(wxCommandEvent& event);
  72. void OnGameCubePortChanged(wxCommandEvent& event);
  73. void OnGameCubeConfigButton(wxCommandEvent& event);
  74. void ScheduleAdapterUpdate();
  75. void UpdateAdapter(wxCommandEvent& ev);
  76. std::map<wxWindowID, unsigned int> m_gc_port_choice_ids;
  77. std::map<wxWindowID, unsigned int> m_gc_port_config_ids;
  78. std::array<wxString, 8> m_gc_pad_type_strs;
  79. std::map<wxWindowID, unsigned int> m_wiimote_index_from_ctrl_id;
  80. unsigned int m_orig_wiimote_sources[MAX_BBMOTES];
  81. wxStaticText* m_adapter_status;
  82. wxButton* wiimote_configure_bt[MAX_WIIMOTES];
  83. wxButton* gamecube_configure_bt[4];
  84. std::map<wxWindowID, unsigned int> m_wiimote_index_from_conf_bt_id;
  85. };