Browse code

Make the NCSF Sound View dialog always available.

(Before it was only available under Debug builds.)

Naram Qashat authored on 2021/04/06 22:29:00
Showing 1 changed files
... ...
@@ -31,10 +31,8 @@
31 31
 
32 32
 XSFConfigDialog_NCSF::XSFConfigDialog_NCSF(XSFConfig &newConfig, wxWindow *parent, const wxString &title) : XSFConfigDialog(newConfig, parent, title)
33 33
 {
34
-#ifndef NDEBUG
35 34
 	auto useSoundViewCheckBox = new wxCheckBox(this->generalPanel, wxID_ANY, "Use Sound View Window", wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator{ &this->useSoundView });
36 35
 	this->generalSizer->Add(useSoundViewCheckBox, { 5, 0 }, { 1, 2 }, wxALL, 5);
37
-#endif
38 36
 
39 37
 	auto interpolationLabel = new wxStaticText(this->outputPanel, wxID_ANY, "Interpolation");
40 38
 	this->outputSizer->Add(interpolationLabel, { 4, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL | wxALL, 5);
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
... ...
@@ -6,6 +6,13 @@
6 6
  */
7 7
 
8 8
 #include <string>
9
+#ifdef __GNUC__
10
+# pragma GCC diagnostic push
11
+# pragma GCC diagnostic ignored "-Wold-style-cast"
12
+#elif defined(__clang__)
13
+# pragma clang diagnostic push
14
+# pragma clang diagnostic ignored "-Wold-style-cast"
15
+#endif
9 16
 #include <wx/arrstr.h>
10 17
 #include <wx/checkbox.h>
11 18
 #include <wx/choice.h>
... ...
@@ -13,11 +20,16 @@
13 20
 #include <wx/listbox.h>
14 21
 #include <wx/stattext.h>
15 22
 #include <wx/valgen.h>
23
+#ifdef __GNUC__
24
+# pragma GCC diagnostic pop
25
+#elif defined(__clang__)
26
+# pragma clang diagnostic pop
27
+#endif
16 28
 #include "XSFConfig.h"
17 29
 #include "XSFConfigDialog.h"
18 30
 #include "XSFConfigDialog_NCSF.h"
19 31
 
20
-XSFConfigDialog_NCSF::XSFConfigDialog_NCSF(XSFConfig &config, wxWindow *parent, const wxString &title) : XSFConfigDialog(config, parent, title)
32
+XSFConfigDialog_NCSF::XSFConfigDialog_NCSF(XSFConfig &newConfig, wxWindow *parent, const wxString &title) : XSFConfigDialog(newConfig, parent, title)
21 33
 {
22 34
 #ifndef NDEBUG
23 35
 	auto useSoundViewCheckBox = new wxCheckBox(this->generalPanel, wxID_ANY, "Use Sound View Window", wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator{ &this->useSoundView });
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,45 @@
1
+/*
2
+ * xSF - NCSF configuration dialog
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ *
5
+ * Partially based on the vio*sf framework
6
+ */
7
+
8
+#include <string>
9
+#include <wx/arrstr.h>
10
+#include <wx/checkbox.h>
11
+#include <wx/choice.h>
12
+#include <wx/gbsizer.h>
13
+#include <wx/listbox.h>
14
+#include <wx/stattext.h>
15
+#include <wx/valgen.h>
16
+#include "XSFConfig.h"
17
+#include "XSFConfigDialog.h"
18
+#include "XSFConfigDialog_NCSF.h"
19
+
20
+XSFConfigDialog_NCSF::XSFConfigDialog_NCSF(XSFConfig &config, wxWindow *parent, const wxString &title) : XSFConfigDialog(config, parent, title)
21
+{
22
+#ifndef NDEBUG
23
+	auto useSoundViewCheckBox = new wxCheckBox(this->generalPanel, wxID_ANY, "Use Sound View Window", wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator{ &this->useSoundView });
24
+	this->generalSizer->Add(useSoundViewCheckBox, { 5, 0 }, { 1, 2 }, wxALL, 5);
25
+#endif
26
+
27
+	auto interpolationLabel = new wxStaticText(this->outputPanel, wxID_ANY, "Interpolation");
28
+	this->outputSizer->Add(interpolationLabel, { 4, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL | wxALL, 5);
29
+	wxArrayString interpolationChoices;
30
+	interpolationChoices.Add("None");
31
+	interpolationChoices.Add("Linear");
32
+	interpolationChoices.Add("4-point, 3rd-order Legrange");
33
+	interpolationChoices.Add("6-point, 5th-order Legrange");
34
+	interpolationChoices.Add("16-point Sinc (Nuttall 3-term Window)");
35
+	auto interpolationChoice = new wxChoice(this->outputPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, interpolationChoices, 0, wxGenericValidator{ &this->interpolation });
36
+	this->outputSizer->Add(interpolationChoice, { 4, 1 }, { 1, 1 }, wxALL, 5);
37
+
38
+	auto muteLabel = new wxStaticText(this->outputPanel, wxID_ANY, "Mute");
39
+	this->outputSizer->Add(muteLabel, { 5, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL | wxALL, 5);
40
+	wxArrayString muteChoices;
41
+	for (int i = 0; i < 16; ++i)
42
+		muteChoices.Add("SPU " + std::to_string(i + 1));
43
+	auto muteListBox = new wxListBox(this->outputPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, muteChoices, wxLB_MULTIPLE, wxGenericValidator{ &this->mute });
44
+	this->outputSizer->Add(muteListBox, { 5, 1 }, { 1, 1 }, wxALL, 5);
45
+}