4 #define SLIDER_TICK_COUNT 100
5 #define DETECT_WAIT_TIME 1500
6 #define PREVIEW_UPDATE_TIME 25
8 // might have to change this setup for wiimote
9 #define PROFILES_PATH "Profiles/GCPad/"
12 #include <wx/listbox.h>
13 #include <wx/textctrl.h>
14 #include <wx/button.h>
15 #include <wx/stattext.h>
16 #include <wx/combobox.h>
17 #include <wx/checkbox.h>
18 #include <wx/notebook.h>
24 #include "ControllerInterface/ControllerInterface.h"
26 #include "FileSearch.h"
31 PadSetting( ControlState
& _value
) : value(_value
) {}
34 virtual void UpdateGUI() = 0;
35 virtual void UpdateValue() = 0;
40 class PadSettingChoice
: public PadSetting
, public wxChoice
43 PadSettingChoice( wxWindow
* const parent
, ControlState
& _value
, int min
, int max
);
48 class PadSettingCheckBox
: public PadSetting
, public wxCheckBox
51 PadSettingCheckBox( wxWindow
* const parent
, ControlState
& _value
, const char* const label
);
57 class ControlChooser
: public wxStaticBoxSizer
60 ControlChooser( wxWindow
* const parent
, ControllerInterface::ControlReference
* const ref
, wxWindow
* const eventsink
);
64 ControllerInterface::ControlReference
* control_reference
;
67 wxListBox
* control_lbox
;
69 wxSlider
* range_slider
;
72 wxStaticText
* m_bound_label
;
75 class ControlList
: public wxDialog
79 ControlList( wxWindow
* const parent
, ControllerInterface::ControlReference
* const ref
, ControlChooser
* const chooser
);
82 ControlChooser
* const m_control_chooser
;
85 class ControlDialog
: public wxDialog
88 ControlDialog( wxWindow
* const parent
, ControllerInterface::ControlReference
* const ref
, const std::vector
<ControllerInterface::Device
*>& devs
);
89 void SelectControl( wxCommandEvent
& event
);
91 ControllerInterface::ControlReference
* const control_reference
;
92 wxComboBox
* device_cbox
;
93 ControlChooser
* control_chooser
;
96 class ControlButton
: public wxButton
99 ControlButton( wxWindow
* const parent
, ControllerInterface::ControlReference
* const _ref
, const unsigned int width
, const std::string
& label
= "" );
101 ControllerInterface::ControlReference
* const control_reference
;
104 class ControlGroupBox
: public wxStaticBoxSizer
107 ControlGroupBox( ControllerEmu::ControlGroup
* const group
, wxWindow
* const parent
);
109 ControllerEmu::ControlGroup
* control_group
;
110 wxStaticBitmap
* static_bitmap
;
111 std::vector
< PadSetting
* > options
;
112 std::vector
< wxButton
* > controls
;
113 std::vector
<ControlButton
*> control_buttons
;
118 class GamepadPage
: public wxNotebookPage
120 friend class ConfigDialog
;
123 GamepadPage( wxWindow
* parent
, Plugin
& plugin
, const unsigned int pad_num
, ConfigDialog
* const config_dialog
);
127 void RefreshDevices( wxCommandEvent
& event
);
129 void LoadProfile( wxCommandEvent
& event
);
130 void SaveProfile( wxCommandEvent
& event
);
131 void DeleteProfile( wxCommandEvent
& event
);
133 void ConfigControl( wxCommandEvent
& event
);
134 void ConfigDetectControl( wxCommandEvent
& event
);
135 void DetectControl( wxCommandEvent
& event
);
136 void ClearControl( wxCommandEvent
& event
);
138 void SetDevice( wxCommandEvent
& event
);
139 void SetControl( wxCommandEvent
& event
);
141 void ClearAll( wxCommandEvent
& event
);
143 void AdjustControlOption( wxCommandEvent
& event
);
144 void AdjustSetting( wxCommandEvent
& event
);
146 wxComboBox
* profile_cbox
;
147 wxComboBox
* device_cbox
;
149 std::vector
<ControlGroupBox
*> control_groups
;
153 ControllerEmu
* const controller
;
157 ControlDialog
* m_control_dialog
;
159 ConfigDialog
* const m_config_dialog
;
162 class ConfigDialog
: public wxDialog
166 ConfigDialog( wxWindow
* const parent
, Plugin
& plugin
, const std::string
& name
, const bool _is_game_running
);
169 void ClickSave( wxCommandEvent
& event
);
171 void UpdateDeviceComboBox();
172 void UpdateProfileComboBox();
174 void UpdateControlReferences();
175 void UpdateBitmaps(wxTimerEvent
&);
177 const bool is_game_running
;
181 wxNotebook
* m_pad_notebook
;
182 std::vector
<GamepadPage
*> m_padpages
;
184 wxTimer
* m_update_timer
;