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
... ...
@@ -9,22 +9,9 @@
9 9
 #include <string>
10 10
 #include <type_traits>
11 11
 #include <vector>
12
-#ifdef __GNUC__
13
-# pragma GCC diagnostic push
14
-# pragma GCC diagnostic ignored "-Wold-style-cast"
15
-#elif defined(__clang__)
16
-# pragma clang diagnostic push
17
-# pragma clang diagnostic ignored "-Wold-style-cast"
18
-#endif
19
-#include <wx/app.h>
20
-#include <wx/nativewin.h>
21
-#ifdef __GNUC__
22
-# pragma GCC diagnostic pop
23
-#elif defined(__clang__)
24
-# pragma clang diagnostic pop
25
-#endif
26 12
 #include "windowsh_wrapper.h"
27 13
 #include <windowsx.h>
14
+#include "XSFApp.h"
28 15
 #include "XSFConfig.h"
29 16
 #include "XSFConfigDialog.h"
30 17
 #include "XSFFile.h"
... ...
@@ -104,52 +91,6 @@ void XSFConfig::SaveConfig()
104 91
 	this->SaveSpecificConfig();
105 92
 }
106 93
 
107
-class XSFConfigApp : public wxApp
108
-{
109
-	HWND parent;
110
-	XSFConfig *config;
111
-public:
112
-	XSFConfigApp() : parent(nullptr), config(nullptr)
113
-	{
114
-	}
115
-
116
-	XSFConfigApp(HWND newParent, XSFConfig *newConfig) : parent(newParent), config(newConfig)
117
-	{
118
-	}
119
-
120
-	bool OnInit() override
121
-	{
122
-		// NOTE: This is only good enough to make it so the dialog box isn't shown on the taskbar, it is not good enough to make the dialog modal to Winamp's preferences screen... it'll actually crash if someone changes to another section of preferences...
123
-
124
-		auto window = new wxNativeContainerWindow(this->parent);
125
-		auto dialog = this->config->CreateDialogBox(window, XSFConfig::commonName + " v" + XSFConfig::versionNumber);
126
-		dialog->Finalize();
127
-		this->config->InitializeConfigDialog(dialog);
128
-		if (dialog->ShowModal() == wxID_OK)
129
-		{
130
-			this->config->SaveConfigDialog(dialog);
131
-			this->config->SaveConfig();
132
-		}
133
-		dialog->Destroy();
134
-		window->Destroy();
135
-		return true;
136
-	}
137
-};
138
-
139
-#ifdef __GNUC__
140
-# pragma GCC diagnostic push
141
-# pragma GCC diagnostic ignored "-Wold-style-cast"
142
-#elif defined(__clang__)
143
-# pragma clang diagnostic push
144
-# pragma clang diagnostic ignored "-Wold-style-cast"
145
-#endif
146
-wxIMPLEMENT_APP_NO_MAIN(XSFConfigApp);
147
-#ifdef __GNUC__
148
-# pragma GCC diagnostic pop
149
-#elif defined(__clang__)
150
-# pragma clang diagnostic pop
151
-#endif
152
-
153 94
 void XSFConfig::GenerateDialogs()
154 95
 {
155 96
 	// NOTE: Eventually this will be done away with when I decide to make an actual info dialog box using wxWidgets.
... ...
@@ -248,13 +189,11 @@ INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
248 189
 	return true;
249 190
 }
250 191
 
251
-void XSFConfig::CallConfigDialog(HINSTANCE hInstance, HWND hwndParent)
192
+extern std::unique_ptr<XSFApp> xSFApp;
193
+
194
+void XSFConfig::CallConfigDialog(HWND hwndParent)
252 195
 {
253
-	auto app = new XSFConfigApp(hwndParent, this);
254
-	wxApp::SetInstance(app);
255
-	wxEntryStart(hInstance);
256
-	app->OnInit();
257
-	wxEntryCleanup();
196
+	xSFApp->ConfigDialog(hwndParent, this);
258 197
 }
259 198
 
260 199
 void XSFConfig::CallInfoDialog(HINSTANCE hInstance, HWND hwndParent)
Browse code

Some template cleanup:

* Move the ToIntegral function from NCSF specifically to the framework in general, so it can be used in the base framework's code too.
* Use type traits a bit more.
* Move convertTo into the ConvertFuncs class.

Naram Qashat authored on 2021/04/05 21:47:28
Showing 1 changed files
... ...
@@ -270,8 +270,8 @@ void XSFConfig::InitializeConfigDialog(XSFConfigDialog *dialog)
270 270
 	dialog->skipSilenceOnStart = ConvertFuncs::MSToString(this->skipSilenceOnStartSec);
271 271
 	dialog->detectSilence = ConvertFuncs::MSToString(this->detectSilenceSec);
272 272
 	dialog->volume = this->volume;
273
-	dialog->replayGain = static_cast<std::underlying_type_t<VolumeType>>(this->volumeType);
274
-	dialog->clipProtect = static_cast<std::underlying_type_t<PeakType>>(this->peakType);
273
+	dialog->replayGain = ConvertFuncs::ToIntegral(this->volumeType);
274
+	dialog->clipProtect = ConvertFuncs::ToIntegral(this->peakType);
275 275
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), this->sampleRate);
276 276
 	dialog->sampleRate = found == this->supportedSampleRates.end() ? 0 : found - this->supportedSampleRates.begin();
277 277
 	dialog->titleFormat = this->titleFormat;
... ...
@@ -287,8 +287,8 @@ void XSFConfig::ResetConfigDefaults(XSFConfigDialog *dialog)
287 287
 	dialog->skipSilenceOnStart = XSFConfig::initSkipSilenceOnStartSec;
288 288
 	dialog->detectSilence = XSFConfig::initDetectSilenceSec;
289 289
 	dialog->volume = XSFConfig::initVolume;
290
-	dialog->replayGain = static_cast<std::underlying_type_t<VolumeType>>(XSFConfig::initVolumeType);
291
-	dialog->clipProtect = static_cast<std::underlying_type_t<PeakType>>(XSFConfig::initPeakType);
290
+	dialog->replayGain = ConvertFuncs::ToIntegral(XSFConfig::initVolumeType);
291
+	dialog->clipProtect = ConvertFuncs::ToIntegral(XSFConfig::initPeakType);
292 292
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
293 293
 	dialog->sampleRate = found == this->supportedSampleRates.end() ? 0 : found - this->supportedSampleRates.begin();
294 294
 	dialog->titleFormat = XSFConfig::initTitleFormat;
Browse code

Use std::filesystem::path for reading/writing files.

Also remove fstream_wfopen.h as it is no longer needed.
Also make XSFFile not store the string of the path but store the path as std::filesystem::path.

Naram Qashat authored on 2021/04/05 00:20:56
Showing 1 changed files
... ...
@@ -211,7 +211,7 @@ INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
211 211
 			EndDialog(hwndDlg, IDCANCEL);
212 212
 			break;
213 213
 		case WM_INITDIALOG:
214
-			SetWindowTextW(hwndDlg, ConvertFuncs::StringToWString(xSFFileInInfo->GetFilename()).c_str());
214
+			SetWindowTextW(hwndDlg, xSFFileInInfo->GetFilepath().wstring().c_str());
215 215
 			SetWindowTextW(GetDlgItem(hwndDlg, idInfoTitle), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("title")).c_str());
216 216
 			SetWindowTextW(GetDlgItem(hwndDlg, idInfoArtist), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("artist")).c_str());
217 217
 			SetWindowTextW(GetDlgItem(hwndDlg, idInfoGame), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("game")).c_str());
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
... ...
@@ -9,8 +9,20 @@
9 9
 #include <string>
10 10
 #include <type_traits>
11 11
 #include <vector>
12
+#ifdef __GNUC__
13
+# pragma GCC diagnostic push
14
+# pragma GCC diagnostic ignored "-Wold-style-cast"
15
+#elif defined(__clang__)
16
+# pragma clang diagnostic push
17
+# pragma clang diagnostic ignored "-Wold-style-cast"
18
+#endif
12 19
 #include <wx/app.h>
13 20
 #include <wx/nativewin.h>
21
+#ifdef __GNUC__
22
+# pragma GCC diagnostic pop
23
+#elif defined(__clang__)
24
+# pragma clang diagnostic pop
25
+#endif
14 26
 #include "windowsh_wrapper.h"
15 27
 #include <windowsx.h>
16 28
 #include "XSFConfig.h"
... ...
@@ -101,7 +113,7 @@ public:
101 113
 	{
102 114
 	}
103 115
 
104
-	XSFConfigApp(HWND parent, XSFConfig *config) : parent(parent), config(config)
116
+	XSFConfigApp(HWND newParent, XSFConfig *newConfig) : parent(newParent), config(newConfig)
105 117
 	{
106 118
 	}
107 119
 
... ...
@@ -124,7 +136,19 @@ public:
124 136
 	}
125 137
 };
126 138
 
139
+#ifdef __GNUC__
140
+# pragma GCC diagnostic push
141
+# pragma GCC diagnostic ignored "-Wold-style-cast"
142
+#elif defined(__clang__)
143
+# pragma clang diagnostic push
144
+# pragma clang diagnostic ignored "-Wold-style-cast"
145
+#endif
127 146
 wxIMPLEMENT_APP_NO_MAIN(XSFConfigApp);
147
+#ifdef __GNUC__
148
+# pragma GCC diagnostic pop
149
+#elif defined(__clang__)
150
+# pragma clang diagnostic pop
151
+#endif
128 152
 
129 153
 void XSFConfig::GenerateDialogs()
130 154
 {
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
... ...
@@ -7,10 +7,14 @@
7 7
 
8 8
 #include <algorithm>
9 9
 #include <string>
10
+#include <type_traits>
10 11
 #include <vector>
12
+#include <wx/app.h>
13
+#include <wx/nativewin.h>
11 14
 #include "windowsh_wrapper.h"
12 15
 #include <windowsx.h>
13 16
 #include "XSFConfig.h"
17
+#include "XSFConfigDialog.h"
14 18
 #include "XSFFile.h"
15 19
 #include "XSFPlayer.h"
16 20
 #include "convert.h"
... ...
@@ -37,18 +41,8 @@ enum
37 41
 	idInfoComment
38 42
 };
39 43
 
40
-bool XSFConfig::initPlayInfinitely = false;
41
-std::string XSFConfig::initSkipSilenceOnStartSec = "5";
42
-std::string XSFConfig::initDetectSilenceSec = "5";
43
-std::string XSFConfig::initDefaultLength = "1:55";
44
-std::string XSFConfig::initDefaultFade = "5";
45
-std::string XSFConfig::initTitleFormat = "%game%[ - [%disc%.]%track%] - %title%";
46
-double XSFConfig::initVolume = 1.0;
47
-VolumeType XSFConfig::initVolumeType = VolumeType::ReplayGainAlbum;
48
-PeakType XSFConfig::initPeakType = PeakType::ReplayGainTrack;
49
-
50 44
 XSFConfig::XSFConfig() : playInfinitely(false), skipSilenceOnStartSec(0), detectSilenceSec(0), defaultLength(0), defaultFade(0), volume(0.0), volumeType(VolumeType::None), peakType(PeakType::None),
51
-	sampleRate(0), titleFormat(""), configDialog(), configDialogProperty(), infoDialog(), supportedSampleRates(), configIO(XSFConfigIO::Create())
45
+	sampleRate(0), titleFormat(""), infoDialog(), supportedSampleRates(), configIO(XSFConfigIO::Create())
52 46
 {
53 47
 }
54 48
 
... ...
@@ -98,8 +92,44 @@ void XSFConfig::SaveConfig()
98 92
 	this->SaveSpecificConfig();
99 93
 }
100 94
 
95
+class XSFConfigApp : public wxApp
96
+{
97
+	HWND parent;
98
+	XSFConfig *config;
99
+public:
100
+	XSFConfigApp() : parent(nullptr), config(nullptr)
101
+	{
102
+	}
103
+
104
+	XSFConfigApp(HWND parent, XSFConfig *config) : parent(parent), config(config)
105
+	{
106
+	}
107
+
108
+	bool OnInit() override
109
+	{
110
+		// NOTE: This is only good enough to make it so the dialog box isn't shown on the taskbar, it is not good enough to make the dialog modal to Winamp's preferences screen... it'll actually crash if someone changes to another section of preferences...
111
+
112
+		auto window = new wxNativeContainerWindow(this->parent);
113
+		auto dialog = this->config->CreateDialogBox(window, XSFConfig::commonName + " v" + XSFConfig::versionNumber);
114
+		dialog->Finalize();
115
+		this->config->InitializeConfigDialog(dialog);
116
+		if (dialog->ShowModal() == wxID_OK)
117
+		{
118
+			this->config->SaveConfigDialog(dialog);
119
+			this->config->SaveConfig();
120
+		}
121
+		dialog->Destroy();
122
+		window->Destroy();
123
+		return true;
124
+	}
125
+};
126
+
127
+wxIMPLEMENT_APP_NO_MAIN(XSFConfigApp);
128
+
101 129
 void XSFConfig::GenerateDialogs()
102 130
 {
131
+	// NOTE: Eventually this will be done away with when I decide to make an actual info dialog box using wxWidgets.
132
+
103 133
 	this->infoDialog = DialogBuilder().IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
104 134
 	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Title:").WithSize(50, 8).WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(7, 10)).IsRightJustified());
105 135
 	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
... ...
@@ -123,82 +153,9 @@ void XSFConfig::GenerateDialogs()
123 153
 	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 54).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoVScroll().WithBorder().
124 154
 		WithTabStop().WithID(idInfoComment).WithVerticalScrollbar().WithWantReturn().IsMultiline());
125 155
 
126
-	this->configDialog = DialogBuilder().WithTitle(ConvertFuncs::StringToWString(XSFConfig::commonName + " v" + XSFConfig::versionNumber)).IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
127
-	this->configDialog.AddGroupControl(DialogGroupBuilder(L"General").WithRelativePositionToParent(RelativePositionToParent::PositionType::FromTopLeft, Point<short>(7, 7)));
128
-	this->configDialog.AddCheckBoxControl(DialogCheckBoxBuilder(L"Play infinitely").WithSize(60, 10).InGroup(L"General").WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(6, 11)).WithTabStop().
129
-		WithID(idPlayInfinitely));
130
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default play length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 7)).
131
-		IsLeftJustified());
132
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
133
-		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDefaultLength));
134
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default fadeout length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).
135
-		IsLeftJustified());
136
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
137
-		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDefaultFade));
138
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Skip silence on start (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).
139
-		IsLeftJustified());
140
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
141
-		WithAutoHScroll().WithBorder().WithTabStop().WithID(idSkipSilenceOnStartSec));
142
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Detect silence (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).
143
-		IsLeftJustified());
144
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
145
-		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDetectSilenceSec));
146
-	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 7)));
147
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Volume").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(6, 14)).IsLeftJustified());
148
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
149
-		WithAutoHScroll().WithBorder().WithTabStop().WithID(idVolume));
150
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"ReplayGain").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
151
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idReplayGain).
152
-		IsDropDownList().WithTabStop());
153
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Clip Protect").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
154
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idClipProtect).
155
-		IsDropDownList().WithTabStop());
156
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Sample Rate").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
157
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(50, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idSampleRate).
158
-		IsDropDownList().WithTabStop());
159
-	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Title Format").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 7)));
160
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"NOTE: This is only used if Advanced Title Formatting is disabled in Winamp.").WithSize(150, 16).InGroup(L"Title Format").
161
-		WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(6, 11)).IsLeftJustified());
162
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(150, 14).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 4)).IsLeftJustified().
163
-		WithAutoHScroll().WithBorder().WithTabStop().WithID(idTitleFormat));
164
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Names between percent symbols (e.g. %game%, %title%) will be replaced with the respective value from the file's tags. Using square brackets around any "
165
-			L"items will cause them to only be displayed if there was a replacement done (e.g. [%disc%.] will display 01. if disc was in the tags as 01, but will display nothing if disc was not in the tags). Square "
166
-			L"bracket blocks can be nested.").WithSize(150, 72).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 4)).IsLeftJustified());
167
-
168
-	this->GenerateSpecificDialogs();
169
-
170 156
 	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomRight, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
171 157
 	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
172 158
 	this->infoDialog.AutoSize();
173
-
174
-	this->configDialogProperty = this->configDialog;
175
-	this->configDialogProperty = DialogBuilder().IsChild().IsControlWindow().WithFont(L"MS Shell Dlg", 8);
176
-	this->configDialogProperty.AutoSize();
177
-
178
-	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Reset Defaults").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomRight, Point<short>(-50, 7)).WithID(idResetDefaults).
179
-		WithTabStop());
180
-	this->configDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomRight, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
181
-	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
182
-	this->configDialog.AutoSize();
183
-}
184
-
185
-INT_PTR CALLBACK XSFConfig::ConfigDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
186
-{
187
-	XSFConfig *thisPtr = nullptr;
188
-
189
-	if (uMsg == WM_INITDIALOG)
190
-	{
191
-		thisPtr = reinterpret_cast<XSFConfig *>(lParam);
192
-
193
-		SetWindowLongPtr(hwndDlg, DWLP_USER, reinterpret_cast<LONG_PTR>(thisPtr));
194
-	}
195
-	else
196
-		thisPtr = reinterpret_cast<XSFConfig *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
197
-
198
-	if (thisPtr)
199
-		return thisPtr->ConfigDialogProc(hwndDlg, uMsg, wParam, lParam);
200
-	else
201
-		return false;
202 159
 }
203 160
 
204 161
 INT_PTR CALLBACK XSFConfig::InfoDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
... ...
@@ -220,63 +177,6 @@ INT_PTR CALLBACK XSFConfig::InfoDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM
220 177
 		return false;
221 178
 }
222 179
 
223
-INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM)
224
-{
225
-	switch (uMsg)
226
-	{
227
-		case WM_CLOSE:
228
-			EndDialog(hwndDlg, IDCANCEL);
229
-			break;
230
-		case WM_INITDIALOG:
231
-			if (this->playInfinitely)
232
-				SendMessageW(GetDlgItem(hwndDlg, idPlayInfinitely), BM_SETCHECK, BST_CHECKED, 0);
233
-			SetWindowTextW(GetDlgItem(hwndDlg, idDefaultLength), ConvertFuncs::MSToWString(this->defaultLength).c_str());
234
-			SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::MSToWString(this->defaultFade).c_str());
235
-			SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::MSToWString(this->skipSilenceOnStartSec).c_str());
236
-			SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::MSToWString(this->detectSilenceSec).c_str());
237
-			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), ConvertFuncs::TrimDoubleString(std::to_wstring(this->volume)).c_str());
238
-			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
239
-			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Use Volume Tag"));
240
-			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
241
-			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Album"));
242
-			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, static_cast<WPARAM>(this->volumeType), 0);
243
-			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
244
-			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
245
-			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Album"));
246
-			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, static_cast<WPARAM>(this->peakType), 0);
247
-			for (unsigned x = 0, rates = this->supportedSampleRates.size(); x < rates; ++x)
248
-			{
249
-				unsigned rate = this->supportedSampleRates[x];
250
-				SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(std::to_wstring(rate).c_str()));
251
-				if (this->sampleRate == rate)
252
-					SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, x, 0);
253
-			}
254
-			SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), ConvertFuncs::StringToWString(this->titleFormat).c_str());
255
-			break;
256
-		case WM_COMMAND:
257
-			switch (GET_WM_COMMAND_ID(wParam, lParam))
258
-			{
259
-				case IDOK:
260
-					this->SaveConfigDialog(hwndDlg);
261
-					this->SaveConfig();
262
-					EndDialog(hwndDlg, IDOK);
263
-					break;
264
-				case IDCANCEL:
265
-					EndDialog(hwndDlg, IDCANCEL);
266
-					break;
267
-				case idResetDefaults:
268
-					this->ResetConfigDefaults(hwndDlg);
269
-					break;
270
-				default:
271
-					return false;
272
-			}
273
-			break;
274
-		default:
275
-			return false;
276
-	}
277
-	return true;
278
-}
279
-
280 180
 extern XSFFile *xSFFileInInfo;
281 181
 
282 182
 INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM)
... ...
@@ -326,7 +226,11 @@ INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
326 226
 
327 227
 void XSFConfig::CallConfigDialog(HINSTANCE hInstance, HWND hwndParent)
328 228
 {
329
-	DialogBoxIndirectParamW(hInstance, this->configDialog.GenerateTemplate(), hwndParent, XSFConfig::ConfigDialogProcStatic, reinterpret_cast<LPARAM>(this));
229
+	auto app = new XSFConfigApp(hwndParent, this);
230
+	wxApp::SetInstance(app);
231
+	wxEntryStart(hInstance);
232
+	app->OnInit();
233
+	wxEntryCleanup();
330 234
 }
331 235
 
332 236
 void XSFConfig::CallInfoDialog(HINSTANCE hInstance, HWND hwndParent)
... ...
@@ -334,37 +238,54 @@ void XSFConfig::CallInfoDialog(HINSTANCE hInstance, HWND hwndParent)
334 238
 	DialogBoxIndirectParamW(hInstance, this->infoDialog.GenerateTemplate(), hwndParent, XSFConfig::InfoDialogProcStatic, reinterpret_cast<LPARAM>(this));
335 239
 }
336 240
 
337
-void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
241
+void XSFConfig::InitializeConfigDialog(XSFConfigDialog *dialog)
242
+{
243
+	dialog->playInfinitely = this->playInfinitely;
244
+	dialog->defaultPlayLength = ConvertFuncs::MSToString(this->defaultLength);
245
+	dialog->defaultFadeoutLength = ConvertFuncs::MSToString(this->defaultFade);
246
+	dialog->skipSilenceOnStart = ConvertFuncs::MSToString(this->skipSilenceOnStartSec);
247
+	dialog->detectSilence = ConvertFuncs::MSToString(this->detectSilenceSec);
248
+	dialog->volume = this->volume;
249
+	dialog->replayGain = static_cast<std::underlying_type_t<VolumeType>>(this->volumeType);
250
+	dialog->clipProtect = static_cast<std::underlying_type_t<PeakType>>(this->peakType);
251
+	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), this->sampleRate);
252
+	dialog->sampleRate = found == this->supportedSampleRates.end() ? 0 : found - this->supportedSampleRates.begin();
253
+	dialog->titleFormat = this->titleFormat;
254
+
255
+	this->InitializeSpecificConfigDialog(dialog);
256
+}
257
+
258
+void XSFConfig::ResetConfigDefaults(XSFConfigDialog *dialog)
338 259
 {
339
-	SendMessageW(GetDlgItem(hwndDlg, idPlayInfinitely), BM_SETCHECK, XSFConfig::initPlayInfinitely ? BST_CHECKED : BST_UNCHECKED, 0);
340
-	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultLength), ConvertFuncs::StringToWString(XSFConfig::initDefaultLength).c_str());
341
-	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::StringToWString(XSFConfig::initDefaultFade).c_str());
342
-	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::StringToWString(XSFConfig::initSkipSilenceOnStartSec).c_str());
343
-	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::StringToWString(XSFConfig::initDetectSilenceSec).c_str());
344
-	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), ConvertFuncs::TrimDoubleString(std::to_wstring(XSFConfig::initVolume)).c_str());
345
-	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, static_cast<WPARAM>(XSFConfig::initVolumeType), 0);
346
-	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, static_cast<WPARAM>(XSFConfig::initPeakType), 0);
260
+	dialog->playInfinitely = XSFConfig::initPlayInfinitely;
261
+	dialog->defaultPlayLength = XSFConfig::initDefaultLength;
262
+	dialog->defaultFadeoutLength = XSFConfig::initDefaultFade;
263
+	dialog->skipSilenceOnStart = XSFConfig::initSkipSilenceOnStartSec;
264
+	dialog->detectSilence = XSFConfig::initDetectSilenceSec;
265
+	dialog->volume = XSFConfig::initVolume;
266
+	dialog->replayGain = static_cast<std::underlying_type_t<VolumeType>>(XSFConfig::initVolumeType);
267
+	dialog->clipProtect = static_cast<std::underlying_type_t<PeakType>>(XSFConfig::initPeakType);
347 268
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
348
-	SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, found - this->supportedSampleRates.begin(), 0);
349
-	SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), ConvertFuncs::StringToWString(XSFConfig::initTitleFormat).c_str());
269
+	dialog->sampleRate = found == this->supportedSampleRates.end() ? 0 : found - this->supportedSampleRates.begin();
270
+	dialog->titleFormat = XSFConfig::initTitleFormat;
350 271
 
351
-	this->ResetSpecificConfigDefaults(hwndDlg);
272
+	this->ResetSpecificConfigDefaults(dialog);
352 273
 }
353 274
 
354
-void XSFConfig::SaveConfigDialog(HWND hwndDlg)
275
+void XSFConfig::SaveConfigDialog(XSFConfigDialog *dialog)
355 276
 {
356
-	this->playInfinitely = SendMessageW(GetDlgItem(hwndDlg, idPlayInfinitely), BM_GETCHECK, 0, 0) == BST_CHECKED;
357
-	this->defaultLength = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDefaultLength)));
358
-	this->defaultFade = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDefaultFade)));
359
-	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec)));
360
-	this->detectSilenceSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDetectSilenceSec)));
361
-	this->volume = convertTo<double>(this->GetTextFromWindow(GetDlgItem(hwndDlg, idVolume)));
362
-	this->volumeType = static_cast<VolumeType>(SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_GETCURSEL, 0, 0));
363
-	this->peakType = static_cast<PeakType>(SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_GETCURSEL, 0, 0));
364
-	this->sampleRate = XSFConfig::supportedSampleRates[SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_GETCURSEL, 0, 0)];
365
-	this->titleFormat = ConvertFuncs::WStringToString(this->GetTextFromWindow(GetDlgItem(hwndDlg, idTitleFormat)));
366
-
367
-	this->SaveSpecificConfigDialog(hwndDlg);
277
+	this->playInfinitely = dialog->playInfinitely;
278
+	this->defaultLength = ConvertFuncs::StringToMS(dialog->defaultPlayLength);
279
+	this->defaultFade = ConvertFuncs::StringToMS(dialog->defaultFadeoutLength);
280
+	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(dialog->skipSilenceOnStart);
281
+	this->detectSilenceSec = ConvertFuncs::StringToMS(dialog->detectSilence);
282
+	this->volume = dialog->volume;
283
+	this->volumeType = static_cast<VolumeType>(dialog->replayGain);
284
+	this->peakType = static_cast<PeakType>(dialog->clipProtect);
285
+	this->sampleRate = this->supportedSampleRates[dialog->sampleRate];
286
+	this->titleFormat = dialog->titleFormat.ToStdString();
287
+
288
+	this->SaveSpecificConfigDialog(dialog);
368 289
 }
369 290
 
370 291
 void XSFConfig::CopyConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad)
... ...
@@ -385,6 +306,11 @@ HINSTANCE XSFConfig::GetHInstance() const
385 306
 	return this->configIO->GetHInstance();
386 307
 }
387 308
 
309
+const std::vector<unsigned> &XSFConfig::GetSupportedSampleRates() const
310
+{
311
+	return this->supportedSampleRates;
312
+}
313
+
388 314
 bool XSFConfig::GetPlayInfinitely() const
389 315
 {
390 316
 	return this->playInfinitely;
Browse code

Various changes:

* Use enum class instead of enum (except for the enums for the resource IDs, not really necessary there).
* For NCSF specifically, included a function to convert an enum class to its underlying integral type (as this is needed for use with the std::bitset class).
* Cleanup headers so all the ones needed in a file are explicitly included even if they may possibly be included in another header.
* Used forward declarations in a few spots.
* Explicitly namespaced all (u)int*_t uses (this might seem like overkill, but it helps me see when the standard types are being used with a simple search for std::).
* Made sure it all builds with MinGW-w64 as well (both gcc and clang).
* Removed some std::move from DialogBuilder.cpp based on clang's warnings for that.
* Replaced use of std::copy_n on strings in DialogBuilder.cpp with my CopyToString functions that use wcscpy.
* Replaced CHAR_MIN/CHAR_MAX in eqstr.h and ltstr.h with std::numeric_limits<char>::min/max().

Naram Qashat authored on 2021/03/21 03:16:45
Showing 1 changed files
... ...
@@ -5,7 +5,13 @@
5 5
  * Partially based on the vio*sf framework
6 6
  */
7 7
 
8
+#include <algorithm>
9
+#include <string>
10
+#include <vector>
11
+#include "windowsh_wrapper.h"
12
+#include <windowsx.h>
8 13
 #include "XSFConfig.h"
14
+#include "XSFFile.h"
9 15
 #include "XSFPlayer.h"
10 16
 #include "convert.h"
11 17
 
... ...
@@ -38,10 +44,10 @@ std::string XSFConfig::initDefaultLength = "1:55";
38 44
 std::string XSFConfig::initDefaultFade = "5";
39 45
 std::string XSFConfig::initTitleFormat = "%game%[ - [%disc%.]%track%] - %title%";
40 46
 double XSFConfig::initVolume = 1.0;
41
-VolumeType XSFConfig::initVolumeType = VOLUMETYPE_REPLAYGAIN_ALBUM;
42
-PeakType XSFConfig::initPeakType = PEAKTYPE_REPLAYGAIN_TRACK;
47
+VolumeType XSFConfig::initVolumeType = VolumeType::ReplayGainAlbum;
48
+PeakType XSFConfig::initPeakType = PeakType::ReplayGainTrack;
43 49
 
44
-XSFConfig::XSFConfig() : playInfinitely(false), skipSilenceOnStartSec(0), detectSilenceSec(0), defaultLength(0), defaultFade(0), volume(0.0), volumeType(VOLUMETYPE_NONE), peakType(PEAKTYPE_NONE),
50
+XSFConfig::XSFConfig() : playInfinitely(false), skipSilenceOnStartSec(0), detectSilenceSec(0), defaultLength(0), defaultFade(0), volume(0.0), volumeType(VolumeType::None), peakType(PeakType::None),
45 51
 	sampleRate(0), titleFormat(""), configDialog(), configDialogProperty(), infoDialog(), supportedSampleRates(), configIO(XSFConfigIO::Create())
46 52
 {
47 53
 }
... ...
@@ -95,84 +101,84 @@ void XSFConfig::SaveConfig()
95 101
 void XSFConfig::GenerateDialogs()
96 102
 {
97 103
 	this->infoDialog = DialogBuilder().IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
98
-	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Title:").WithSize(50, 8).WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(7, 10)).IsRightJustified());
99
-	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
104
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Title:").WithSize(50, 8).WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(7, 10)).IsRightJustified());
105
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
100 106
 		WithTabStop().WithID(idInfoTitle));
101
-	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Artist:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
102
-	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
107
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Artist:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsRightJustified());
108
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
103 109
 		WithTabStop().WithID(idInfoArtist));
104
-	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Game:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
105
-	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
110
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Game:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsRightJustified());
111
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
106 112
 		WithTabStop().WithID(idInfoGame));
107
-	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Year:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
108
-	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
113
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Year:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsRightJustified());
114
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
109 115
 		WithTabStop().WithID(idInfoYear));
110
-	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Genre:").WithSize(25, 8).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, 3)).IsRightJustified());
111
-	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(140, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
116
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Genre:").WithSize(25, 8).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, 3)).IsRightJustified());
117
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(140, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
112 118
 		WithTabStop().WithID(idInfoGenre));
113
-	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Copyright:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 4).IsRightJustified());
114
-	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
119
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Copyright:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 4).IsRightJustified());
120
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
115 121
 		WithTabStop().WithID(idInfoCopyright));
116
-	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Comment:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
117
-	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 54).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoVScroll().WithBorder().
122
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Comment:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsRightJustified());
123
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 54).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().WithAutoVScroll().WithBorder().
118 124
 		WithTabStop().WithID(idInfoComment).WithVerticalScrollbar().WithWantReturn().IsMultiline());
119 125
 
120 126
 	this->configDialog = DialogBuilder().WithTitle(ConvertFuncs::StringToWString(XSFConfig::commonName + " v" + XSFConfig::versionNumber)).IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
121
-	this->configDialog.AddGroupControl(DialogGroupBuilder(L"General").WithRelativePositionToParent(RelativePositionToParent::FROM_TOPLEFT, Point<short>(7, 7)));
122
-	this->configDialog.AddCheckBoxControl(DialogCheckBoxBuilder(L"Play infinitely").WithSize(60, 10).InGroup(L"General").WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 11)).WithTabStop().
127
+	this->configDialog.AddGroupControl(DialogGroupBuilder(L"General").WithRelativePositionToParent(RelativePositionToParent::PositionType::FromTopLeft, Point<short>(7, 7)));
128
+	this->configDialog.AddCheckBoxControl(DialogCheckBoxBuilder(L"Play infinitely").WithSize(60, 10).InGroup(L"General").WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(6, 11)).WithTabStop().
123 129
 		WithID(idPlayInfinitely));
124
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default play length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 7)).
130
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default play length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 7)).
125 131
 		IsLeftJustified());
126
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
132
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
127 133
 		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDefaultLength));
128
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default fadeout length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).
134
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default fadeout length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).
129 135
 		IsLeftJustified());
130
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
136
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
131 137
 		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDefaultFade));
132
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Skip silence on start (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).
138
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Skip silence on start (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).
133 139
 		IsLeftJustified());
134
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
140
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
135 141
 		WithAutoHScroll().WithBorder().WithTabStop().WithID(idSkipSilenceOnStartSec));
136
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Detect silence (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).
142
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Detect silence (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).
137 143
 		IsLeftJustified());
138
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
144
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
139 145
 		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDetectSilenceSec));
140
-	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 7)));
141
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Volume").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 14)).IsLeftJustified());
142
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
146
+	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 7)));
147
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Volume").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(6, 14)).IsLeftJustified());
148
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).IsLeftJustified().
143 149
 		WithAutoHScroll().WithBorder().WithTabStop().WithID(idVolume));
144
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"ReplayGain").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
145
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idReplayGain).
150
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"ReplayGain").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
151
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idReplayGain).
146 152
 		IsDropDownList().WithTabStop());
147
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Clip Protect").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
148
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idClipProtect).
153
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Clip Protect").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
154
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idClipProtect).
149 155
 		IsDropDownList().WithTabStop());
150
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Sample Rate").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
151
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(50, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idSampleRate).
156
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Sample Rate").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
157
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(50, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idSampleRate).
152 158
 		IsDropDownList().WithTabStop());
153
-	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 7)));
159
+	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Title Format").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 7)));
154 160
 	this->configDialog.AddLabelControl(DialogLabelBuilder(L"NOTE: This is only used if Advanced Title Formatting is disabled in Winamp.").WithSize(150, 16).InGroup(L"Title Format").
155
-		WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 11)).IsLeftJustified());
156
-	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(150, 14).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 4)).IsLeftJustified().
161
+		WithRelativePositionToParent(RelativePosition::PositionType::FromTopLeft, Point<short>(6, 11)).IsLeftJustified());
162
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(150, 14).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 4)).IsLeftJustified().
157 163
 		WithAutoHScroll().WithBorder().WithTabStop().WithID(idTitleFormat));
158 164
 	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Names between percent symbols (e.g. %game%, %title%) will be replaced with the respective value from the file's tags. Using square brackets around any "
159 165
 			L"items will cause them to only be displayed if there was a replacement done (e.g. [%disc%.] will display 01. if disc was in the tags as 01, but will display nothing if disc was not in the tags). Square "
160
-			L"bracket blocks can be nested.").WithSize(150, 72).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 4)).IsLeftJustified());
166
+			L"bracket blocks can be nested.").WithSize(150, 72).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 4)).IsLeftJustified());
161 167
 
162 168
 	this->GenerateSpecificDialogs();
163 169
 
164
-	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMRIGHT, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
165
-	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
170
+	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomRight, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
171
+	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
166 172
 	this->infoDialog.AutoSize();
167 173
 
168 174
 	this->configDialogProperty = this->configDialog;
169 175
 	this->configDialogProperty = DialogBuilder().IsChild().IsControlWindow().WithFont(L"MS Shell Dlg", 8);
170 176
 	this->configDialogProperty.AutoSize();
171 177
 
172
-	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Reset Defaults").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMRIGHT, Point<short>(-50, 7)).WithID(idResetDefaults).
178
+	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Reset Defaults").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomRight, Point<short>(-50, 7)).WithID(idResetDefaults).
173 179
 		WithTabStop());
174
-	this->configDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMRIGHT, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
175
-	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
180
+	this->configDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomRight, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
181
+	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
176 182
 	this->configDialog.AutoSize();
177 183
 }
178 184
 
... ...
@@ -233,11 +239,11 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
233 239
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Use Volume Tag"));
234 240
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
235 241
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Album"));
236
-			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, this->volumeType, 0);
242
+			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, static_cast<WPARAM>(this->volumeType), 0);
237 243
 			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
238 244
 			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
239 245
 			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Album"));
240
-			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, this->peakType, 0);
246
+			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, static_cast<WPARAM>(this->peakType), 0);
241 247
 			for (unsigned x = 0, rates = this->supportedSampleRates.size(); x < rates; ++x)
242 248
 			{
243 249
 				unsigned rate = this->supportedSampleRates[x];
... ...
@@ -336,8 +342,8 @@ void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
336 342
 	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::StringToWString(XSFConfig::initSkipSilenceOnStartSec).c_str());
337 343
 	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::StringToWString(XSFConfig::initDetectSilenceSec).c_str());
338 344
 	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), ConvertFuncs::TrimDoubleString(std::to_wstring(XSFConfig::initVolume)).c_str());
339
-	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, XSFConfig::initVolumeType, 0);
340
-	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, XSFConfig::initPeakType, 0);
345
+	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, static_cast<WPARAM>(XSFConfig::initVolumeType), 0);
346
+	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, static_cast<WPARAM>(XSFConfig::initPeakType), 0);
341 347
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
342 348
 	SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, found - this->supportedSampleRates.begin(), 0);
343 349
 	SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), ConvertFuncs::StringToWString(XSFConfig::initTitleFormat).c_str());
Browse code

Cleanup a few comments and strings.

Naram Qashat authored on 2021/03/20 20:25:12
Showing 1 changed files
... ...
@@ -155,8 +155,8 @@ void XSFConfig::GenerateDialogs()
155 155
 		WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 11)).IsLeftJustified());
156 156
 	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(150, 14).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 4)).IsLeftJustified().
157 157
 		WithAutoHScroll().WithBorder().WithTabStop().WithID(idTitleFormat));
158
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Names between percent symbols (e.g. %game%, %title%) will be replaced with the respective value from the file's tags.  Using square brackets around any "
159
-			L"items will cause them to only be displayed if there was a replacement done (e.g. [%disc%.] will display 01. if disc was in the tags as 01, but will display nothing if disc was not in the tags).  Square "
158
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Names between percent symbols (e.g. %game%, %title%) will be replaced with the respective value from the file's tags. Using square brackets around any "
159
+			L"items will cause them to only be displayed if there was a replacement done (e.g. [%disc%.] will display 01. if disc was in the tags as 01, but will display nothing if disc was not in the tags). Square "
160 160
 			L"bracket blocks can be nested.").WithSize(150, 72).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 4)).IsLeftJustified());
161 161
 
162 162
 	this->GenerateSpecificDialogs();
Browse code

A few more conversion changes:

* To go along with the previous change, XSFConfig now had internal get/set value functions that use type traits to choose between the enum and non-enum versions. (This also means I do not need to manually double-cast enums now.)
* Fix bug with the Windows API string conversions, so they do not include the trailing null byte in the output string.
* Added function to trim trailing 0s (and the decimal point if necessary) from a string that came from a double.

Naram Qashat authored on 2021/03/19 14:27:11
Showing 1 changed files
... ...
@@ -68,8 +68,8 @@ void XSFConfig::LoadConfig()
68 68
 	this->defaultLength = ConvertFuncs::StringToMS(this->configIO->GetValue("DefaultLength", XSFConfig::initDefaultLength));
69 69
 	this->defaultFade = ConvertFuncs::StringToMS(this->configIO->GetValue("DefaultFade", XSFConfig::initDefaultFade));
70 70
 	this->volume = this->configIO->GetValue("Volume", XSFConfig::initVolume);
71
-	this->volumeType = static_cast<VolumeType>(this->configIO->GetValue("VolumeType", static_cast<int>(XSFConfig::initVolumeType)));
72
-	this->peakType = static_cast<PeakType>(this->configIO->GetValue("PeakType", static_cast<int>(XSFConfig::initPeakType)));
71
+	this->volumeType = this->configIO->GetValue("VolumeType", XSFConfig::initVolumeType);
72
+	this->peakType = this->configIO->GetValue("PeakType", XSFConfig::initPeakType);
73 73
 	this->sampleRate = this->configIO->GetValue("SampleRate", XSFConfig::initSampleRate);
74 74
 	this->titleFormat = this->configIO->GetValue("TitleFormat", XSFConfig::initTitleFormat);
75 75
 
... ...
@@ -228,7 +228,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
228 228
 			SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::MSToWString(this->defaultFade).c_str());
229 229
 			SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::MSToWString(this->skipSilenceOnStartSec).c_str());
230 230
 			SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::MSToWString(this->detectSilenceSec).c_str());
231
-			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), std::to_wstring(this->volume).c_str());
231
+			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), ConvertFuncs::TrimDoubleString(std::to_wstring(this->volume)).c_str());
232 232
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
233 233
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Use Volume Tag"));
234 234
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
... ...
@@ -335,7 +335,7 @@ void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
335 335
 	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::StringToWString(XSFConfig::initDefaultFade).c_str());
336 336
 	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::StringToWString(XSFConfig::initSkipSilenceOnStartSec).c_str());
337 337
 	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::StringToWString(XSFConfig::initDetectSilenceSec).c_str());
338
-	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), std::to_wstring(XSFConfig::initVolume).c_str());
338
+	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), ConvertFuncs::TrimDoubleString(std::to_wstring(XSFConfig::initVolume)).c_str());
339 339
 	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, XSFConfig::initVolumeType, 0);
340 340
 	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, XSFConfig::initPeakType, 0);
341 341
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
Browse code

Some conversion replacements:

* Replace the (w)stringify functions with the standard std::to_(w)string functions.
* Replace convertTo with versions that use type_traits to determine which standard string conversion function to call, as well as handle enums specically.

Naram Qashat authored on 2021/03/19 11:57:21
Showing 1 changed files
... ...
@@ -228,7 +228,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
228 228
 			SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::MSToWString(this->defaultFade).c_str());
229 229
 			SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::MSToWString(this->skipSilenceOnStartSec).c_str());
230 230
 			SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::MSToWString(this->detectSilenceSec).c_str());
231
-			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(this->volume).c_str());
231
+			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), std::to_wstring(this->volume).c_str());
232 232
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
233 233
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Use Volume Tag"));
234 234
 			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
... ...
@@ -241,7 +241,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
241 241
 			for (unsigned x = 0, rates = this->supportedSampleRates.size(); x < rates; ++x)
242 242
 			{
243 243
 				unsigned rate = this->supportedSampleRates[x];
244
-				SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(wstringify(rate).c_str()));
244
+				SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(std::to_wstring(rate).c_str()));
245 245
 				if (this->sampleRate == rate)
246 246
 					SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, x, 0);
247 247
 			}
... ...
@@ -335,7 +335,7 @@ void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
335 335
 	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::StringToWString(XSFConfig::initDefaultFade).c_str());
336 336
 	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::StringToWString(XSFConfig::initSkipSilenceOnStartSec).c_str());
337 337
 	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::StringToWString(XSFConfig::initDetectSilenceSec).c_str());
338
-	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(XSFConfig::initVolume).c_str());
338
+	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), std::to_wstring(XSFConfig::initVolume).c_str());
339 339
 	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, XSFConfig::initVolumeType, 0);
340 340
 	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, XSFConfig::initPeakType, 0);
341 341
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
... ...
@@ -352,7 +352,7 @@ void XSFConfig::SaveConfigDialog(HWND hwndDlg)
352 352
 	this->defaultFade = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDefaultFade)));
353 353
 	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec)));
354 354
 	this->detectSilenceSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDetectSilenceSec)));
355
-	this->volume = convertTo<double>(this->GetTextFromWindow(GetDlgItem(hwndDlg, idVolume)), false);
355
+	this->volume = convertTo<double>(this->GetTextFromWindow(GetDlgItem(hwndDlg, idVolume)));
356 356
 	this->volumeType = static_cast<VolumeType>(SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_GETCURSEL, 0, 0));
357 357
 	this->peakType = static_cast<PeakType>(SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_GETCURSEL, 0, 0));
358 358
 	this->sampleRate = XSFConfig::supportedSampleRates[SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_GETCURSEL, 0, 0)];
Browse code

Remove last modification date from files.

(I never remember to update these and besides, GitHub history can show when they were last modified.)

Naram Qashat authored on 2021/03/19 10:58:12
Showing 1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 /*
2 2
  * xSF - Core configuration handler
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-10-05
5 4
  *
6 5
  * Partially based on the vio*sf framework
7 6
  */
Browse code

[NCSF] Fix volume issues with a little help from the Nintendo DS SDK.

Also added a clone of DeSmuME's Sound View that is only build during a
debug build, which helped to identify the above issues.

Naram Qashat authored on 2014/10/05 20:00:09
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - Core configuration handler
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-24
4
+ * Last modification on 2014-10-05
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -321,12 +321,12 @@ INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
321 321
 
322 322
 void XSFConfig::CallConfigDialog(HINSTANCE hInstance, HWND hwndParent)
323 323
 {
324
-	DialogBoxIndirectParam(hInstance, this->configDialog.GenerateTemplate(), hwndParent, XSFConfig::ConfigDialogProcStatic, reinterpret_cast<LPARAM>(this));
324
+	DialogBoxIndirectParamW(hInstance, this->configDialog.GenerateTemplate(), hwndParent, XSFConfig::ConfigDialogProcStatic, reinterpret_cast<LPARAM>(this));
325 325
 }
326 326
 
327 327
 void XSFConfig::CallInfoDialog(HINSTANCE hInstance, HWND hwndParent)
328 328
 {
329
-	DialogBoxIndirectParam(hInstance, this->infoDialog.GenerateTemplate(), hwndParent, XSFConfig::InfoDialogProcStatic, reinterpret_cast<LPARAM>(this));
329
+	DialogBoxIndirectParamW(hInstance, this->infoDialog.GenerateTemplate(), hwndParent, XSFConfig::InfoDialogProcStatic, reinterpret_cast<LPARAM>(this));
330 330
 }
331 331
 
332 332
 void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
... ...
@@ -370,6 +370,16 @@ void XSFConfig::CopyConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad)
370 370
 	this->CopySpecificConfigToMemory(xSFPlayer, preLoad);
371 371
 }
372 372
 
373
+void XSFConfig::SetHInstance(HINSTANCE hInstance)
374
+{
375
+	this->configIO->SetHInstance(hInstance);
376
+}
377
+
378
+HINSTANCE XSFConfig::GetHInstance() const
379
+{
380
+	return this->configIO->GetHInstance();
381
+}
382
+
373 383
 bool XSFConfig::GetPlayInfinitely() const
374 384
 {
375 385
 	return this->playInfinitely;
Browse code

Lots of changes in regards to strings, as follows:

* Removed my custom String class, as well as removed the really old
Unicode ConvertUTF, the UTF Converter, and the UTF Encode/Decode
functions.
* Replaced the above with using standard C++ std::wstring_convert and
std::codecvt_utf8.
* Added headers adapted from llvm's libc++ project for allowing the
above C++ classes to exist with GCC and Clang when libc++ isn't being
used.
* Used std::string over std::wstring whenever possible.
* Added header adapted from llvm's libc++ project to create special
versions of the ifstream and ofstream classes that would utilize _wfopen
on non-MSVC Windows compilers, so those compilers could access files on
Windows that use characters outside the current codepage.
* Removed the -static-libgcc and -static-libstdc++ flags from the
Makefile for non-MSVC builds. The generated DLLs will require extra DLLs
from either Cygwin or MinGW (whichever is used to compile), I've only
tested with MinGW and for some reason they crash Winamp on exit, I have
no idea why.

Naram Qashat authored on 2014/09/24 13:58:55
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - Core configuration handler
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-08
4
+ * Last modification on 2014-09-24
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -9,7 +9,6 @@
9 9
 #include "XSFConfig.h"
10 10
 #include "XSFPlayer.h"
11 11
 #include "convert.h"
12
-#include "BigSString.h"
13 12
 
14 13
 enum
15 14
 {
... ...
@@ -34,23 +33,23 @@ enum
34 33
 };
35 34
 
36 35
 bool XSFConfig::initPlayInfinitely = false;
37
-std::wstring XSFConfig::initSkipSilenceOnStartSec = L"5";
38
-std::wstring XSFConfig::initDetectSilenceSec = L"5";
39
-std::wstring XSFConfig::initDefaultLength = L"1:55";
40
-std::wstring XSFConfig::initDefaultFade = L"5";
41
-std::wstring XSFConfig::initTitleFormat = L"%game%[ - [%disc%.]%track%] - %title%";
36
+std::string XSFConfig::initSkipSilenceOnStartSec = "5";
37
+std::string XSFConfig::initDetectSilenceSec = "5";
38
+std::string XSFConfig::initDefaultLength = "1:55";
39
+std::string XSFConfig::initDefaultFade = "5";
40
+std::string XSFConfig::initTitleFormat = "%game%[ - [%disc%.]%track%] - %title%";
42 41
 double XSFConfig::initVolume = 1.0;
43 42
 VolumeType XSFConfig::initVolumeType = VOLUMETYPE_REPLAYGAIN_ALBUM;
44 43
 PeakType XSFConfig::initPeakType = PEAKTYPE_REPLAYGAIN_TRACK;
45 44
 
46 45
 XSFConfig::XSFConfig() : playInfinitely(false), skipSilenceOnStartSec(0), detectSilenceSec(0), defaultLength(0), defaultFade(0), volume(0.0), volumeType(VOLUMETYPE_NONE), peakType(PEAKTYPE_NONE),
47
-	sampleRate(0), titleFormat(L""), configDialog(), configDialogProperty(), infoDialog(), supportedSampleRates(), configIO(XSFConfigIO::Create())
46
+	sampleRate(0), titleFormat(""), configDialog(), configDialogProperty(), infoDialog(), supportedSampleRates(), configIO(XSFConfigIO::Create())
48 47
 {
49 48
 }
50 49
 
51
-const String &XSFConfig::CommonNameWithVersion()
50
+const std::string &XSFConfig::CommonNameWithVersion()
52 51
 {
53
-	static const auto commonNameWithVersion = String(XSFConfig::commonName + L" v" + XSFConfig::versionNumber);
52
+	static const auto commonNameWithVersion = XSFConfig::commonName + " v" + XSFConfig::versionNumber;
54 53
 	return commonNameWithVersion;
55 54
 }
56 55
 
... ...
@@ -64,32 +63,32 @@ std::wstring XSFConfig::GetTextFromWindow(HWND hwnd)
64 63
 
65 64
 void XSFConfig::LoadConfig()
66 65
 {
67
-	this->playInfinitely = this->configIO->GetValue(L"PlayInfinitely", XSFConfig::initPlayInfinitely);
68
-	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(this->configIO->GetValue(L"SkipSilenceOnStartSec", XSFConfig::initSkipSilenceOnStartSec));
69
-	this->detectSilenceSec = ConvertFuncs::StringToMS(this->configIO->GetValue(L"DetectSilenceSec", XSFConfig::initDetectSilenceSec));
70
-	this->defaultLength = ConvertFuncs::StringToMS(this->configIO->GetValue(L"DefaultLength", XSFConfig::initDefaultLength));
71
-	this->defaultFade = ConvertFuncs::StringToMS(this->configIO->GetValue(L"DefaultFade", XSFConfig::initDefaultFade));
72
-	this->volume = this->configIO->GetValue(L"Volume", XSFConfig::initVolume);
73
-	this->volumeType = static_cast<VolumeType>(this->configIO->GetValue(L"VolumeType", static_cast<int>(XSFConfig::initVolumeType)));
74
-	this->peakType = static_cast<PeakType>(this->configIO->GetValue(L"PeakType", static_cast<int>(XSFConfig::initPeakType)));
75
-	this->sampleRate = this->configIO->GetValue(L"SampleRate", XSFConfig::initSampleRate);
76
-	this->titleFormat = this->configIO->GetValue(L"TitleFormat", XSFConfig::initTitleFormat);
66
+	this->playInfinitely = this->configIO->GetValue("PlayInfinitely", XSFConfig::initPlayInfinitely);
67
+	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(this->configIO->GetValue("SkipSilenceOnStartSec", XSFConfig::initSkipSilenceOnStartSec));
68
+	this->detectSilenceSec = ConvertFuncs::StringToMS(this->configIO->GetValue("DetectSilenceSec", XSFConfig::initDetectSilenceSec));
69
+	this->defaultLength = ConvertFuncs::StringToMS(this->configIO->GetValue("DefaultLength", XSFConfig::initDefaultLength));
70
+	this->defaultFade = ConvertFuncs::StringToMS(this->configIO->GetValue("DefaultFade", XSFConfig::initDefaultFade));
71
+	this->volume = this->configIO->GetValue("Volume", XSFConfig::initVolume);
72
+	this->volumeType = static_cast<VolumeType>(this->configIO->GetValue("VolumeType", static_cast<int>(XSFConfig::initVolumeType)));
73
+	this->peakType = static_cast<PeakType>(this->configIO->GetValue("PeakType", static_cast<int>(XSFConfig::initPeakType)));
74
+	this->sampleRate = this->configIO->GetValue("SampleRate", XSFConfig::initSampleRate);
75
+	this->titleFormat = this->configIO->GetValue("TitleFormat", XSFConfig::initTitleFormat);
77 76
 
78 77
 	this->LoadSpecificConfig();
79 78
 }
80 79
 
81 80
 void XSFConfig::SaveConfig()
82 81
 {
83
-	this->configIO->SetValue(L"PlayInfinitely", this->playInfinitely);
84
-	this->configIO->SetValue(L"SkipSilenceOnStartSec", ConvertFuncs::MSToWString(this->skipSilenceOnStartSec));
85
-	this->configIO->SetValue(L"DetectSilenceSec", ConvertFuncs::MSToWString(this->detectSilenceSec));
86
-	this->configIO->SetValue(L"DefaultLength", ConvertFuncs::MSToWString(this->defaultLength));
87
-	this->configIO->SetValue(L"DefaultFade", ConvertFuncs::MSToWString(this->defaultFade));
88
-	this->configIO->SetValue(L"Volume", this->volume);
89
-	this->configIO->SetValue(L"VolumeType", this->volumeType);
90
-	this->configIO->SetValue(L"PeakType", this->peakType);
91
-	this->configIO->SetValue(L"SampleRate", this->sampleRate);
92
-	this->configIO->SetValue(L"TitleFormat", this->titleFormat);
82
+	this->configIO->SetValue("PlayInfinitely", this->playInfinitely);
83
+	this->configIO->SetValue("SkipSilenceOnStartSec", ConvertFuncs::MSToString(this->skipSilenceOnStartSec));
84
+	this->configIO->SetValue("DetectSilenceSec", ConvertFuncs::MSToString(this->detectSilenceSec));
85
+	this->configIO->SetValue("DefaultLength", ConvertFuncs::MSToString(this->defaultLength));
86
+	this->configIO->SetValue("DefaultFade", ConvertFuncs::MSToString(this->defaultFade));
87
+	this->configIO->SetValue("Volume", this->volume);
88
+	this->configIO->SetValue("VolumeType", this->volumeType);
89
+	this->configIO->SetValue("PeakType", this->peakType);
90
+	this->configIO->SetValue("SampleRate", this->sampleRate);
91
+	this->configIO->SetValue("TitleFormat", this->titleFormat);
93 92
 
94 93
 	this->SaveSpecificConfig();
95 94
 }
... ...
@@ -119,7 +118,7 @@ void XSFConfig::GenerateDialogs()
119 118
 	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 54).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoVScroll().WithBorder().
120 119
 		WithTabStop().WithID(idInfoComment).WithVerticalScrollbar().WithWantReturn().IsMultiline());
121 120
 
122
-	this->configDialog = DialogBuilder().WithTitle(XSFConfig::commonName + L" v" + XSFConfig::versionNumber).IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
121
+	this->configDialog = DialogBuilder().WithTitle(ConvertFuncs::StringToWString(XSFConfig::commonName + " v" + XSFConfig::versionNumber)).IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
123 122
 	this->configDialog.AddGroupControl(DialogGroupBuilder(L"General").WithRelativePositionToParent(RelativePositionToParent::FROM_TOPLEFT, Point<short>(7, 7)));
124 123
 	this->configDialog.AddCheckBoxControl(DialogCheckBoxBuilder(L"Play infinitely").WithSize(60, 10).InGroup(L"General").WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 11)).WithTabStop().
125 124
 		WithID(idPlayInfinitely));
... ...
@@ -247,7 +246,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
247 246
 				if (this->sampleRate == rate)
248 247
 					SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, x, 0);
249 248
 			}
250
-			SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), this->titleFormat.c_str());
249
+			SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), ConvertFuncs::StringToWString(this->titleFormat).c_str());
251 250
 			break;
252 251
 		case WM_COMMAND:
253 252
 			switch (GET_WM_COMMAND_ID(wParam, lParam))
... ...
@@ -283,14 +282,14 @@ INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
283 282
 			EndDialog(hwndDlg, IDCANCEL);
284 283
 			break;
285 284
 		case WM_INITDIALOG:
286
-			SetWindowTextW(hwndDlg, xSFFileInInfo->GetFilename().GetWStrC());
287
-			SetWindowTextW(GetDlgItem(hwndDlg, idInfoTitle), xSFFileInInfo->GetTagValue("title").GetWStrC());
288
-			SetWindowTextW(GetDlgItem(hwndDlg, idInfoArtist), xSFFileInInfo->GetTagValue("artist").GetWStrC());
289
-			SetWindowTextW(GetDlgItem(hwndDlg, idInfoGame), xSFFileInInfo->GetTagValue("game").GetWStrC());
290
-			SetWindowTextW(GetDlgItem(hwndDlg, idInfoYear), xSFFileInInfo->GetTagValue("year").GetWStrC());
291
-			SetWindowTextW(GetDlgItem(hwndDlg, idInfoGenre), xSFFileInInfo->GetTagValue("genre").GetWStrC());
292
-			SetWindowTextW(GetDlgItem(hwndDlg, idInfoCopyright), xSFFileInInfo->GetTagValue("copyright").GetWStrC());
293
-			SetWindowTextW(GetDlgItem(hwndDlg, idInfoComment), xSFFileInInfo->GetTagValue("comment").GetWStrC());
285
+			SetWindowTextW(hwndDlg, ConvertFuncs::StringToWString(xSFFileInInfo->GetFilename()).c_str());
286
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoTitle), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("title")).c_str());
287
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoArtist), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("artist")).c_str());
288
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoGame), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("game")).c_str());
289
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoYear), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("year")).c_str());
290
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoGenre), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("genre")).c_str());
291
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoCopyright), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("copyright")).c_str());
292
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoComment), ConvertFuncs::StringToWString(xSFFileInInfo->GetTagValue("comment")).c_str());
294 293
 			break;
295 294
 		case WM_COMMAND:
296 295
 			switch (GET_WM_COMMAND_ID(wParam, lParam))
... ...
@@ -333,16 +332,16 @@ void XSFConfig::CallInfoDialog(HINSTANCE hInstance, HWND hwndParent)
333 332
 void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
334 333
 {
335 334
 	SendMessageW(GetDlgItem(hwndDlg, idPlayInfinitely), BM_SETCHECK, XSFConfig::initPlayInfinitely ? BST_CHECKED : BST_UNCHECKED, 0);
336
-	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultLength), XSFConfig::initDefaultLength.c_str());
337
-	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), XSFConfig::initDefaultFade.c_str());
338
-	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), XSFConfig::initSkipSilenceOnStartSec.c_str());
339
-	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), XSFConfig::initDetectSilenceSec.c_str());
335
+	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultLength), ConvertFuncs::StringToWString(XSFConfig::initDefaultLength).c_str());
336
+	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::StringToWString(XSFConfig::initDefaultFade).c_str());
337
+	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::StringToWString(XSFConfig::initSkipSilenceOnStartSec).c_str());
338
+	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::StringToWString(XSFConfig::initDetectSilenceSec).c_str());
340 339
 	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(XSFConfig::initVolume).c_str());
341 340
 	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, XSFConfig::initVolumeType, 0);
342 341
 	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, XSFConfig::initPeakType, 0);
343 342
 	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
344 343
 	SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, found - this->supportedSampleRates.begin(), 0);
345
-	SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), XSFConfig::initTitleFormat.c_str());
344
+	SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), ConvertFuncs::StringToWString(XSFConfig::initTitleFormat).c_str());
346 345
 
347 346
 	this->ResetSpecificConfigDefaults(hwndDlg);
348 347
 }
... ...
@@ -358,7 +357,7 @@ void XSFConfig::SaveConfigDialog(HWND hwndDlg)
358 357
 	this->volumeType = static_cast<VolumeType>(SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_GETCURSEL, 0, 0));
359 358
 	this->peakType = static_cast<PeakType>(SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_GETCURSEL, 0, 0));
360 359
 	this->sampleRate = XSFConfig::supportedSampleRates[SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_GETCURSEL, 0, 0)];
361
-	this->titleFormat = this->GetTextFromWindow(GetDlgItem(hwndDlg, idTitleFormat));
360
+	this->titleFormat = ConvertFuncs::WStringToString(this->GetTextFromWindow(GetDlgItem(hwndDlg, idTitleFormat)));
362 361
 
363 362
 	this->SaveSpecificConfigDialog(hwndDlg);
364 363
 }
... ...
@@ -411,7 +410,7 @@ PeakType XSFConfig::GetPeakType() const
411 410
 	return this->peakType;
412 411
 }
413 412
 
414
-const std::wstring &XSFConfig::GetTitleFormat() const
413
+const std::string &XSFConfig::GetTitleFormat() const
415 414
 {
416 415
 	return this->titleFormat;
417 416
 }
Browse code

Minor cleanups in the framework.

Naram Qashat authored on 2014/09/08 15:06:52
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - Core configuration handler
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-23
4
+ * Last modification on 2014-09-08
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -56,7 +56,7 @@ const String &XSFConfig::CommonNameWithVersion()
56 56
 
57 57
 std::wstring XSFConfig::GetTextFromWindow(HWND hwnd)
58 58
 {
59
-	LRESULT length = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0);
59
+	auto length = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0);
60 60
 	auto value = std::vector<wchar_t>(length + 1);
61 61
 	length = SendMessageW(hwnd, WM_GETTEXT, length + 1, reinterpret_cast<LPARAM>(&value[0]));
62 62
 	return std::wstring(value.begin(), value.begin() + length);
Browse code

Added Lanczos interpolation to the NCSF plugin, and cleaned up a bit of the other code, as well as removing pstdint.h since it's no longer needed.

Naram Qashat authored on 2013/04/23 20:29:21
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - Core configuration handler
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-02
4
+ * Last modification on 2013-04-23
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -57,7 +57,7 @@ const String &XSFConfig::CommonNameWithVersion()
57 57
 std::wstring XSFConfig::GetTextFromWindow(HWND hwnd)
58 58
 {
59 59
 	LRESULT length = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0);
60
-	std::vector<wchar_t> value(length + 1);
60
+	auto value = std::vector<wchar_t>(length + 1);
61 61
 	length = SendMessageW(hwnd, WM_GETTEXT, length + 1, reinterpret_cast<LPARAM>(&value[0]));
62 62
 	return std::wstring(value.begin(), value.begin() + length);
63 63
 }
... ...
@@ -340,7 +340,7 @@ void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
340 340
 	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(XSFConfig::initVolume).c_str());
341 341
 	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, XSFConfig::initVolumeType, 0);
342 342
 	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, XSFConfig::initPeakType, 0);
343
-	std::vector<unsigned>::const_iterator found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
343
+	auto found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
344 344
 	SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, found - this->supportedSampleRates.begin(), 0);
345 345
 	SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), XSFConfig::initTitleFormat.c_str());
346 346
 
Browse code

Added new interpolation methods, added version number in plugin description.

Naram Qashat authored on 2013/04/02 22:40:32
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - Core configuration handler
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-30
4
+ * Last modification on 2013-04-02
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -48,6 +48,12 @@ XSFConfig::XSFConfig() : playInfinitely(false), skipSilenceOnStartSec(0), detect
48 48
 {
49 49
 }
50 50
 
51
+const String &XSFConfig::CommonNameWithVersion()
52
+{
53
+	static const auto commonNameWithVersion = String(XSFConfig::commonName + L" v" + XSFConfig::versionNumber);
54
+	return commonNameWithVersion;
55
+}
56
+
51 57
 std::wstring XSFConfig::GetTextFromWindow(HWND hwnd)
52 58
 {
53 59
 	LRESULT length = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0);
Browse code

Cleanup of some warnings, updating modification dates, using nullptr instead of NULL in some cases.

Naram Qashat authored on 2013/03/30 16:17:42
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - Core configuration handler
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-25
4
+ * Last modification on 2013-03-30
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -174,7 +174,7 @@ void XSFConfig::GenerateDialogs()
174 174
 
175 175
 INT_PTR CALLBACK XSFConfig::ConfigDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
176 176
 {
177
-	XSFConfig *thisPtr = NULL;
177
+	XSFConfig *thisPtr = nullptr;
178 178
 
179 179
 	if (uMsg == WM_INITDIALOG)
180 180
 	{
... ...
@@ -193,7 +193,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProcStatic(HWND hwndDlg, UINT uMsg, WPAR
193 193
 
194 194
 INT_PTR CALLBACK XSFConfig::InfoDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
195 195
 {
196
-	XSFConfig *thisPtr = NULL;
196
+	XSFConfig *thisPtr = nullptr;
197 197
 
198 198
 	if (uMsg == WM_INITDIALOG)
199 199
 	{
... ...
@@ -210,7 +210,7 @@ INT_PTR CALLBACK XSFConfig::InfoDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM
210 210
 		return false;
211 211
 }
212 212
 
213
-INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
213
+INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM)
214 214
 {
215 215
 	switch (uMsg)
216 216
 	{
... ...
@@ -269,7 +269,7 @@ INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
269 269
 
270 270
 extern XSFFile *xSFFileInInfo;
271 271
 
272
-INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
272
+INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM)
273 273
 {
274 274
 	switch (uMsg)
275 275
 	{
Browse code

Import actual code.

Naram Qashat authored on 2013/03/26 02:41:19
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,411 @@
1
+/*
2
+ * xSF - Core configuration handler
3
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
+ * Last modification on 2013-03-25
5
+ *
6
+ * Partially based on the vio*sf framework
7
+ */
8
+
9
+#include "XSFConfig.h"
10
+#include "XSFPlayer.h"
11
+#include "convert.h"
12
+#include "BigSString.h"
13
+
14
+enum
15
+{
16
+	idPlayInfinitely = 500,
17
+	idDefaultLength,
18
+	idDefaultFade,
19
+	idSkipSilenceOnStartSec,
20
+	idDetectSilenceSec,
21
+	idVolume,
22
+	idReplayGain,
23
+	idClipProtect,
24
+	idSampleRate,
25
+	idTitleFormat,
26
+	idResetDefaults,
27
+	idInfoTitle = 600,
28
+	idInfoArtist,
29
+	idInfoGame,
30
+	idInfoYear,
31
+	idInfoGenre,
32
+	idInfoCopyright,
33
+	idInfoComment
34
+};
35
+
36
+bool XSFConfig::initPlayInfinitely = false;
37
+std::wstring XSFConfig::initSkipSilenceOnStartSec = L"5";
38
+std::wstring XSFConfig::initDetectSilenceSec = L"5";
39
+std::wstring XSFConfig::initDefaultLength = L"1:55";
40
+std::wstring XSFConfig::initDefaultFade = L"5";
41
+std::wstring XSFConfig::initTitleFormat = L"%game%[ - [%disc%.]%track%] - %title%";
42
+double XSFConfig::initVolume = 1.0;
43
+VolumeType XSFConfig::initVolumeType = VOLUMETYPE_REPLAYGAIN_ALBUM;
44
+PeakType XSFConfig::initPeakType = PEAKTYPE_REPLAYGAIN_TRACK;
45
+
46
+XSFConfig::XSFConfig() : playInfinitely(false), skipSilenceOnStartSec(0), detectSilenceSec(0), defaultLength(0), defaultFade(0), volume(0.0), volumeType(VOLUMETYPE_NONE), peakType(PEAKTYPE_NONE),
47
+	sampleRate(0), titleFormat(L""), configDialog(), configDialogProperty(), infoDialog(), supportedSampleRates(), configIO(XSFConfigIO::Create())
48
+{
49
+}
50
+
51
+std::wstring XSFConfig::GetTextFromWindow(HWND hwnd)
52
+{
53
+	LRESULT length = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0);
54
+	std::vector<wchar_t> value(length + 1);
55
+	length = SendMessageW(hwnd, WM_GETTEXT, length + 1, reinterpret_cast<LPARAM>(&value[0]));
56
+	return std::wstring(value.begin(), value.begin() + length);
57
+}
58
+
59
+void XSFConfig::LoadConfig()
60
+{
61
+	this->playInfinitely = this->configIO->GetValue(L"PlayInfinitely", XSFConfig::initPlayInfinitely);
62
+	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(this->configIO->GetValue(L"SkipSilenceOnStartSec", XSFConfig::initSkipSilenceOnStartSec));
63
+	this->detectSilenceSec = ConvertFuncs::StringToMS(this->configIO->GetValue(L"DetectSilenceSec", XSFConfig::initDetectSilenceSec));
64
+	this->defaultLength = ConvertFuncs::StringToMS(this->configIO->GetValue(L"DefaultLength", XSFConfig::initDefaultLength));
65
+	this->defaultFade = ConvertFuncs::StringToMS(this->configIO->GetValue(L"DefaultFade", XSFConfig::initDefaultFade));
66
+	this->volume = this->configIO->GetValue(L"Volume", XSFConfig::initVolume);
67
+	this->volumeType = static_cast<VolumeType>(this->configIO->GetValue(L"VolumeType", static_cast<int>(XSFConfig::initVolumeType)));
68
+	this->peakType = static_cast<PeakType>(this->configIO->GetValue(L"PeakType", static_cast<int>(XSFConfig::initPeakType)));
69
+	this->sampleRate = this->configIO->GetValue(L"SampleRate", XSFConfig::initSampleRate);
70
+	this->titleFormat = this->configIO->GetValue(L"TitleFormat", XSFConfig::initTitleFormat);
71
+
72
+	this->LoadSpecificConfig();
73
+}
74
+
75
+void XSFConfig::SaveConfig()
76
+{
77
+	this->configIO->SetValue(L"PlayInfinitely", this->playInfinitely);
78
+	this->configIO->SetValue(L"SkipSilenceOnStartSec", ConvertFuncs::MSToWString(this->skipSilenceOnStartSec));
79
+	this->configIO->SetValue(L"DetectSilenceSec", ConvertFuncs::MSToWString(this->detectSilenceSec));
80
+	this->configIO->SetValue(L"DefaultLength", ConvertFuncs::MSToWString(this->defaultLength));
81
+	this->configIO->SetValue(L"DefaultFade", ConvertFuncs::MSToWString(this->defaultFade));
82
+	this->configIO->SetValue(L"Volume", this->volume);
83
+	this->configIO->SetValue(L"VolumeType", this->volumeType);
84
+	this->configIO->SetValue(L"PeakType", this->peakType);
85
+	this->configIO->SetValue(L"SampleRate", this->sampleRate);
86
+	this->configIO->SetValue(L"TitleFormat", this->titleFormat);
87
+
88
+	this->SaveSpecificConfig();
89
+}
90
+
91
+void XSFConfig::GenerateDialogs()
92
+{
93
+	this->infoDialog = DialogBuilder().IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
94
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Title:").WithSize(50, 8).WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(7, 10)).IsRightJustified());
95
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
96
+		WithTabStop().WithID(idInfoTitle));
97
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Artist:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
98
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
99
+		WithTabStop().WithID(idInfoArtist));
100
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Game:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
101
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
102
+		WithTabStop().WithID(idInfoGame));
103
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Year:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
104
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
105
+		WithTabStop().WithID(idInfoYear));
106
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Genre:").WithSize(25, 8).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, 3)).IsRightJustified());
107
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(140, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
108
+		WithTabStop().WithID(idInfoGenre));
109
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Copyright:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 4).IsRightJustified());
110
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoHScroll().WithBorder().
111
+		WithTabStop().WithID(idInfoCopyright));
112
+	this->infoDialog.AddLabelControl(DialogLabelBuilder(L"Comment:").WithSize(50, 8).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsRightJustified());
113
+	this->infoDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(200, 54).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().WithAutoVScroll().WithBorder().
114
+		WithTabStop().WithID(idInfoComment).WithVerticalScrollbar().WithWantReturn().IsMultiline());
115
+
116
+	this->configDialog = DialogBuilder().WithTitle(XSFConfig::commonName + L" v" + XSFConfig::versionNumber).IsPopup().WithBorder().WithDialogFrame().WithDialogModalFrame().WithSystemMenu().WithFont(L"MS Shell Dlg", 8);
117
+	this->configDialog.AddGroupControl(DialogGroupBuilder(L"General").WithRelativePositionToParent(RelativePositionToParent::FROM_TOPLEFT, Point<short>(7, 7)));
118
+	this->configDialog.AddCheckBoxControl(DialogCheckBoxBuilder(L"Play infinitely").WithSize(60, 10).InGroup(L"General").WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 11)).WithTabStop().
119
+		WithID(idPlayInfinitely));
120
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default play length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 7)).
121
+		IsLeftJustified());
122
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
123
+		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDefaultLength));
124
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Default fadeout length (m:s)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).
125
+		IsLeftJustified());
126
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
127
+		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDefaultFade));
128
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Skip silence on start (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).
129
+		IsLeftJustified());
130
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
131
+		WithAutoHScroll().WithBorder().WithTabStop().WithID(idSkipSilenceOnStartSec));
132
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Detect silence (sec)").WithSize(85, 8).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).
133
+		IsLeftJustified());
134
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"General").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
135
+		WithAutoHScroll().WithBorder().WithTabStop().WithID(idDetectSilenceSec));
136
+	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 7)));
137
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Volume").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 14)).IsLeftJustified());
138
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(25, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).IsLeftJustified().
139
+		WithAutoHScroll().WithBorder().WithTabStop().WithID(idVolume));
140
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"ReplayGain").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
141
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idReplayGain).
142
+		IsDropDownList().WithTabStop());
143
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Clip Protect").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
144
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idClipProtect).
145
+		IsDropDownList().WithTabStop());
146
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Sample Rate").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
147
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(50, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idSampleRate).
148
+		IsDropDownList().WithTabStop());
149
+	this->configDialog.AddGroupControl(DialogGroupBuilder(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 7)));
150
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"NOTE: This is only used if Advanced Title Formatting is disabled in Winamp.").WithSize(150, 16).InGroup(L"Title Format").
151
+		WithRelativePositionToParent(RelativePosition::FROM_TOPLEFT, Point<short>(6, 11)).IsLeftJustified());
152
+	this->configDialog.AddEditBoxControl(DialogEditBoxBuilder().WithSize(150, 14).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 4)).IsLeftJustified().
153
+		WithAutoHScroll().WithBorder().WithTabStop().WithID(idTitleFormat));
154
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Names between percent symbols (e.g. %game%, %title%) will be replaced with the respective value from the file's tags.  Using square brackets around any "
155
+			L"items will cause them to only be displayed if there was a replacement done (e.g. [%disc%.] will display 01. if disc was in the tags as 01, but will display nothing if disc was not in the tags).  Square "
156
+			L"bracket blocks can be nested.").WithSize(150, 72).InGroup(L"Title Format").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 4)).IsLeftJustified());
157
+
158
+	this->GenerateSpecificDialogs();
159
+
160
+	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMRIGHT, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
161
+	this->infoDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
162
+	this->infoDialog.AutoSize();
163
+
164
+	this->configDialogProperty = this->configDialog;
165
+	this->configDialogProperty = DialogBuilder().IsChild().IsControlWindow().WithFont(L"MS Shell Dlg", 8);
166
+	this->configDialogProperty.AutoSize();
167
+
168
+	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Reset Defaults").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMRIGHT, Point<short>(-50, 7)).WithID(idResetDefaults).
169
+		WithTabStop());
170
+	this->configDialog.AddButtonControl(DialogButtonBuilder(L"OK").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMRIGHT, Point<short>(-104, 7)).WithID(IDOK).IsDefault().WithTabStop());
171
+	this->configDialog.AddButtonControl(DialogButtonBuilder(L"Cancel").WithSize(50, 14).WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(4, 0)).WithID(IDCANCEL).WithTabStop());
172
+	this->configDialog.AutoSize();
173
+}
174
+
175
+INT_PTR CALLBACK XSFConfig::ConfigDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
176
+{
177
+	XSFConfig *thisPtr = NULL;
178
+
179
+	if (uMsg == WM_INITDIALOG)
180
+	{
181
+		thisPtr = reinterpret_cast<XSFConfig *>(lParam);
182
+
183
+		SetWindowLongPtr(hwndDlg, DWLP_USER, reinterpret_cast<LONG_PTR>(thisPtr));
184
+	}
185
+	else
186
+		thisPtr = reinterpret_cast<XSFConfig *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
187
+
188
+	if (thisPtr)
189
+		return thisPtr->ConfigDialogProc(hwndDlg, uMsg, wParam, lParam);
190
+	else
191
+		return false;
192
+}
193
+
194
+INT_PTR CALLBACK XSFConfig::InfoDialogProcStatic(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
195
+{
196
+	XSFConfig *thisPtr = NULL;
197
+
198
+	if (uMsg == WM_INITDIALOG)
199
+	{
200
+		thisPtr = reinterpret_cast<XSFConfig *>(lParam);
201
+
202
+		SetWindowLongPtr(hwndDlg, DWLP_USER, reinterpret_cast<LONG_PTR>(thisPtr));
203
+	}
204
+	else
205
+		thisPtr = reinterpret_cast<XSFConfig *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
206
+
207
+	if (thisPtr)
208
+		return thisPtr->InfoDialogProc(hwndDlg, uMsg, wParam, lParam);
209
+	else
210
+		return false;
211
+}
212
+
213
+INT_PTR CALLBACK XSFConfig::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
214
+{
215
+	switch (uMsg)
216
+	{
217
+		case WM_CLOSE:
218
+			EndDialog(hwndDlg, IDCANCEL);
219
+			break;
220
+		case WM_INITDIALOG:
221
+			if (this->playInfinitely)
222
+				SendMessageW(GetDlgItem(hwndDlg, idPlayInfinitely), BM_SETCHECK, BST_CHECKED, 0);
223
+			SetWindowTextW(GetDlgItem(hwndDlg, idDefaultLength), ConvertFuncs::MSToWString(this->defaultLength).c_str());
224
+			SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), ConvertFuncs::MSToWString(this->defaultFade).c_str());
225
+			SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), ConvertFuncs::MSToWString(this->skipSilenceOnStartSec).c_str());
226
+			SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), ConvertFuncs::MSToWString(this->detectSilenceSec).c_str());
227
+			SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(this->volume).c_str());
228
+			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
229
+			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Use Volume Tag"));
230
+			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
231
+			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Album"));
232
+			SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, this->volumeType, 0);
233
+			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Disabled"));
234
+			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Track"));
235
+			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Album"));
236
+			SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, this->peakType, 0);
237
+			for (unsigned x = 0, rates = this->supportedSampleRates.size(); x < rates; ++x)
238
+			{
239
+				unsigned rate = this->supportedSampleRates[x];
240
+				SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(wstringify(rate).c_str()));
241
+				if (this->sampleRate == rate)
242
+					SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, x, 0);
243
+			}
244
+			SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), this->titleFormat.c_str());
245
+			break;
246
+		case WM_COMMAND:
247
+			switch (GET_WM_COMMAND_ID(wParam, lParam))
248
+			{
249
+				case IDOK:
250
+					this->SaveConfigDialog(hwndDlg);
251
+					this->SaveConfig();
252
+					EndDialog(hwndDlg, IDOK);
253
+					break;
254
+				case IDCANCEL:
255
+					EndDialog(hwndDlg, IDCANCEL);
256
+					break;
257
+				case idResetDefaults:
258
+					this->ResetConfigDefaults(hwndDlg);
259
+					break;
260
+				default:
261
+					return false;
262
+			}
263
+			break;
264
+		default:
265
+			return false;
266
+	}
267
+	return true;
268
+}
269
+
270
+extern XSFFile *xSFFileInInfo;
271
+
272
+INT_PTR CALLBACK XSFConfig::InfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
273
+{
274
+	switch (uMsg)
275
+	{
276
+		case WM_CLOSE:
277
+			EndDialog(hwndDlg, IDCANCEL);
278
+			break;
279
+		case WM_INITDIALOG:
280
+			SetWindowTextW(hwndDlg, xSFFileInInfo->GetFilename().GetWStrC());
281
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoTitle), xSFFileInInfo->GetTagValue("title").GetWStrC());
282
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoArtist), xSFFileInInfo->GetTagValue("artist").GetWStrC());
283
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoGame), xSFFileInInfo->GetTagValue("game").GetWStrC());
284
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoYear), xSFFileInInfo->GetTagValue("year").GetWStrC());
285
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoGenre), xSFFileInInfo->GetTagValue("genre").GetWStrC());
286
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoCopyright), xSFFileInInfo->GetTagValue("copyright").GetWStrC());
287
+			SetWindowTextW(GetDlgItem(hwndDlg, idInfoComment), xSFFileInInfo->GetTagValue("comment").GetWStrC());
288
+			break;
289
+		case WM_COMMAND:
290
+			switch (GET_WM_COMMAND_ID(wParam, lParam))
291
+			{
292
+				case IDOK:
293
+					xSFFileInInfo->SetTag("title", this->GetTextFromWindow(GetDlgItem(hwndDlg, idInfoTitle)));
294
+					xSFFileInInfo->SetTag("artist", this->GetTextFromWindow(GetDlgItem(hwndDlg, idInfoArtist)));
295
+					xSFFileInInfo->SetTag("game", this->GetTextFromWindow(GetDlgItem(hwndDlg, idInfoGame)));
296
+					xSFFileInInfo->SetTag("year", this->GetTextFromWindow(GetDlgItem(hwndDlg, idInfoYear)));
297
+					xSFFileInInfo->SetTag("genre", this->GetTextFromWindow(GetDlgItem(hwndDlg, idInfoGenre)));
298
+					xSFFileInInfo->SetTag("copyright", this->GetTextFromWindow(GetDlgItem(hwndDlg, idInfoCopyright)));
299
+					xSFFileInInfo->SetTag("comment", this->GetTextFromWindow(GetDlgItem(hwndDlg, idInfoComment)));
300
+					if (!xSFFileInInfo->GetTagExists("utf8"))
301
+						xSFFileInInfo->SetTag("utf8", "1");
302
+					EndDialog(hwndDlg, IDOK);
303
+					break;
304
+				case IDCANCEL:
305
+					EndDialog(hwndDlg, IDCANCEL);
306
+					break;
307
+				default:
308
+					return false;
309
+			}
310
+			break;
311
+		default:
312
+			return false;
313
+	}
314
+	return true;
315
+}
316
+
317
+void XSFConfig::CallConfigDialog(HINSTANCE hInstance, HWND hwndParent)
318
+{
319
+	DialogBoxIndirectParam(hInstance, this->configDialog.GenerateTemplate(), hwndParent, XSFConfig::ConfigDialogProcStatic, reinterpret_cast<LPARAM>(this));
320
+}
321
+
322
+void XSFConfig::CallInfoDialog(HINSTANCE hInstance, HWND hwndParent)
323
+{
324
+	DialogBoxIndirectParam(hInstance, this->infoDialog.GenerateTemplate(), hwndParent, XSFConfig::InfoDialogProcStatic, reinterpret_cast<LPARAM>(this));
325
+}
326
+
327
+void XSFConfig::ResetConfigDefaults(HWND hwndDlg)
328
+{
329
+	SendMessageW(GetDlgItem(hwndDlg, idPlayInfinitely), BM_SETCHECK, XSFConfig::initPlayInfinitely ? BST_CHECKED : BST_UNCHECKED, 0);
330
+	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultLength), XSFConfig::initDefaultLength.c_str());
331
+	SetWindowTextW(GetDlgItem(hwndDlg, idDefaultFade), XSFConfig::initDefaultFade.c_str());
332
+	SetWindowTextW(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec), XSFConfig::initSkipSilenceOnStartSec.c_str());
333
+	SetWindowTextW(GetDlgItem(hwndDlg, idDetectSilenceSec), XSFConfig::initDetectSilenceSec.c_str());
334
+	SetWindowTextW(GetDlgItem(hwndDlg, idVolume), wstringify(XSFConfig::initVolume).c_str());
335
+	SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_SETCURSEL, XSFConfig::initVolumeType, 0);
336
+	SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_SETCURSEL, XSFConfig::initPeakType, 0);
337
+	std::vector<unsigned>::const_iterator found = std::find(this->supportedSampleRates.begin(), this->supportedSampleRates.end(), XSFConfig::initSampleRate);
338
+	SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_SETCURSEL, found - this->supportedSampleRates.begin(), 0);
339
+	SetWindowTextW(GetDlgItem(hwndDlg, idTitleFormat), XSFConfig::initTitleFormat.c_str());
340
+
341
+	this->ResetSpecificConfigDefaults(hwndDlg);
342
+}
343
+
344
+void XSFConfig::SaveConfigDialog(HWND hwndDlg)
345
+{
346
+	this->playInfinitely = SendMessageW(GetDlgItem(hwndDlg, idPlayInfinitely), BM_GETCHECK, 0, 0) == BST_CHECKED;
347
+	this->defaultLength = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDefaultLength)));
348
+	this->defaultFade = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDefaultFade)));
349
+	this->skipSilenceOnStartSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idSkipSilenceOnStartSec)));
350
+	this->detectSilenceSec = ConvertFuncs::StringToMS(this->GetTextFromWindow(GetDlgItem(hwndDlg, idDetectSilenceSec)));
351
+	this->volume = convertTo<double>(this->GetTextFromWindow(GetDlgItem(hwndDlg, idVolume)), false);
352
+	this->volumeType = static_cast<VolumeType>(SendMessageW(GetDlgItem(hwndDlg, idReplayGain), CB_GETCURSEL, 0, 0));
353
+	this->peakType = static_cast<PeakType>(SendMessageW(GetDlgItem(hwndDlg, idClipProtect), CB_GETCURSEL, 0, 0));
354
+	this->sampleRate = XSFConfig::supportedSampleRates[SendMessageW(GetDlgItem(hwndDlg, idSampleRate), CB_GETCURSEL, 0, 0)];
355
+	this->titleFormat = this->GetTextFromWindow(GetDlgItem(hwndDlg, idTitleFormat));
356
+
357
+	this->SaveSpecificConfigDialog(hwndDlg);
358
+}
359
+
360
+void XSFConfig::CopyConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad)
361
+{
362
+	if (preLoad)
363
+		xSFPlayer->SetSampleRate(this->sampleRate);
364
+
365
+	this->CopySpecificConfigToMemory(xSFPlayer, preLoad);
366
+}
367
+
368
+bool XSFConfig::GetPlayInfinitely() const
369
+{
370
+	return this->playInfinitely;
371
+}
372
+
373
+unsigned long XSFConfig::GetSkipSilenceOnStartSec() const
374
+{
375
+	return this->skipSilenceOnStartSec;
376
+}
377
+
378
+unsigned long XSFConfig::GetDetectSilenceSec() const
379
+{
380
+	return this->detectSilenceSec;
381
+}
382
+
383
+unsigned long XSFConfig::GetDefaultLength() const
384
+{
385
+	return this->defaultLength;
386
+}
387
+
388
+unsigned long XSFConfig::GetDefaultFade() const
389
+{
390
+	return this->defaultFade;
391
+}
392
+
393
+double XSFConfig::GetVolume() const
394
+{
395
+	return this->volume;
396
+}
397
+
398
+VolumeType XSFConfig::GetVolumeType() const
399
+{
400
+	return this->volumeType;
401
+}
402
+
403
+PeakType XSFConfig::GetPeakType() const
404
+{
405
+	return this->peakType;
406
+}
407
+
408
+const std::wstring &XSFConfig::GetTitleFormat() const
409
+{
410
+	return this->titleFormat;
411
+}