Browse code

Rename SoundView::Refresh to SoundView::Update.

The former is already used by wxDialog but with a different signature.

Naram Qashat authored on 2021/04/10 15:57:44
Showing 1 changed files
... ...
@@ -55,8 +55,8 @@ class SoundView : public wxDialog
55 55
 public:
56 56
 	SoundView(wxWindow *parent, XSFConfig_NCSF *ncsfConfig, XSFPlayer_NCSF *ncsfPlayer);
57 57
 	void OnIdle(wxIdleEvent &evt);
58
-	void Refresh();
59 58
 	void SyncToConfig();
59
+	void Update();
60 60
 
61 61
 	XSFConfig_NCSF *config;
62 62
 	XSFPlayer_NCSF *player;
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,65 @@
1
+/*
2
+ * xSF - Sound View Dialog
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ *
5
+ * Partially based on the vio*sf framework
6
+ *
7
+ * Based on the Sound View dialog box from DeSmuME
8
+ * http://desmume.org/
9
+ */
10
+
11
+#pragma once
12
+
13
+#ifdef __GNUC__
14
+# pragma GCC diagnostic push
15
+# pragma GCC diagnostic ignored "-Wold-style-cast"
16
+#elif defined(__clang__)
17
+# pragma clang diagnostic push
18
+# pragma clang diagnostic ignored "-Wold-style-cast"
19
+#endif
20
+#include <wx/dialog.h>
21
+#ifdef __GNUC__
22
+# pragma GCC diagnostic pop
23
+#elif defined(__clang__)
24
+# pragma clang diagnostic pop
25
+#endif
26
+#include "SSEQPlayer/consts.h"
27
+
28
+class wxCheckBox;
29
+class wxGauge;
30
+class wxIdleEvent;
31
+class wxStaticText;
32
+class wxWindow;
33
+class XSFConfig_NCSF;
34
+class XSFPlayer_NCSF;
35
+
36
+struct SoundViewData
37
+{
38
+	wxGauge *volumeGauge = nullptr;
39
+	wxStaticText *volumeLabel = nullptr;
40
+	wxStaticText *repeatModeLabel = nullptr;
41
+	wxStaticText *stateLabel = nullptr;
42
+	wxStaticText *timerValueLabel = nullptr;
43
+	wxCheckBox *muteCheckBox = nullptr;
44
+	wxGauge *panGauge = nullptr;
45
+	wxStaticText *panLabel = nullptr;
46
+	wxStaticText *formatLabel = nullptr;
47
+	wxStaticText *loopStartLabel = nullptr;
48
+	wxStaticText *soundPosLenLabel = nullptr;
49
+	ChannelState lastState = ChannelState::Start;
50
+};
51
+
52
+class SoundView : public wxDialog
53
+{
54
+	void GaugeSetValueImmediate(wxGauge *gauge, int value);
55
+public:
56
+	SoundView(wxWindow *parent, XSFConfig_NCSF *ncsfConfig, XSFPlayer_NCSF *ncsfPlayer);
57
+	void OnIdle(wxIdleEvent &evt);
58
+	void Refresh();
59
+	void SyncToConfig();
60
+
61
+	XSFConfig_NCSF *config;
62
+	XSFPlayer_NCSF *player;
63
+	SoundViewData channelData[16];
64
+	bool volumeModeAlternative;
65
+};