Debian Codegraph @

code/tabs/BasicSettingsPage.h

raw
1 /*
2 Copyright (C) 2009-2010 wxLauncher Team
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #ifndef BASICSETTINGSPAGE_H
20 #define BASICSETTINGSPAGE_H
21
22 #include <vector>
23
24 #include <wx/wx.h>
25
26 #include "controls/TruncatableChoice.h"
27
28 #include "global/ModDefaults.h"
29
30 class BasicSettingsPage : public wxPanel {
31 public:
32 BasicSettingsPage(wxWindow* parent);
33 ~BasicSettingsPage();
34
35 void OnSelectTC(wxCommandEvent &event);
36 void OnTCChanged(wxCommandEvent &event);
37
38 void OnSelectExecutable(wxCommandEvent &event);
39 void OnPressExecutableChoiceRefreshButton(wxCommandEvent &event);
40 void OnSelectFredExecutable(wxCommandEvent &event);
41 void OnPressFredExecutableChoiceRefreshButton(wxCommandEvent &event);
42
43 void OnSelectVideoResolution(wxCommandEvent &event);
44 void OnSelectVideoDepth(wxCommandEvent &event);
45 void OnSelectVideoAnisotropic(wxCommandEvent &event);
46 void OnSelectVideoAntiAlias(wxCommandEvent &event);
47 void OnSelectVideoTextureFilter(wxCommandEvent &event);
48
49 void OnSelectSpeechVoice(wxCommandEvent &event);
50 void OnChangeSpeechVolume(wxCommandEvent &event);
51 void OnPlaySpeechText(wxCommandEvent &event);
52 void OnToggleSpeechInTechroom(wxCommandEvent &event);
53 void OnToggleSpeechInBriefing(wxCommandEvent &event);
54 void OnToggleSpeechInGame(wxCommandEvent &event);
55 void OnToggleSpeechInMulti(wxCommandEvent &event);
56 void OnGetMoreVoices(wxCommandEvent &event);
57
58 void OnSelectNetworkType(wxCommandEvent &event);
59 void OnSelectNetworkSpeed(wxCommandEvent &event);
60 void OnChangePort(wxCommandEvent &event);
61 void OnChangeIP(wxCommandEvent &event);
62
63 void OnSelectSoundDevice(wxCommandEvent &event);
64 void OnSelectCaptureDevice(wxCommandEvent &event);
65 void OnToggleEnableEFX(wxCommandEvent &event);
66 void OnChangeSampleRate(wxCommandEvent &event);
67 void OnDownloadOpenAL(wxCommandEvent& event);
68 void OnDetectOpenAL(wxCommandEvent& event);
69
70 void OnSelectJoystick(wxCommandEvent& event);
71 void OnCheckForceFeedback(wxCommandEvent& event);
72 void OnCheckDirectionalHit(wxCommandEvent& event);
73 void OnCalibrateJoystick(wxCommandEvent& event);
74 void OnDetectJoystick(wxCommandEvent& event);
75
76 void ProfileChanged(wxCommandEvent& event);
77 void OnFlagFileProcessingStatusChanged(wxCommandEvent& event);
78 void OnFREDEnabledChanged(wxCommandEvent& event);
79 void OnActiveModChanged(wxCommandEvent& event);
80
81 private:
82 static void FillFSOExecutableDropBox(wxChoice* exeChoice, wxFileName path);
83 static void FillFredExecutableDropBox(wxChoice* exeChoice, wxFileName path);
84 static void FillExecutableDropBox(wxChoice* exeChoice, wxArrayString exes);
85
86 void SetUpResolution(
87 long minHorizRes = DEFAULT_MOD_RESOLUTION_MIN_HORIZONTAL_RES,
88 long minVertRes = DEFAULT_MOD_RESOLUTION_MIN_VERTICAL_RES);
89 static void FillResolutionDropBox(wxChoice* resChoice, long minHorizRes, long minVertRes);
90 static int GetMaxSupportedResolution(const wxChoice& resChoice, long& width, long& height);
91
92 enum ReasonForExecutableDisabling {
93 MISSING_TC_ROOT_FOLDER,
94 NONEXISTENT_TC_ROOT_FOLDER,
95 INVALID_TC_ROOT_FOLDER
96 };
97
98 void InitializeMemberVariables();
99 void DisableExecutableChoiceControls(const ReasonForExecutableDisabling reason);
100 void OnCurrentBinaryChanged(wxCommandEvent& event);
101 void OnCurrentFredBinaryChanged(wxCommandEvent& event);
102 void ShowSettings(const bool showSettings);
103 void OpenNonSCPWebSite(wxString url);
104
105 enum SoundDeviceType {
106 PLAYBACK,
107 CAPTURE
108 };
109
110 void InitializeSoundDeviceDropDownBox(const SoundDeviceType deviceType);
111 void SetupOpenALSection();
112 void SetupJoystickSection();
113 void SetupControlsForJoystick(unsigned int i);
114
115 DECLARE_EVENT_TABLE();
116
117 private:
118 wxStaticText* soundDeviceText;
119 TruncatableChoice* soundDeviceCombo;
120 wxStaticText* captureDeviceText;
121 TruncatableChoice* captureDeviceCombo;
122 wxStaticText* openALVersion;
123 wxButton* downloadOpenALButton;
124 wxButton* detectOpenALButton;
125
126 wxSizer* audioButtonsSizer;
127 wxSizer* audioOldSoundSizer;
128 wxSizer* audioNewSoundSizer;
129 wxSizer* audioNewSoundDeviceSizer;
130 wxSizer* audioSizer;
131
132 wxChoice* joystickSelected;
133 wxCheckBox* joystickForceFeedback;
134 wxCheckBox* joystickDirectionalHit;
135 wxButton* joystickDetectButton;
136 #if IS_WIN32
137 wxButton* joystickCalibrateButton;
138 #endif
139 bool isTcRootFolderValid;
140 bool isCurrentBinaryValid;
141 bool isCurrentFredBinaryValid;
142 };
143
144 #endif