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,9 +5,19 @@
5 5
  * Partially based on the vio*sf framework
6 6
  */
7 7
 
8
+#include <bitset>
9
+#include <sstream>
10
+#include <string>
11
+#include <cstddef>
12
+#include "windowsh_wrapper.h"
13
+#include <windowsx.h>
8 14
 #include "XSFConfig_NCSF.h"
15
+#include "XSFPlayer_NCSF.h"
9 16
 #include "convert.h"
10 17
 #ifdef _DEBUG
18
+# include <cstdint>
19
+# include "SSEQPlayer/common.h"
20
+# include "SSEQPlayer/consts.h"
11 21
 # include "resource.h"
12 22
 # include <CommCtrl.h>
13 23
 #endif
... ...
@@ -62,11 +72,11 @@ void XSFConfig_NCSF::SaveSpecificConfig()
62 72
 
63 73
 void XSFConfig_NCSF::GenerateSpecificDialogs()
64 74
 {
65
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Interpolation").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
66
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(110, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idInterpolation).
75
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Interpolation").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
76
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(110, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idInterpolation).
67 77
 		IsDropDownList().WithTabStop());
68
-	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Mute").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
69
-	this->configDialog.AddListBoxControl(DialogListBoxBuilder().WithSize(78, 45).WithExactHeight().InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idMutes).
78
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Mute").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromBottomLeft, Point<short>(0, 10), 2).IsLeftJustified());
79
+	this->configDialog.AddListBoxControl(DialogListBoxBuilder().WithSize(78, 45).WithExactHeight().InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::PositionType::FromTopRight, Point<short>(5, -3)).WithID(idMutes).
70 80
 		WithBorder().WithVerticalScrollbar().WithMultipleSelect().WithTabStop());
71 81
 }
72 82
 
... ...
@@ -83,7 +93,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
83 93
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"16-point Sinc (Nuttall 3-term Window)"));
84 94
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
85 95
 			// Mutes
86
-			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
96
+			for (std::size_t x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
87 97
 			{
88 98
 				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + std::to_wstring(x + 1)).c_str()));
89 99
 				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, this->mutes[x], x);
... ...
@@ -100,14 +110,14 @@ void XSFConfig_NCSF::ResetSpecificConfigDefaults(HWND hwndDlg)
100 110
 {
101 111
 	SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, XSFConfig_NCSF::initInterpolation, 0);
102 112
 	auto tmpMutes = std::bitset<16>(XSFConfig_NCSF::initMutes);
103
-	for (int x = 0, numMutes = tmpMutes.size(); x < numMutes; ++x)
113
+	for (std::size_t x = 0, numMutes = tmpMutes.size(); x < numMutes; ++x)
104 114
 		SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, tmpMutes[x], x);
105 115
 }
106 116
 
107 117
 void XSFConfig_NCSF::SaveSpecificConfigDialog(HWND hwndDlg)
108 118
 {
109 119
 	this->interpolation = static_cast<unsigned>(SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_GETCURSEL, 0, 0));
110
-	for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
120
+	for (std::size_t x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
111 121
 		this->mutes[x] = !!SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_GETSEL, x, 0);
112 122
 }
113 123
 
... ...
@@ -235,7 +245,7 @@ static inline void ProgressSetPosImmediate(HWND hDlg, int nIDDlgItem, int nPos)
235 245
 	}
236 246
 }
237 247
 
238
-static inline int32_t muldiv7(int32_t val, uint8_t mul)
248
+static inline std::int32_t muldiv7(std::int32_t val, std::uint8_t mul)
239 249
 {
240 250
 	return mul == 127 ? val : ((val * mul) >> 7);
241 251
 }
... ...
@@ -245,17 +255,17 @@ void XSFConfig_NCSF::RefreshSoundView()
245 255
 	auto player = this->soundViewData->player;
246 256
 	auto hDlg = this->soundViewData->hDlg;
247 257
 	std::wstring buf;
248
-	for (size_t chanId = 0; chanId < 16; ++chanId)
258
+	for (std::size_t chanId = 0; chanId < 16; ++chanId)
249 259
 	{
250 260
 		const auto &chn = player->GetChannel(chanId);
251 261
 
252
-		if (chn.state > CS_START)
262
+		if (chn.state > ChannelState::Start)
253 263
 		{
254 264
 			ProgressSetPosImmediate(hDlg, IDC_SOUND0PANBAR + chanId, muldiv7(128, chn.reg.panning));
255
-			uint8_t datashift = chn.reg.volumeDiv;
265
+			std::uint8_t datashift = chn.reg.volumeDiv;
256 266
 			if (datashift == 3)
257 267
 				datashift = 4;
258
-			int32_t vol = muldiv7(128, chn.reg.volumeMul) >> datashift;
268
+			std::int32_t vol = muldiv7(128, chn.reg.volumeMul) >> datashift;
259 269
 			ProgressSetPosImmediate(hDlg, IDC_SOUND0VOLBAR + chanId, vol);
260 270
 
261 271
 			if (this->soundViewData->volModeAlternative)
... ...
@@ -298,7 +308,7 @@ void XSFConfig_NCSF::RefreshSoundView()
298 308
 			}
299 309
 
300 310
 			static const std::wstring states[] = { L"NONE", L"START", L"ATTACK", L"DECAY", L"SUSTAIN", L"RELEASE" };
301
-			SetDlgItemTextW(hDlg, IDC_SOUND0STATE + chanId, states[chn.state].c_str());
311
+			SetDlgItemTextW(hDlg, IDC_SOUND0STATE + chanId, states[ToIntegral(chn.state)].c_str());
302 312
 
303 313
 			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, (L"samp #" + std::to_wstring(chn.reg.loopStart)).c_str());
304 314
 
... ...
@@ -310,9 +320,9 @@ void XSFConfig_NCSF::RefreshSoundView()
310 320
 			buf += tmpBuf + L" Hz)";
311 321
 			SetDlgItemTextW(hDlg, IDC_SOUND0TMR + chanId, buf.c_str());
312 322
 
313
-			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, (L"samp #" + std::to_wstring(static_cast<uint32_t>(chn.reg.samplePosition)) + L" / " + std::to_wstring(chn.reg.totalLength)).c_str());
323
+			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, (L"samp #" + std::to_wstring(static_cast<std::uint32_t>(chn.reg.samplePosition)) + L" / " + std::to_wstring(chn.reg.totalLength)).c_str());
314 324
 		}
315
-		else if (this->soundViewData->channelLastStates[chanId] != CS_NONE)
325
+		else if (this->soundViewData->channelLastStates[chanId] != ChannelState::None)
316 326
 		{
317 327
 			ProgressSetPosImmediate(hDlg, IDC_SOUND0PANBAR + chanId, 0);
318 328
 			ProgressSetPosImmediate(hDlg, IDC_SOUND0VOLBAR + chanId, 0);
Browse code

Correct a few warnings Visual Studio was complaining about.

Naram Qashat authored on 2021/03/20 20:40:21
Showing 1 changed files
... ...
@@ -247,7 +247,7 @@ void XSFConfig_NCSF::RefreshSoundView()
247 247
 	std::wstring buf;
248 248
 	for (size_t chanId = 0; chanId < 16; ++chanId)
249 249
 	{
250
-		auto chn = player->GetChannel(chanId);
250
+		const auto &chn = player->GetChannel(chanId);
251 251
 
252 252
 		if (chn.state > CS_START)
253 253
 		{
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
... ...
@@ -290,7 +290,7 @@ void XSFConfig_NCSF::RefreshSoundView()
290 290
 				if (chanId < 8)
291 291
 					buf += L"PSG/Noise?";
292 292
 				else if (chanId < 14)
293
-					buf += std::to_wstring(chn.reg.waveDuty == 7 ? 0 : 12.5 * (chn.reg.waveDuty + 1)) + L"% Square";
293
+					buf += ConvertFuncs::TrimDoubleString(std::to_wstring(chn.reg.waveDuty == 7 ? 0 : 12.5 * (chn.reg.waveDuty + 1))) + L"% Square";
294 294
 				else
295 295
 					buf += L"Noise";
296 296
 				buf += L")";
... ...
@@ -304,7 +304,7 @@ void XSFConfig_NCSF::RefreshSoundView()
304 304
 
305 305
 			std::wstring tmpBuf = ConvertFuncs::StringToWString(NumToHexString(chn.reg.timer)).substr(2);
306 306
 			buf = L"$" + tmpBuf + L" (";
307
-			tmpBuf = std::to_wstring((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer) / 8);
307
+			tmpBuf = ConvertFuncs::TrimDoubleString(std::to_wstring((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer) / 8));
308 308
 			if (tmpBuf.find('.') != std::wstring::npos)
309 309
 				tmpBuf = tmpBuf.substr(0, tmpBuf.find('.') + 2);
310 310
 			buf += tmpBuf + L" Hz)";
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
... ...
@@ -85,7 +85,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
85 85
 			// Mutes
86 86
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
87 87
 			{
88
-				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + wstringify(x + 1)).c_str()));
88
+				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + std::to_wstring(x + 1)).c_str()));
89 89
 				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, this->mutes[x], x);
90 90
 			}
91 91
 			break;
... ...
@@ -259,9 +259,9 @@ void XSFConfig_NCSF::RefreshSoundView()
259 259
 			ProgressSetPosImmediate(hDlg, IDC_SOUND0VOLBAR + chanId, vol);
260 260
 
261 261
 			if (this->soundViewData->volModeAlternative)
262
-				buf = wstringify(chn.reg.volumeMul) + L"/" + wstringify(1 << datashift);
262
+				buf = std::to_wstring(chn.reg.volumeMul) + L"/" + std::to_wstring(1 << datashift);
263 263
 			else
264
-				buf = wstringify(vol);
264
+				buf = std::to_wstring(vol);
265 265
 			SetDlgItemTextW(hDlg, IDC_SOUND0VOL + chanId, buf.c_str());
266 266
 
267 267
 			if (!chn.reg.panning)
... ...
@@ -271,18 +271,18 @@ void XSFConfig_NCSF::RefreshSoundView()
271 271
 			else if (chn.reg.panning == 127)
272 272
 				buf = L"R";
273 273
 			else if (chn.reg.panning < 64)
274
-				buf = L"L" + wstringify(64 - chn.reg.panning);
274
+				buf = L"L" + std::to_wstring(64 - chn.reg.panning);
275 275
 			else //if (chn.reg.panning > 64)
276
-				buf = L"R" + wstringify(chn.reg.panning - 64);
276
+				buf = L"R" + std::to_wstring(chn.reg.panning - 64);
277 277
 			SetDlgItemTextW(hDlg, IDC_SOUND0PAN + chanId, buf.c_str());
278 278
 
279 279
 			static const std::wstring modes[] = { L"Manual", L"Loop Infinite", L"One-Shot", L"Prohibited" };
280
-			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, (wstringify(chn.reg.repeatMode) + L" (" + modes[chn.reg.repeatMode] + L")").c_str());
280
+			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, (std::to_wstring(chn.reg.repeatMode) + L" (" + modes[chn.reg.repeatMode] + L")").c_str());
281 281
 
282 282
 			if (chn.reg.format != 3)
283 283
 			{
284 284
 				static const std::wstring formats[] = { L"PCM8", L"PCM16", L"IMA-ADPCM" };
285
-				SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, (wstringify(chn.reg.format) + L" (" + formats[chn.reg.format] + L")").c_str());
285
+				SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, (std::to_wstring(chn.reg.format) + L" (" + formats[chn.reg.format] + L")").c_str());
286 286
 			}
287 287
 			else
288 288
 			{
... ...
@@ -290,7 +290,7 @@ void XSFConfig_NCSF::RefreshSoundView()
290 290
 				if (chanId < 8)
291 291
 					buf += L"PSG/Noise?";
292 292
 				else if (chanId < 14)
293
-					buf += wstringify(chn.reg.waveDuty == 7 ? 0 : 12.5 * (chn.reg.waveDuty + 1)) + L"% Square";
293
+					buf += std::to_wstring(chn.reg.waveDuty == 7 ? 0 : 12.5 * (chn.reg.waveDuty + 1)) + L"% Square";
294 294
 				else
295 295
 					buf += L"Noise";
296 296
 				buf += L")";
... ...
@@ -300,17 +300,17 @@ void XSFConfig_NCSF::RefreshSoundView()
300 300
 			static const std::wstring states[] = { L"NONE", L"START", L"ATTACK", L"DECAY", L"SUSTAIN", L"RELEASE" };
301 301
 			SetDlgItemTextW(hDlg, IDC_SOUND0STATE + chanId, states[chn.state].c_str());
302 302
 
303
-			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, (L"samp #" + wstringify(chn.reg.loopStart)).c_str());
303
+			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, (L"samp #" + std::to_wstring(chn.reg.loopStart)).c_str());
304 304
 
305 305
 			std::wstring tmpBuf = ConvertFuncs::StringToWString(NumToHexString(chn.reg.timer)).substr(2);
306 306
 			buf = L"$" + tmpBuf + L" (";
307
-			tmpBuf = wstringify((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer) / 8);
307
+			tmpBuf = std::to_wstring((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer) / 8);
308 308
 			if (tmpBuf.find('.') != std::wstring::npos)
309 309
 				tmpBuf = tmpBuf.substr(0, tmpBuf.find('.') + 2);
310 310
 			buf += tmpBuf + L" Hz)";
311 311
 			SetDlgItemTextW(hDlg, IDC_SOUND0TMR + chanId, buf.c_str());
312 312
 
313
-			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, (L"samp #" + wstringify(static_cast<uint32_t>(chn.reg.samplePosition)) + L" / " + wstringify(chn.reg.totalLength)).c_str());
313
+			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, (L"samp #" + std::to_wstring(static_cast<uint32_t>(chn.reg.samplePosition)) + L" / " + std::to_wstring(chn.reg.totalLength)).c_str());
314 314
 		}
315 315
 		else if (this->soundViewData->channelLastStates[chanId] != CS_NONE)
316 316
 		{
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 - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-12-09
5 4
  *
6 5
  * Partially based on the vio*sf framework
7 6
  */
Browse code

[NCSF] Fix PSG output.

* Changed the base timer and actually utilize the note number from the note definition even for PSG. Thanks to Kurausukun for informing me about the issue and helping to provide a sample to demonstrate the issue.
* Correct the frequency output in the debug sound view (using DeSmuME's method directly resulted in frequencies that were 3 octaves higher than what they should have been).

Naram Qashat authored on 2020/07/31 10:00:12
Showing 1 changed files
... ...
@@ -305,7 +305,7 @@ void XSFConfig_NCSF::RefreshSoundView()
305 305
 
306 306
 			std::wstring tmpBuf = ConvertFuncs::StringToWString(NumToHexString(chn.reg.timer)).substr(2);
307 307
 			buf = L"$" + tmpBuf + L" (";
308
-			tmpBuf = wstringify((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer));
308
+			tmpBuf = wstringify((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer) / 8);
309 309
 			if (tmpBuf.find('.') != std::wstring::npos)
310 310
 				tmpBuf = tmpBuf.substr(0, tmpBuf.find('.') + 2);
311 311
 			buf += tmpBuf + L" Hz)";
Browse code

[NCSF] Update version and README for the previous change.

Naram Qashat authored on 2014/12/09 23:06:40
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-10-25
4
+ * Last modification on 2014-12-09
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -21,7 +21,7 @@ enum
21 21
 
22 22
 unsigned XSFConfig::initSampleRate = 44100;
23 23
 std::string XSFConfig::commonName = "NCSF Decoder";
24
-std::string XSFConfig::versionNumber = "1.11";
24
+std::string XSFConfig::versionNumber = "1.11.1";
25 25
 unsigned XSFConfig_NCSF::initInterpolation = 4;
26 26
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
27 27
 
Browse code

[NCSF] Utilize the PLAYER blocks in the SDAT if they exist.

Backwards compatibility is kept by treating the lack of PLAYER info as
if all channels are able to be allocated.

Naram Qashat authored on 2014/10/25 23:12:53
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-10-23
4
+ * Last modification on 2014-10-25
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -21,7 +21,7 @@ enum
21 21
 
22 22
 unsigned XSFConfig::initSampleRate = 44100;
23 23
 std::string XSFConfig::commonName = "NCSF Decoder";
24
-std::string XSFConfig::versionNumber = "1.10.3";
24
+std::string XSFConfig::versionNumber = "1.11";
25 25
 unsigned XSFConfig_NCSF::initInterpolation = 4;
26 26
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
27 27
 
Browse code

[NCSF] Bump version number for the previous fixes.

Naram Qashat authored on 2014/10/23 23:27:37
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-10-15
4
+ * Last modification on 2014-10-23
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -21,7 +21,7 @@ enum
21 21
 
22 22
 unsigned XSFConfig::initSampleRate = 44100;
23 23
 std::string XSFConfig::commonName = "NCSF Decoder";
24
-std::string XSFConfig::versionNumber = "1.10.2";
24
+std::string XSFConfig::versionNumber = "1.10.3";
25 25
 unsigned XSFConfig_NCSF::initInterpolation = 4;
26 26
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
27 27
 
Browse code

[NCSF] Changed sinc interpolation to a Nuttall 3-term Window on suggestion from kode54.

Naram Qashat authored on 2014/10/23 23:03:52
Showing 1 changed files
... ...
@@ -81,7 +81,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
81 81
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Linear"));
82 82
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order Legrange"));
83 83
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Legrange"));
84
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"16-point Sinc (Lanczos Window)"));
84
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"16-point Sinc (Nuttall 3-term Window)"));
85 85
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
86 86
 			// Mutes
87 87
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
Browse code

[NCSF] Changes to the Sound View debug window: * No longer has the hold/busy items. * Source Address replaced with State.

Naram Qashat authored on 2014/10/23 21:40:50
Showing 1 changed files
... ...
@@ -277,9 +277,6 @@ void XSFConfig_NCSF::RefreshSoundView()
277 277
 				buf = L"R" + wstringify(chn.reg.panning - 64);
278 278
 			SetDlgItemTextW(hDlg, IDC_SOUND0PAN + chanId, buf.c_str());
279 279
 
280
-			SetDlgItemTextW(hDlg, IDC_SOUND0HOLD + chanId, L"---");
281
-			SetDlgItemTextW(hDlg, IDC_SOUND0BUSY + chanId, L"---");
282
-
283 280
 			static const std::wstring modes[] = { L"Manual", L"Loop Infinite", L"One-Shot", L"Prohibited" };
284 281
 			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, (wstringify(chn.reg.repeatMode) + L" (" + modes[chn.reg.repeatMode] + L")").c_str());
285 282
 
... ...
@@ -301,7 +298,8 @@ void XSFConfig_NCSF::RefreshSoundView()
301 298
 				SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, buf.c_str());
302 299
 			}
303 300
 
304
-			SetDlgItemTextW(hDlg, IDC_SOUND0SAD + chanId, L"---");
301
+			static const std::wstring states[] = { L"NONE", L"START", L"ATTACK", L"DECAY", L"SUSTAIN", L"RELEASE" };
302
+			SetDlgItemTextW(hDlg, IDC_SOUND0STATE + chanId, states[chn.state].c_str());
305 303
 
306 304
 			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, (L"samp #" + wstringify(chn.reg.loopStart)).c_str());
307 305
 
... ...
@@ -321,11 +319,9 @@ void XSFConfig_NCSF::RefreshSoundView()
321 319
 			ProgressSetPosImmediate(hDlg, IDC_SOUND0VOLBAR + chanId, 0);
322 320
 			SetDlgItemTextW(hDlg, IDC_SOUND0VOL + chanId, L"---");
323 321
 			SetDlgItemTextW(hDlg, IDC_SOUND0PAN + chanId, L"---");
324
-			SetDlgItemTextW(hDlg, IDC_SOUND0HOLD + chanId, L"---");
325
-			SetDlgItemTextW(hDlg, IDC_SOUND0BUSY + chanId, L"---");
326 322
 			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, L"---");
327 323
 			SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, L"---");
328
-			SetDlgItemTextW(hDlg, IDC_SOUND0SAD + chanId, L"---");
324
+			SetDlgItemTextW(hDlg, IDC_SOUND0STATE + chanId, L"NONE");
329 325
 			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, L"---");
330 326
 			SetDlgItemTextW(hDlg, IDC_SOUND0TMR + chanId, L"---");
331 327
 			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, L"---");
Browse code

[NCSF] Minor edit with the debug Sound View so it doesn't use a reference.

Naram Qashat authored on 2014/10/20 02:33:26
Showing 1 changed files
... ...
@@ -248,7 +248,7 @@ void XSFConfig_NCSF::RefreshSoundView()
248 248
 	std::wstring buf;
249 249
 	for (size_t chanId = 0; chanId < 16; ++chanId)
250 250
 	{
251
-		auto &chn = player->GetChannel(chanId);
251
+		auto chn = player->GetChannel(chanId);
252 252
 
253 253
 		if (chn.state > CS_START)
254 254
 		{
Browse code

[NCSF] Bump version number for the previous volume fixes.

Naram Qashat authored on 2014/10/18 04:35:07
Showing 1 changed files
... ...
@@ -21,7 +21,7 @@ enum
21 21
 
22 22
 unsigned XSFConfig::initSampleRate = 44100;
23 23
 std::string XSFConfig::commonName = "NCSF Decoder";
24
-std::string XSFConfig::versionNumber = "1.10.1";
24
+std::string XSFConfig::versionNumber = "1.10.2";
25 25
 unsigned XSFConfig_NCSF::initInterpolation = 4;
26 26
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
27 27
 
Browse code

[NCSF] Move track allocation into the SSEQ command handler.

This was suggested by fincs after I found some sequences that appeared
to do track allocations later in them than expected originally.

Naram Qashat authored on 2014/10/15 18:03:10
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-10-13
4
+ * Last modification on 2014-10-15
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -21,7 +21,7 @@ enum
21 21
 
22 22
 unsigned XSFConfig::initSampleRate = 44100;
23 23
 std::string XSFConfig::commonName = "NCSF Decoder";
24
-std::string XSFConfig::versionNumber = "1.10";
24
+std::string XSFConfig::versionNumber = "1.10.1";
25 25
 unsigned XSFConfig_NCSF::initInterpolation = 4;
26 26
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
27 27
 
Browse code

[NCSF] Implemented the random, variable, and conditional commands. Also fixed loop counter.

Naram Qashat authored on 2014/10/13 18:00:29
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-10-05
4
+ * Last modification on 2014-10-13
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -21,7 +21,7 @@ enum
21 21
 
22 22
 unsigned XSFConfig::initSampleRate = 44100;
23 23
 std::string XSFConfig::commonName = "NCSF Decoder";
24
-std::string XSFConfig::versionNumber = "1.9.1";
24
+std::string XSFConfig::versionNumber = "1.10";
25 25
 unsigned XSFConfig_NCSF::initInterpolation = 4;
26 26
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
27 27
 
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,15 +1,17 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-28
4
+ * Last modification on 2014-10-05
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
8 8
 
9
-#include <bitset>
10
-#include "XSFPlayer_NCSF.h"
11
-#include "XSFConfig.h"
9
+#include "XSFConfig_NCSF.h"
12 10
 #include "convert.h"
11
+#ifdef _DEBUG
12
+# include "resource.h"
13
+# include <CommCtrl.h>
14
+#endif
13 15
 
14 16
 enum
15 17
 {
... ...
@@ -17,31 +19,9 @@ enum
17 19
 	idMutes
18 20
 };
19 21
 
20
-class XSFConfig_NCSF : public XSFConfig
21
-{
22
-protected:
23
-	static unsigned initInterpolation;
24
-	static std::string initMutes;
25
-
26
-	friend class XSFConfig;
27
-	unsigned interpolation;
28
-	std::bitset<16> mutes;
29
-
30
-	XSFConfig_NCSF();
31
-	void LoadSpecificConfig();
32
-	void SaveSpecificConfig();
33
-	void GenerateSpecificDialogs();
34
-	INT_PTR CALLBACK ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
35
-	void ResetSpecificConfigDefaults(HWND hwndDlg);
36
-	void SaveSpecificConfigDialog(HWND hwndDlg);
37
-	void CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad);
38
-public:
39
-	void About(HWND parent);
40
-};
41
-
42 22
 unsigned XSFConfig::initSampleRate = 44100;
43 23
 std::string XSFConfig::commonName = "NCSF Decoder";
44
-std::string XSFConfig::versionNumber = "1.9";
24
+std::string XSFConfig::versionNumber = "1.9.1";
45 25
 unsigned XSFConfig_NCSF::initInterpolation = 4;
46 26
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
47 27
 
... ...
@@ -51,6 +31,9 @@ XSFConfig *XSFConfig::Create()
51 31
 }
52 32
 
53 33
 XSFConfig_NCSF::XSFConfig_NCSF() : XSFConfig(), interpolation(0), mutes()
34
+#ifdef _DEBUG
35
+	, soundViewData()
36
+#endif
54 37
 {
55 38
 	this->supportedSampleRates.push_back(8000);
56 39
 	this->supportedSampleRates.push_back(11025);
... ...
@@ -131,7 +114,7 @@ void XSFConfig_NCSF::SaveSpecificConfigDialog(HWND hwndDlg)
131 114
 
132 115
 void XSFConfig_NCSF::CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool)
133 116
 {
134
-	XSFPlayer_NCSF *NCSFPlayer = static_cast<XSFPlayer_NCSF *>(xSFPlayer);
117
+	auto NCSFPlayer = static_cast<XSFPlayer_NCSF *>(xSFPlayer);
135 118
 	NCSFPlayer->SetInterpolation(this->interpolation);
136 119
 	NCSFPlayer->SetMutes(this->mutes);
137 120
 }
... ...
@@ -141,3 +124,223 @@ void XSFConfig_NCSF::About(HWND parent)
141 124
 	MessageBoxW(parent, ConvertFuncs::StringToWString(XSFConfig::commonName + " v" + XSFConfig::versionNumber + ", using xSF Winamp plugin framework (based on the vio*sf plugins) by Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]\n\n"
142 125
 		"Utilizes code adapted from the FeOS Sound System library by fincs, git revision 5204c55 on GitHub, for audio playback.").c_str(), ConvertFuncs::StringToWString(XSFConfig::commonName + " v" + XSFConfig::versionNumber).c_str(), MB_OK);
143 126
 }
127
+
128
+#ifdef _DEBUG
129
+INT_PTR CALLBACK XSFConfig_NCSF::SoundViewDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
130
+{
131
+	auto data = reinterpret_cast<SoundViewData *>(GetWindowLongW(hwndDlg, DWLP_USER));
132
+	if (!data && uMsg != WM_INITDIALOG)
133
+		return false;
134
+
135
+	switch (uMsg)
136
+	{
137
+		case WM_INITDIALOG:
138
+			if (!data)
139
+			{
140
+				data = reinterpret_cast<SoundViewData *>(lParam);
141
+				SetWindowLongW(hwndDlg, DWLP_USER, reinterpret_cast<LONG>(data));
142
+			}
143
+			data->hDlg = hwndDlg;
144
+			for (int chanId = 0; chanId < 16; ++chanId)
145
+			{
146
+				SendDlgItemMessageW(hwndDlg, IDC_SOUND0VOLBAR + chanId, PBM_SETRANGE, 0, MAKELPARAM(0, 128));
147
+				SendDlgItemMessageW(hwndDlg, IDC_SOUND0PANBAR + chanId, PBM_SETRANGE, 0, MAKELPARAM(0, 128));
148
+				SendDlgItemMessageW(hwndDlg, IDC_SOUND0MUTE + chanId, BM_SETCHECK, data->config->mutes[chanId], 0);
149
+			}
150
+			break;
151
+		case WM_CLOSE:
152
+		case WM_DESTROY:
153
+			data->config->CloseSoundView();
154
+			break;
155
+		case WM_COMMAND:
156
+			{
157
+				auto id = GET_WM_COMMAND_ID(wParam, lParam);
158
+				switch (id)
159
+				{
160
+					case IDC_BUTTON_VOLMODE:
161
+						data->volModeAlternative = !!IsDlgButtonChecked(hwndDlg, IDC_BUTTON_VOLMODE);
162
+						break;
163
+					case IDC_SOUND0MUTE:
164
+					case IDC_SOUND1MUTE:
165
+					case IDC_SOUND2MUTE:
166
+					case IDC_SOUND3MUTE:
167
+					case IDC_SOUND4MUTE:
168
+					case IDC_SOUND5MUTE:
169
+					case IDC_SOUND6MUTE:
170
+					case IDC_SOUND7MUTE:
171
+					case IDC_SOUND8MUTE:
172
+					case IDC_SOUND9MUTE:
173
+					case IDC_SOUND10MUTE:
174
+					case IDC_SOUND11MUTE:
175
+					case IDC_SOUND12MUTE:
176
+					case IDC_SOUND13MUTE:
177
+					case IDC_SOUND14MUTE:
178
+					case IDC_SOUND15MUTE:
179
+						data->config->mutes[id - IDC_SOUND0MUTE] = !!IsDlgButtonChecked(hwndDlg, id);
180
+						data->config->SaveConfig();
181
+						data->player->SetMutes(data->config->mutes);
182
+						break;
183
+					case IDC_SOUND_UNMUTE_ALL:
184
+						for (int chanId = 0; chanId < 16; ++chanId)
185
+							SendDlgItemMessageW(hwndDlg, IDC_SOUND0MUTE + chanId, BM_SETCHECK, false, 0);
186
+						data->config->mutes.reset();
187
+						data->config->SaveConfig();
188
+						data->player->SetMutes(data->config->mutes);
189
+						break;
190
+					default:
191
+						return false;
192
+				}
193
+			}
194
+			break;
195
+		default:
196
+			return false;
197
+	}
198
+
199
+	return true;
200
+}
201
+
202
+void XSFConfig_NCSF::CallSoundView(XSFPlayer *xSFPlayer, HINSTANCE hInstance, HWND hwndParent)
203
+{
204
+	this->soundViewData.reset(new SoundViewData);
205
+	this->soundViewData->config = this;
206
+	this->soundViewData->player = static_cast<XSFPlayer_NCSF *>(xSFPlayer);
207
+
208
+	auto hDlg = CreateDialogParamW(hInstance, MAKEINTRESOURCEW(IDD_SOUND_VIEW), hwndParent, XSFConfig_NCSF::SoundViewDialogProc, reinterpret_cast<LPARAM>(this->soundViewData.get()));
209
+	if (!hDlg)
210
+	{
211
+		this->soundViewData.reset();
212
+		return;
213
+	}
214
+
215
+	ShowWindow(hDlg, SW_SHOW);
216
+	UpdateWindow(hDlg);
217
+}
218
+
219
+static inline void ProgressSetPosImmediate(HWND hDlg, int nIDDlgItem, int nPos)
220
+{
221
+	int nMin = SendDlgItemMessageW(hDlg, nIDDlgItem, PBM_GETRANGE, true, reinterpret_cast<LPARAM>(nullptr));
222
+	int nMax = SendDlgItemMessageW(hDlg, nIDDlgItem, PBM_GETRANGE, false, reinterpret_cast<LPARAM>(nullptr));
223
+
224
+	// get rid of fancy progress animation since Windows Vista
225
+	// http://stackoverflow.com/questions/1061715/how-do-i-make-tprogressbar-stop-lagging
226
+	if (nPos < nMax)
227
+	{
228
+		SendDlgItemMessageW(hDlg, nIDDlgItem, PBM_SETPOS, nPos + 1, 0);
229
+		SendDlgItemMessageW(hDlg, nIDDlgItem, PBM_SETPOS, nPos, 0); // This will set Progress backwards and give an instant update
230
+	}
231
+	else
232
+	{
233
+		SendDlgItemMessageW(hDlg, nIDDlgItem, PBM_SETRANGE32, nMin, nPos + 1);
234
+		SendDlgItemMessageW(hDlg, nIDDlgItem, PBM_SETPOS, nPos + 1, 0);
235
+		SendDlgItemMessageW(hDlg, nIDDlgItem, PBM_SETRANGE32, nMin, nPos); // This will also set Progress backwards also so instant update
236
+	}
237
+}
238
+
239
+static inline int32_t muldiv7(int32_t val, uint8_t mul)
240
+{
241
+	return mul == 127 ? val : ((val * mul) >> 7);
242
+}
243
+
244
+void XSFConfig_NCSF::RefreshSoundView()
245
+{
246
+	auto player = this->soundViewData->player;
247
+	auto hDlg = this->soundViewData->hDlg;
248
+	std::wstring buf;
249
+	for (size_t chanId = 0; chanId < 16; ++chanId)
250
+	{
251
+		auto &chn = player->GetChannel(chanId);
252
+
253
+		if (chn.state > CS_START)
254
+		{
255
+			ProgressSetPosImmediate(hDlg, IDC_SOUND0PANBAR + chanId, muldiv7(128, chn.reg.panning));
256
+			uint8_t datashift = chn.reg.volumeDiv;
257
+			if (datashift == 3)
258
+				datashift = 4;
259
+			int32_t vol = muldiv7(128, chn.reg.volumeMul) >> datashift;
260
+			ProgressSetPosImmediate(hDlg, IDC_SOUND0VOLBAR + chanId, vol);
261
+
262
+			if (this->soundViewData->volModeAlternative)
263
+				buf = wstringify(chn.reg.volumeMul) + L"/" + wstringify(1 << datashift);
264
+			else
265
+				buf = wstringify(vol);
266
+			SetDlgItemTextW(hDlg, IDC_SOUND0VOL + chanId, buf.c_str());
267
+
268
+			if (!chn.reg.panning)
269
+				buf = L"L";
270
+			else if (chn.reg.panning == 64)
271
+				buf = L"C";
272
+			else if (chn.reg.panning == 127)
273
+				buf = L"R";
274
+			else if (chn.reg.panning < 64)
275
+				buf = L"L" + wstringify(64 - chn.reg.panning);
276
+			else //if (chn.reg.panning > 64)
277
+				buf = L"R" + wstringify(chn.reg.panning - 64);
278
+			SetDlgItemTextW(hDlg, IDC_SOUND0PAN + chanId, buf.c_str());
279
+
280
+			SetDlgItemTextW(hDlg, IDC_SOUND0HOLD + chanId, L"---");
281
+			SetDlgItemTextW(hDlg, IDC_SOUND0BUSY + chanId, L"---");
282
+
283
+			static const std::wstring modes[] = { L"Manual", L"Loop Infinite", L"One-Shot", L"Prohibited" };
284
+			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, (wstringify(chn.reg.repeatMode) + L" (" + modes[chn.reg.repeatMode] + L")").c_str());
285
+
286
+			if (chn.reg.format != 3)
287
+			{
288
+				static const std::wstring formats[] = { L"PCM8", L"PCM16", L"IMA-ADPCM" };
289
+				SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, (wstringify(chn.reg.format) + L" (" + formats[chn.reg.format] + L")").c_str());
290
+			}
291
+			else
292
+			{
293
+				buf = L"3 (";
294
+				if (chanId < 8)
295
+					buf += L"PSG/Noise?";
296
+				else if (chanId < 14)
297
+					buf += wstringify(chn.reg.waveDuty == 7 ? 0 : 12.5 * (chn.reg.waveDuty + 1)) + L"% Square";
298
+				else
299
+					buf += L"Noise";
300
+				buf += L")";
301
+				SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, buf.c_str());
302
+			}
303
+
304
+			SetDlgItemTextW(hDlg, IDC_SOUND0SAD + chanId, L"---");
305
+
306
+			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, (L"samp #" + wstringify(chn.reg.loopStart)).c_str());
307
+
308
+			std::wstring tmpBuf = ConvertFuncs::StringToWString(NumToHexString(chn.reg.timer)).substr(2);
309
+			buf = L"$" + tmpBuf + L" (";
310
+			tmpBuf = wstringify((ARM7_CLOCK / 2) / static_cast<double>(0x10000 - chn.reg.timer));
311
+			if (tmpBuf.find('.') != std::wstring::npos)
312
+				tmpBuf = tmpBuf.substr(0, tmpBuf.find('.') + 2);
313
+			buf += tmpBuf + L" Hz)";
314
+			SetDlgItemTextW(hDlg, IDC_SOUND0TMR + chanId, buf.c_str());
315
+
316
+			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, (L"samp #" + wstringify(static_cast<uint32_t>(chn.reg.samplePosition)) + L" / " + wstringify(chn.reg.totalLength)).c_str());
317
+		}
318
+		else if (this->soundViewData->channelLastStates[chanId] != CS_NONE)
319
+		{
320
+			ProgressSetPosImmediate(hDlg, IDC_SOUND0PANBAR + chanId, 0);
321
+			ProgressSetPosImmediate(hDlg, IDC_SOUND0VOLBAR + chanId, 0);
322
+			SetDlgItemTextW(hDlg, IDC_SOUND0VOL + chanId, L"---");
323
+			SetDlgItemTextW(hDlg, IDC_SOUND0PAN + chanId, L"---");
324
+			SetDlgItemTextW(hDlg, IDC_SOUND0HOLD + chanId, L"---");
325
+			SetDlgItemTextW(hDlg, IDC_SOUND0BUSY + chanId, L"---");
326
+			SetDlgItemTextW(hDlg, IDC_SOUND0REPEATMODE + chanId, L"---");
327
+			SetDlgItemTextW(hDlg, IDC_SOUND0FORMAT + chanId, L"---");
328
+			SetDlgItemTextW(hDlg, IDC_SOUND0SAD + chanId, L"---");
329
+			SetDlgItemTextW(hDlg, IDC_SOUND0PNT + chanId, L"---");
330
+			SetDlgItemTextW(hDlg, IDC_SOUND0TMR + chanId, L"---");
331
+			SetDlgItemTextW(hDlg, IDC_SOUND0POSLEN + chanId, L"---");
332
+		}
333
+
334
+		this->soundViewData->channelLastStates[chanId] = chn.state;
335
+	}
336
+}
337
+
338
+void XSFConfig_NCSF::CloseSoundView()
339
+{
340
+	if (this->soundViewData)
341
+	{
342
+		DestroyWindow(this->soundViewData->hDlg);
343
+		this->soundViewData.reset();
344
+	}
345
+}
346
+#endif
Browse code

[NCSF] Should've updated the version number before.

Naram Qashat authored on 2014/09/28 14:43:16
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-24
4
+ * Last modification on 2014-09-28
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -41,7 +41,7 @@ public:
41 41
 
42 42
 unsigned XSFConfig::initSampleRate = 44100;
43 43
 std::string XSFConfig::commonName = "NCSF Decoder";
44
-std::string XSFConfig::versionNumber = "1.8.1";
44
+std::string XSFConfig::versionNumber = "1.9";
45 45
 unsigned XSFConfig_NCSF::initInterpolation = 4;
46 46
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
47 47
 
Browse code

[NCSF] Interpolation changes:

* Removed Cosine, 4-Point B-Spline, 6-Point B-Spline, and 6-point
Osculating.
* Added 4-Point Legrange and 6-Point Legrange.
* Changed wording of the Sinc interpolation to mention that it is
16-point.

Naram Qashat authored on 2014/09/28 00:07:18
Showing 1 changed files
... ...
@@ -42,7 +42,7 @@ public:
42 42
 unsigned XSFConfig::initSampleRate = 44100;
43 43
 std::string XSFConfig::commonName = "NCSF Decoder";
44 44
 std::string XSFConfig::versionNumber = "1.8.1";
45
-unsigned XSFConfig_NCSF::initInterpolation = 5;
45
+unsigned XSFConfig_NCSF::initInterpolation = 4;
46 46
 std::string XSFConfig_NCSF::initMutes = "0000000000000000";
47 47
 
48 48
 XSFConfig *XSFConfig::Create()
... ...
@@ -96,11 +96,9 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
96 96
 			// Interpolation
97 97
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"None"));
98 98
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Linear"));
99
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Cosine"));
100
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order B-spline"));
101
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Osculating"));
102
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order B-spline"));
103
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Sinc (Lanczos Window)"));
99
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order Legrange"));
100
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Legrange"));
101
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"16-point Sinc (Lanczos Window)"));
104 102
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
105 103
 			// Mutes
106 104
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
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 - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-09-17
4
+ * Last modification on 2014-09-24
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -10,7 +10,6 @@
10 10
 #include "XSFPlayer_NCSF.h"
11 11
 #include "XSFConfig.h"
12 12
 #include "convert.h"
13
-#include "BigSString.h"
14 13
 
15 14
 enum
16 15
 {
... ...
@@ -22,7 +21,7 @@ class XSFConfig_NCSF : public XSFConfig
22 21
 {
23 22
 protected:
24 23
 	static unsigned initInterpolation;
25
-	static std::wstring initMutes;
24
+	static std::string initMutes;
26 25
 
27 26
 	friend class XSFConfig;
28 27
 	unsigned interpolation;
... ...
@@ -41,10 +40,10 @@ public:
41 40
 };
42 41
 
43 42
 unsigned XSFConfig::initSampleRate = 44100;
44
-std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.8.1";
43
+std::string XSFConfig::commonName = "NCSF Decoder";
44
+std::string XSFConfig::versionNumber = "1.8.1";
46 45
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47
-std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
46
+std::string XSFConfig_NCSF::initMutes = "0000000000000000";
48 47
 
49 48
 XSFConfig *XSFConfig::Create()
50 49
 {
... ...
@@ -68,15 +67,15 @@ XSFConfig_NCSF::XSFConfig_NCSF() : XSFConfig(), interpolation(0), mutes()
68 67
 
69 68
 void XSFConfig_NCSF::LoadSpecificConfig()
70 69
 {
71
-	this->interpolation = this->configIO->GetValue(L"Interpolation", XSFConfig_NCSF::initInterpolation);
72
-	std::wstringstream mutesSS(this->configIO->GetValue(L"Mutes", XSFConfig_NCSF::initMutes));
70
+	this->interpolation = this->configIO->GetValue("Interpolation", XSFConfig_NCSF::initInterpolation);
71
+	std::stringstream mutesSS(this->configIO->GetValue("Mutes", XSFConfig_NCSF::initMutes));
73 72
 	mutesSS >> this->mutes;
74 73
 }
75 74
 
76 75
 void XSFConfig_NCSF::SaveSpecificConfig()
77 76
 {
78
-	this->configIO->SetValue(L"Interpolation", this->interpolation);
79
-	this->configIO->SetValue(L"Mutes", this->mutes.to_string<wchar_t>());
77
+	this->configIO->SetValue("Interpolation", this->interpolation);
78
+	this->configIO->SetValue("Mutes", this->mutes.to_string<char>());
80 79
 }
81 80
 
82 81
 void XSFConfig_NCSF::GenerateSpecificDialogs()
... ...
@@ -141,6 +140,6 @@ void XSFConfig_NCSF::CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool)
141 140
 
142 141
 void XSFConfig_NCSF::About(HWND parent)
143 142
 {
144
-	MessageBoxW(parent, (XSFConfig::commonName + L" v" + XSFConfig::versionNumber + L", using xSF Winamp plugin framework (based on the vio*sf plugins) by Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]\n\n"
145
-		L"Utilizes code adapted from the FeOS Sound System library by fincs, git revision 5204c55 on GitHub, for audio playback.").c_str(), (XSFConfig::commonName + L" v" + XSFConfig::versionNumber).c_str(), MB_OK);
143
+	MessageBoxW(parent, ConvertFuncs::StringToWString(XSFConfig::commonName + " v" + XSFConfig::versionNumber + ", using xSF Winamp plugin framework (based on the vio*sf plugins) by Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]\n\n"
144
+		"Utilizes code adapted from the FeOS Sound System library by fincs, git revision 5204c55 on GitHub, for audio playback.").c_str(), ConvertFuncs::StringToWString(XSFConfig::commonName + " v" + XSFConfig::versionNumber).c_str(), MB_OK);
146 145
 }
Browse code

* Fixes for gcc and clang (while they can compile the code, the DLLs made aren't functional, but oh well).

* [2SF] Used more up-to-date asmjit, despite the ugly looking code.

Naram Qashat authored on 2014/09/17 19:51:45
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2014-06-17
4
+ * Last modification on 2014-09-17
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -69,7 +69,7 @@ XSFConfig_NCSF::XSFConfig_NCSF() : XSFConfig(), interpolation(0), mutes()
69 69
 void XSFConfig_NCSF::LoadSpecificConfig()
70 70
 {
71 71
 	this->interpolation = this->configIO->GetValue(L"Interpolation", XSFConfig_NCSF::initInterpolation);
72
-	std::wstringstream mutesSS = std::wstringstream(this->configIO->GetValue(L"Mutes", XSFConfig_NCSF::initMutes));
72
+	std::wstringstream mutesSS(this->configIO->GetValue(L"Mutes", XSFConfig_NCSF::initMutes));
73 73
 	mutesSS >> this->mutes;
74 74
 }
75 75
 
... ...
@@ -141,6 +141,6 @@ void XSFConfig_NCSF::CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool)
141 141
 
142 142
 void XSFConfig_NCSF::About(HWND parent)
143 143
 {
144
-	MessageBox(parent, (XSFConfig::commonName + L" v" + XSFConfig::versionNumber + L", using xSF Winamp plugin framework (based on the vio*sf plugins) by Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]\n\n"
144
+	MessageBoxW(parent, (XSFConfig::commonName + L" v" + XSFConfig::versionNumber + L", using xSF Winamp plugin framework (based on the vio*sf plugins) by Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]\n\n"
145 145
 		L"Utilizes code adapted from the FeOS Sound System library by fincs, git revision 5204c55 on GitHub, for audio playback.").c_str(), (XSFConfig::commonName + L" v" + XSFConfig::versionNumber).c_str(), MB_OK);
146 146
 }
Browse code

Reverted Sinc interpolation back to the Lanczos window.

Naram Qashat authored on 2014/06/17 10:40:29
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-05-07
4
+ * Last modification on 2014-06-17
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,7 +42,7 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.8";
45
+std::wstring XSFConfig::versionNumber = L"1.8.1";
46 46
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
... ...
@@ -101,7 +101,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
101 101
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order B-spline"));
102 102
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Osculating"));
103 103
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order B-spline"));
104
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Sinc (Hann Window)"));
104
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Sinc (Lanczos Window)"));
105 105
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
106 106
 			// Mutes
107 107
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
Browse code

* Replaced Lanczos window with Hann window for the windowed sinc function in the NCSF plugin. * Added a ring buffer specifically designed for working with SWAVs to replace the one provided by kode54, still have to give him thanks for the original though. * Fixed clipping issue caused by invalid clamping values. * Minor fix to using the min()/max() functions of numeric_limits because Winamp's out.h includes windows.h without my specific wrapper to redefine things.

Naram Qashat authored on 2013/05/07 05:42:46
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-26
4
+ * Last modification on 2013-05-07
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,7 +42,7 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.7.1";
45
+std::wstring XSFConfig::versionNumber = L"1.8";
46 46
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
... ...
@@ -101,7 +101,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
101 101
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order B-spline"));
102 102
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Osculating"));
103 103
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order B-spline"));
104
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Lanczos (Sinc)"));
104
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Sinc (Hann Window)"));
105 105
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
106 106
 			// Mutes
107 107
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
... ...
@@ -142,5 +142,5 @@ void XSFConfig_NCSF::CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool)
142 142
 void XSFConfig_NCSF::About(HWND parent)
143 143
 {
144 144
 	MessageBox(parent, (XSFConfig::commonName + L" v" + XSFConfig::versionNumber + L", using xSF Winamp plugin framework (based on the vio*sf plugins) by Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]\n\n"
145
-		L"Utilizes code adapted from the FeOS Sound System library by fincs, git revision 9cb9820 on GitHub, for audio playback.").c_str(), (XSFConfig::commonName + L" v" + XSFConfig::versionNumber).c_str(), MB_OK);
145
+		L"Utilizes code adapted from the FeOS Sound System library by fincs, git revision 5204c55 on GitHub, for audio playback.").c_str(), (XSFConfig::commonName + L" v" + XSFConfig::versionNumber).c_str(), MB_OK);
146 146
 }
Browse code

Minor update to scale the phase offset, thanks to kode54.

Naram Qashat authored on 2013/04/26 13:56:54
Showing 1 changed files
... ...
@@ -42,7 +42,7 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.7";
45
+std::wstring XSFConfig::versionNumber = L"1.7.1";
46 46
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
Browse code

Fixed up the Lanczos interpolation in NCSF (thanks to kode54), also allowed the NCSF plugin to use 32-bit samples in it's GenerateSamples function.

Naram Qashat authored on 2013/04/26 00:54:28
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-23
4
+ * Last modification on 2013-04-26
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,7 +42,7 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.6";
45
+std::wstring XSFConfig::versionNumber = L"1.7";
46 46
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
... ...
@@ -101,7 +101,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
101 101
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order B-spline"));
102 102
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Osculating"));
103 103
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order B-spline"));
104
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point Lanczos (Sinc)"));
104
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Lanczos (Sinc)"));
105 105
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
106 106
 			// Mutes
107 107
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
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 - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-18
4
+ * Last modification on 2013-04-23
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,7 +42,7 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.5";
45
+std::wstring XSFConfig::versionNumber = L"1.6";
46 46
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
... ...
@@ -101,6 +101,7 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
101 101
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order B-spline"));
102 102
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Osculating"));
103 103
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order B-spline"));
104
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point Lanczos (Sinc)"));
104 105
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
105 106
 			// Mutes
106 107
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
Browse code

Forgot to update the version number on the last commit.

Naram Qashat authored on 2013/04/18 20:47:39
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-12
4
+ * Last modification on 2013-04-18
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,7 +42,7 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.4";
45
+std::wstring XSFConfig::versionNumber = L"1.5";
46 46
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
Browse code

Removed the optimal, lagrange, and hermite interpolations and added in 2nd-order osculating.

Naram Qashat authored on 2013/04/12 10:25:49
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-10
4
+ * Last modification on 2013-04-12
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,8 +42,8 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.3";
46
-unsigned XSFConfig_NCSF::initInterpolation = 7;
45
+std::wstring XSFConfig::versionNumber = L"1.4";
46
+unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
49 49
 XSFConfig *XSFConfig::Create()
... ...
@@ -98,15 +98,9 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
98 98
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"None"));
99 99
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Linear"));
100 100
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Cosine"));
101
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"2-point, 3rd-order Optimal 16x"));
102
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order Hermite"));
103
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order Lagrange"));
104 101
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order B-spline"));
105
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 4th-order Optimal 16x"));
106
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Hermite"));
107
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Lagrange"));
102
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Osculating"));
108 103
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order B-spline"));
109
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Optimal 16x"));
110 104
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
111 105
 			// Mutes
112 106
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
Browse code

* Added more interpolation methods to in_ncsf. * Cleaned up a little of the code in the Interpolate function in in_ncsf. * Made it so changes in the config can apply to a running song, depending on the player. * Slight optimization of in_ncsf's interpolation so it doesn't have as much std::vector accessing. * Stopped trying to use the slope of the points to determine points outside the sample's range, hopefully will stop some of the clipping.

Naram Qashat authored on 2013/04/10 14:39:59
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * xSF - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-04-02
4
+ * Last modification on 2013-04-10
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,8 +42,8 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.2";
46
-unsigned XSFConfig_NCSF::initInterpolation = 5;
45
+std::wstring XSFConfig::versionNumber = L"1.3";
46
+unsigned XSFConfig_NCSF::initInterpolation = 7;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
49 49
 XSFConfig *XSFConfig::Create()
... ...
@@ -82,7 +82,7 @@ void XSFConfig_NCSF::SaveSpecificConfig()
82 82
 void XSFConfig_NCSF::GenerateSpecificDialogs()
83 83
 {
84 84
 	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Interpolation").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
85
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(90, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idInterpolation).
85
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(110, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idInterpolation).
86 86
 		IsDropDownList().WithTabStop());
87 87
 	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Mute").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
88 88
 	this->configDialog.AddListBoxControl(DialogListBoxBuilder().WithSize(78, 45).WithExactHeight().InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idMutes).
... ...
@@ -95,12 +95,18 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
95 95
 	{
96 96
 		case WM_INITDIALOG:
97 97
 			// Interpolation
98
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"No Interpolation"));
99
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Linear Interpolation"));
100
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Cosine Interpolation"));
101
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"B-spline Interpolation"));
102
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Hermite Interpolation"));
103
-			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Optimal Interpolation"));
98
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"None"));
99
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Linear"));
100
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Cosine"));
101
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"2-point, 3rd-order Optimal 16x"));
102
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order Hermite"));
103
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order Lagrange"));
104
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 3rd-order B-spline"));
105
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"4-point, 4th-order Optimal 16x"));
106
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Hermite"));
107
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Lagrange"));
108
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order B-spline"));
109
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"6-point, 5th-order Optimal 16x"));
104 110
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
105 111
 			// Mutes
106 112
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
... ...
@@ -131,13 +137,11 @@ void XSFConfig_NCSF::SaveSpecificConfigDialog(HWND hwndDlg)
131 137
 		this->mutes[x] = !!SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_GETSEL, x, 0);
132 138
 }
133 139
 
134
-void XSFConfig_NCSF::CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad)
140
+void XSFConfig_NCSF::CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool)
135 141
 {
136 142
 	XSFPlayer_NCSF *NCSFPlayer = static_cast<XSFPlayer_NCSF *>(xSFPlayer);
137
-	if (preLoad)
138
-		NCSFPlayer->SetInterpolation(this->interpolation);
139
-	else
140
-		NCSFPlayer->SetMutes(this->mutes);
143
+	NCSFPlayer->SetInterpolation(this->interpolation);
144
+	NCSFPlayer->SetMutes(this->mutes);
141 145
 }
142 146
 
143 147
 void XSFConfig_NCSF::About(HWND parent)
Browse code

Updated version number for the previous 2 revisions.

Naram Qashat authored on 2013/04/07 16:40:04
Showing 1 changed files
... ...
@@ -42,7 +42,7 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.1";
45
+std::wstring XSFConfig::versionNumber = L"1.2";
46 46
 unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
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 - NCSF configuration
3 3
  * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]
4
- * Last modification on 2013-03-25
4
+ * Last modification on 2013-04-02
5 5
  *
6 6
  * Partially based on the vio*sf framework
7 7
  */
... ...
@@ -42,8 +42,8 @@ public:
42 42
 
43 43
 unsigned XSFConfig::initSampleRate = 44100;
44 44
 std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
-std::wstring XSFConfig::versionNumber = L"1.0";
46
-unsigned XSFConfig_NCSF::initInterpolation = 2;
45
+std::wstring XSFConfig::versionNumber = L"1.1";
46
+unsigned XSFConfig_NCSF::initInterpolation = 5;
47 47
 std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48 48
 
49 49
 XSFConfig *XSFConfig::Create()
... ...
@@ -82,7 +82,7 @@ void XSFConfig_NCSF::SaveSpecificConfig()
82 82
 void XSFConfig_NCSF::GenerateSpecificDialogs()
83 83
 {
84 84
 	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Interpolation").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
85
-	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idInterpolation).
85
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(90, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idInterpolation).
86 86
 		IsDropDownList().WithTabStop());
87 87
 	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Mute").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
88 88
 	this->configDialog.AddListBoxControl(DialogListBoxBuilder().WithSize(78, 45).WithExactHeight().InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idMutes).
... ...
@@ -98,6 +98,9 @@ INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARA
98 98
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"No Interpolation"));
99 99
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Linear Interpolation"));
100 100
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Cosine Interpolation"));
101
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"B-spline Interpolation"));
102
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Hermite Interpolation"));
103
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Optimal Interpolation"));
101 104
 			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
102 105
 			// Mutes
103 106
 			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
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,144 @@
1
+/*
2
+ * xSF - NCSF configuration
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 <bitset>
10
+#include "XSFPlayer_NCSF.h"
11
+#include "XSFConfig.h"
12
+#include "convert.h"
13
+#include "BigSString.h"
14
+
15
+enum
16
+{
17
+	idInterpolation = 1000,
18
+	idMutes
19
+};
20
+
21
+class XSFConfig_NCSF : public XSFConfig
22
+{
23
+protected:
24
+	static unsigned initInterpolation;
25
+	static std::wstring initMutes;
26
+
27
+	friend class XSFConfig;
28
+	unsigned interpolation;
29
+	std::bitset<16> mutes;
30
+
31
+	XSFConfig_NCSF();
32
+	void LoadSpecificConfig();
33
+	void SaveSpecificConfig();
34
+	void GenerateSpecificDialogs();
35
+	INT_PTR CALLBACK ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
36
+	void ResetSpecificConfigDefaults(HWND hwndDlg);
37
+	void SaveSpecificConfigDialog(HWND hwndDlg);
38
+	void CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad);
39
+public:
40
+	void About(HWND parent);
41
+};
42
+
43
+unsigned XSFConfig::initSampleRate = 44100;
44
+std::wstring XSFConfig::commonName = L"NCSF Decoder";
45
+std::wstring XSFConfig::versionNumber = L"1.0";
46
+unsigned XSFConfig_NCSF::initInterpolation = 2;
47
+std::wstring XSFConfig_NCSF::initMutes = L"0000000000000000";
48
+
49
+XSFConfig *XSFConfig::Create()
50
+{
51
+	return new XSFConfig_NCSF();
52
+}
53
+
54
+XSFConfig_NCSF::XSFConfig_NCSF() : XSFConfig(), interpolation(0), mutes()
55
+{
56
+	this->supportedSampleRates.push_back(8000);
57
+	this->supportedSampleRates.push_back(11025);
58
+	this->supportedSampleRates.push_back(16000);
59
+	this->supportedSampleRates.push_back(22050);
60
+	this->supportedSampleRates.push_back(32000);
61
+	this->supportedSampleRates.push_back(44100);
62
+	this->supportedSampleRates.push_back(48000);
63
+	this->supportedSampleRates.push_back(88200);
64
+	this->supportedSampleRates.push_back(96000);
65
+	this->supportedSampleRates.push_back(176400);
66
+	this->supportedSampleRates.push_back(192000);
67
+}
68
+
69
+void XSFConfig_NCSF::LoadSpecificConfig()
70
+{
71
+	this->interpolation = this->configIO->GetValue(L"Interpolation", XSFConfig_NCSF::initInterpolation);
72
+	std::wstringstream mutesSS = std::wstringstream(this->configIO->GetValue(L"Mutes", XSFConfig_NCSF::initMutes));
73
+	mutesSS >> this->mutes;
74
+}
75
+
76
+void XSFConfig_NCSF::SaveSpecificConfig()
77
+{
78
+	this->configIO->SetValue(L"Interpolation", this->interpolation);
79
+	this->configIO->SetValue(L"Mutes", this->mutes.to_string<wchar_t>());
80
+}
81
+
82
+void XSFConfig_NCSF::GenerateSpecificDialogs()
83
+{
84
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Interpolation").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
85
+	this->configDialog.AddComboBoxControl(DialogComboBoxBuilder().WithSize(78, 14).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idInterpolation).
86
+		IsDropDownList().WithTabStop());
87
+	this->configDialog.AddLabelControl(DialogLabelBuilder(L"Mute").WithSize(50, 8).InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_BOTTOMLEFT, Point<short>(0, 10), 2).IsLeftJustified());
88
+	this->configDialog.AddListBoxControl(DialogListBoxBuilder().WithSize(78, 45).WithExactHeight().InGroup(L"Output").WithRelativePositionToSibling(RelativePosition::FROM_TOPRIGHT, Point<short>(5, -3)).WithID(idMutes).
89
+		WithBorder().WithVerticalScrollbar().WithMultipleSelect().WithTabStop());
90
+}
91
+
92
+INT_PTR CALLBACK XSFConfig_NCSF::ConfigDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
93
+{
94
+	switch (uMsg)
95
+	{
96
+		case WM_INITDIALOG:
97
+			// Interpolation
98
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"No Interpolation"));
99
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Linear Interpolation"));
100
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(L"Cosine Interpolation"));
101
+			SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, this->interpolation, 0);
102
+			// Mutes
103
+			for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
104
+			{
105
+				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_ADDSTRING, 0, reinterpret_cast<LPARAM>((L"SPU " + wstringify(x + 1)).c_str()));
106
+				SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, this->mutes[x], x);
107
+			}
108
+			break;
109
+		case WM_COMMAND:
110
+			break;
111
+	}
112
+
113
+	return XSFConfig::ConfigDialogProc(hwndDlg, uMsg, wParam, lParam);
114
+}
115
+
116
+void XSFConfig_NCSF::ResetSpecificConfigDefaults(HWND hwndDlg)
117
+{
118
+	SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_SETCURSEL, XSFConfig_NCSF::initInterpolation, 0);
119
+	auto tmpMutes = std::bitset<16>(XSFConfig_NCSF::initMutes);
120
+	for (int x = 0, numMutes = tmpMutes.size(); x < numMutes; ++x)
121
+		SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_SETSEL, tmpMutes[x], x);
122
+}
123
+
124
+void XSFConfig_NCSF::SaveSpecificConfigDialog(HWND hwndDlg)
125
+{
126
+	this->interpolation = static_cast<unsigned>(SendMessageW(GetDlgItem(hwndDlg, idInterpolation), CB_GETCURSEL, 0, 0));
127
+	for (int x = 0, numMutes = this->mutes.size(); x < numMutes; ++x)
128
+		this->mutes[x] = !!SendMessageW(GetDlgItem(hwndDlg, idMutes), LB_GETSEL, x, 0);
129
+}
130
+
131
+void XSFConfig_NCSF::CopySpecificConfigToMemory(XSFPlayer *xSFPlayer, bool preLoad)
132
+{
133
+	XSFPlayer_NCSF *NCSFPlayer = static_cast<XSFPlayer_NCSF *>(xSFPlayer);
134
+	if (preLoad)
135
+		NCSFPlayer->SetInterpolation(this->interpolation);
136
+	else
137
+		NCSFPlayer->SetMutes(this->mutes);
138
+}
139
+
140
+void XSFConfig_NCSF::About(HWND parent)
141
+{
142
+	MessageBox(parent, (XSFConfig::commonName + L" v" + XSFConfig::versionNumber + L", using xSF Winamp plugin framework (based on the vio*sf plugins) by Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com]\n\n"
143
+		L"Utilizes code adapted from the FeOS Sound System library by fincs, git revision 9cb9820 on GitHub, for audio playback.").c_str(), (XSFConfig::commonName + L" v" + XSFConfig::versionNumber).c_str(), MB_OK);
144
+}