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
... ...
@@ -7,9 +7,21 @@
7 7
 
8 8
 #pragma once
9 9
 
10
+#ifdef __GNUC__
11
+# pragma GCC diagnostic push
12
+# pragma GCC diagnostic ignored "-Wold-style-cast"
13
+#elif defined(__clang__)
14
+# pragma clang diagnostic push
15
+# pragma clang diagnostic ignored "-Wold-style-cast"
16
+#endif
10 17
 #include <wx/msw/winundef.h>
11 18
 #include <wx/dialog.h>
12 19
 #include <wx/string.h>
20
+#ifdef __GNUC__
21
+# pragma GCC diagnostic pop
22
+#elif defined(__clang__)
23
+# pragma clang diagnostic pop
24
+#endif
13 25
 
14 26
 class wxGridBagSizer;
15 27
 class wxPanel;
... ...
@@ -23,7 +35,7 @@ class XSFConfigDialog : public wxDialog
23 35
 	wxGridBagSizer *mainSizer;
24 36
 	XSFConfig &config;
25 37
 public:
26
-	XSFConfigDialog(XSFConfig &config, wxWindow *parent, const wxString &title);
38
+	XSFConfigDialog(XSFConfig &newConfig, wxWindow *parent, const wxString &title);
27 39
 	void Finalize();
28 40
 
29 41
 	wxPanel *generalPanel;
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 - Core configuration dialog
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ *
5
+ * Partially based on the vio*sf framework
6
+ */
7
+
8
+#pragma once
9
+
10
+#include <wx/msw/winundef.h>
11
+#include <wx/dialog.h>
12
+#include <wx/string.h>
13
+
14
+class wxGridBagSizer;
15
+class wxPanel;
16
+class wxWindow;
17
+class XSFConfig;
18
+
19
+class XSFConfigDialog : public wxDialog
20
+{
21
+	inline static const std::string timeRegex = R"(^\d+(:[0-5]\d){0,2}([.,]\d+)?$)";
22
+
23
+	wxGridBagSizer *mainSizer;
24
+	XSFConfig &config;
25
+public:
26
+	XSFConfigDialog(XSFConfig &config, wxWindow *parent, const wxString &title);
27
+	void Finalize();
28
+
29
+	wxPanel *generalPanel;
30
+	wxGridBagSizer *generalSizer;
31
+
32
+	wxPanel *outputPanel;
33
+	wxGridBagSizer *outputSizer;
34
+
35
+	bool playInfinitely = false;
36
+	wxString defaultPlayLength;
37
+	wxString defaultFadeoutLength;
38
+	wxString skipSilenceOnStart;
39
+	wxString detectSilence;
40
+	double volume = 1;
41
+	int replayGain;
42
+	int clipProtect;
43
+	int sampleRate;
44
+	wxString titleFormat;
45
+};