* 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().
| ... | ... |
@@ -8,21 +8,24 @@ |
| 8 | 8 |
|
| 9 | 9 |
#pragma once |
| 10 | 10 |
|
| 11 |
-#include "common.h" |
|
| 11 |
+#include <vector> |
|
| 12 |
+#include <cstdint> |
|
| 13 |
+ |
|
| 14 |
+struct PseudoFile; |
|
| 12 | 15 |
|
| 13 | 16 |
struct SWAV |
| 14 | 17 |
{
|
| 15 |
- uint8_t waveType; |
|
| 16 |
- uint8_t loop; |
|
| 17 |
- uint16_t sampleRate; |
|
| 18 |
- uint16_t time; |
|
| 19 |
- uint32_t loopOffset; |
|
| 20 |
- uint32_t nonLoopLength; |
|
| 21 |
- std::vector<int16_t> data; |
|
| 22 |
- const int16_t *dataptr; |
|
| 18 |
+ std::uint8_t waveType; |
|
| 19 |
+ std::uint8_t loop; |
|
| 20 |
+ std::uint16_t sampleRate; |
|
| 21 |
+ std::uint16_t time; |
|
| 22 |
+ std::uint32_t loopOffset; |
|
| 23 |
+ std::uint32_t nonLoopLength; |
|
| 24 |
+ std::vector<std::int16_t> data; |
|
| 25 |
+ const std::int16_t *dataptr; |
|
| 23 | 26 |
|
| 24 | 27 |
SWAV(); |
| 25 | 28 |
|
| 26 | 29 |
void Read(PseudoFile &file); |
| 27 |
- void DecodeADPCM(const uint8_t *origData, uint32_t len); |
|
| 30 |
+ void DecodeADPCM(const std::uint8_t *origData, std::uint32_t len); |
|
| 28 | 31 |
}; |
(I never remember to update these and besides, GitHub history can show when they were last modified.)
| ... | ... |
@@ -1,7 +1,6 @@ |
| 1 | 1 |
/* |
| 2 | 2 |
* SSEQ Player - SDAT SWAV (Waveform/Sample) structure |
| 3 | 3 |
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
| 4 |
- * Last modification on 2014-09-08 |
|
| 5 | 4 |
* |
| 6 | 5 |
* Nintendo DS Nitro Composer (SDAT) Specification document found at |
| 7 | 6 |
* http://www.feshrine.net/hacking/doc/nds-sdat.html |
| ... | ... |
@@ -1,14 +1,13 @@ |
| 1 | 1 |
/* |
| 2 | 2 |
* SSEQ Player - SDAT SWAV (Waveform/Sample) structure |
| 3 | 3 |
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
| 4 |
- * Last modification on 2013-04-10 |
|
| 4 |
+ * Last modification on 2014-09-08 |
|
| 5 | 5 |
* |
| 6 | 6 |
* Nintendo DS Nitro Composer (SDAT) Specification document found at |
| 7 | 7 |
* http://www.feshrine.net/hacking/doc/nds-sdat.html |
| 8 | 8 |
*/ |
| 9 | 9 |
|
| 10 |
-#ifndef SSEQPLAYER_SWAV_H |
|
| 11 |
-#define SSEQPLAYER_SWAV_H |
|
| 10 |
+#pragma once |
|
| 12 | 11 |
|
| 13 | 12 |
#include "common.h" |
| 14 | 13 |
|
| ... | ... |
@@ -28,5 +27,3 @@ struct SWAV |
| 28 | 27 |
void Read(PseudoFile &file); |
| 29 | 28 |
void DecodeADPCM(const uint8_t *origData, uint32_t len); |
| 30 | 29 |
}; |
| 31 |
- |
|
| 32 |
-#endif |
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
/* |
| 2 | 2 |
* SSEQ Player - SDAT SWAV (Waveform/Sample) structure |
| 3 | 3 |
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
| 4 |
- * Last modification on 2013-03-21 |
|
| 4 |
+ * Last modification on 2013-04-10 |
|
| 5 | 5 |
* |
| 6 | 6 |
* Nintendo DS Nitro Composer (SDAT) Specification document found at |
| 7 | 7 |
* http://www.feshrine.net/hacking/doc/nds-sdat.html |
| ... | ... |
@@ -21,6 +21,7 @@ struct SWAV |
| 21 | 21 |
uint32_t loopOffset; |
| 22 | 22 |
uint32_t nonLoopLength; |
| 23 | 23 |
std::vector<int16_t> data; |
| 24 |
+ const int16_t *dataptr; |
|
| 24 | 25 |
|
| 25 | 26 |
SWAV(); |
| 26 | 27 |
|
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,31 @@ |
| 1 |
+/* |
|
| 2 |
+ * SSEQ Player - SDAT SWAV (Waveform/Sample) structure |
|
| 3 |
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
|
| 4 |
+ * Last modification on 2013-03-21 |
|
| 5 |
+ * |
|
| 6 |
+ * Nintendo DS Nitro Composer (SDAT) Specification document found at |
|
| 7 |
+ * http://www.feshrine.net/hacking/doc/nds-sdat.html |
|
| 8 |
+ */ |
|
| 9 |
+ |
|
| 10 |
+#ifndef SSEQPLAYER_SWAV_H |
|
| 11 |
+#define SSEQPLAYER_SWAV_H |
|
| 12 |
+ |
|
| 13 |
+#include "common.h" |
|
| 14 |
+ |
|
| 15 |
+struct SWAV |
|
| 16 |
+{
|
|
| 17 |
+ uint8_t waveType; |
|
| 18 |
+ uint8_t loop; |
|
| 19 |
+ uint16_t sampleRate; |
|
| 20 |
+ uint16_t time; |
|
| 21 |
+ uint32_t loopOffset; |
|
| 22 |
+ uint32_t nonLoopLength; |
|
| 23 |
+ std::vector<int16_t> data; |
|
| 24 |
+ |
|
| 25 |
+ SWAV(); |
|
| 26 |
+ |
|
| 27 |
+ void Read(PseudoFile &file); |
|
| 28 |
+ void DecodeADPCM(const std::vector<uint8_t> &data); |
|
| 29 |
+}; |
|
| 30 |
+ |
|
| 31 |
+#endif |