Browse code

Add warnings to building with GCC/Clang.

* These were mostly copied from the old Makefile.
* The files including wxWidgets need -Wno-old-style-cast done in the code via pragmas because I do not want to disable that warning for the rest of the files. (It might've been overkill for some places where wxWidgets was included, but whatever.)

Naram Qashat authored on 2021/04/04 23:35:09
Showing 1 changed files
... ...
@@ -5,17 +5,29 @@
5 5
  * Partially based on the vio*sf framework
6 6
  */
7 7
 
8
+#ifdef __GNUC__
9
+# pragma GCC diagnostic push
10
+# pragma GCC diagnostic ignored "-Wold-style-cast"
11
+#elif defined(__clang__)
12
+# pragma clang diagnostic push
13
+# pragma clang diagnostic ignored "-Wold-style-cast"
14
+#endif
8 15
 #include <wx/arrstr.h>
9 16
 #include <wx/checkbox.h>
10 17
 #include <wx/gbsizer.h>
11 18
 #include <wx/listbox.h>
12 19
 #include <wx/stattext.h>
13 20
 #include <wx/valgen.h>
21
+#ifdef __GNUC__
22
+# pragma GCC diagnostic pop
23
+#elif defined(__clang__)
24
+# pragma clang diagnostic pop
25
+#endif
14 26
 #include "XSFConfig.h"
15 27
 #include "XSFConfigDialog.h"
16 28
 #include "XSFConfigDialog_GSF.h"
17 29
 
18
-XSFConfigDialog_GSF::XSFConfigDialog_GSF(XSFConfig &config, wxWindow *parent, const wxString &title) : XSFConfigDialog(config, parent, title)
30
+XSFConfigDialog_GSF::XSFConfigDialog_GSF(XSFConfig &newConfig, wxWindow *parent, const wxString &title) : XSFConfigDialog(newConfig, parent, title)
19 31
 {
20 32
 	auto lowPassFilteringCheckBox = new wxCheckBox(this->outputPanel, wxID_ANY, "Low-Pass Filtering", wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator{ &this->lowPassFiltering });
21 33
 	this->outputSizer->Add(lowPassFilteringCheckBox, { 4, 0 }, { 1, 2 }, wxALL, 5);
Browse code

Add wxWidgets-based configuration dialog boxes.

* Removes the configuration dialog boxes that used my DialogBuilder.
* Move default configuration values to be inlined within the headers.
* Moved 2SF's and GSF's XSFConfig classes to their own headers to accommodate the new wxWidgets dialog boxes.
* Make it so NCSF's SoundView dialog can be toggled on or off from the configuration dialog box.

Naram Qashat authored on 2021/04/04 12:46:14
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+/*
2
+ * xSF - GSF configuration dialog
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ *
5
+ * Partially based on the vio*sf framework
6
+ */
7
+
8
+#include <wx/arrstr.h>
9
+#include <wx/checkbox.h>
10
+#include <wx/gbsizer.h>
11
+#include <wx/listbox.h>
12
+#include <wx/stattext.h>
13
+#include <wx/valgen.h>
14
+#include "XSFConfig.h"
15
+#include "XSFConfigDialog.h"
16
+#include "XSFConfigDialog_GSF.h"
17
+
18
+XSFConfigDialog_GSF::XSFConfigDialog_GSF(XSFConfig &config, wxWindow *parent, const wxString &title) : XSFConfigDialog(config, parent, title)
19
+{
20
+	auto lowPassFilteringCheckBox = new wxCheckBox(this->outputPanel, wxID_ANY, "Low-Pass Filtering", wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator{ &this->lowPassFiltering });
21
+	this->outputSizer->Add(lowPassFilteringCheckBox, { 4, 0 }, { 1, 2 }, wxALL, 5);
22
+
23
+	auto muteLabel = new wxStaticText(this->outputPanel, wxID_ANY, "Mute");
24
+	this->outputSizer->Add(muteLabel, { 5, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL | wxALL, 5);
25
+	wxArrayString muteChoices;
26
+	muteChoices.Add("Square 1");
27
+	muteChoices.Add("Square 2");
28
+	muteChoices.Add("Wave Pattern");
29
+	muteChoices.Add("Noise");
30
+	muteChoices.Add("PCM A");
31
+	muteChoices.Add("PCM B");
32
+	auto muteListBox = new wxListBox(this->outputPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, muteChoices, wxLB_MULTIPLE, wxGenericValidator{ &this->mute });
33
+	this->outputSizer->Add(muteListBox, { 5, 1 }, { 1, 1 }, wxALL, 5);
34
+}