Browse code

Replace the Sound View dialog with a wxWidgets-based one.

* Removes the one that was orignally based entirely on the DeSmuME one, while still looking most the same but cleaner.
* To accommodate this, I needed to rework how wxWidgets was initialized so the configuration dialog boxes could also work alongside this.
* Needed to add a custom wxApp to handle the above.
* This also means that the configuration dialog no longer needs the plugin's HINSTANCE passed along.
* Had to not disable wxGauge or wxToogleButton for the Sound View dialog.
* Also remove the now-unneeded enums in the XSFConfig*.cpp files.
* Sound View is still done in a thread so its event loop can run independently from the rest of the plugin.
* XSFConfig_NCSF doesn't need to be the one to start the Sound View dialog now.

Naram Qashat authored on 2021/04/10 15:19:43
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+/*
2
+ * xSF - NCSF wxWidgets App
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ *
5
+ * Partially based on the vio*sf framework
6
+ */
7
+
8
+#include "SoundView.h"
9
+#include "XSFApp_NCSF.h"
10
+
11
+class XSFConfig_NCSF;
12
+class XSFPlayer_NCSF;
13
+
14
+void XSFApp_NCSF::CreateSoundView(XSFConfig_NCSF *config, XSFPlayer_NCSF *player)
15
+{
16
+	this->dialog = new SoundView(nullptr, config, player);
17
+	this->dialog->ShowModal();
18
+}
19
+
20
+void XSFApp_NCSF::SyncSoundViewToConfig()
21
+{
22
+	if (this->dialog)
23
+		this->dialog->SyncToConfig();
24
+}
25
+
26
+void XSFApp_NCSF::DestroySoundView()
27
+{
28
+	this->dialog->Destroy();
29
+	this->dialog = nullptr;
30
+}