diff options
author | Damien Zammit <damien@zamaudio.com> | 2015-08-06 19:09:46 +1000 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2015-08-06 19:09:46 +1000 |
commit | a8b3243ad12f0842cf1316a5899f7b20b4a06a84 (patch) | |
tree | 5918b3f494af3522b65606655b516f7264dbfb4e | |
parent | 573192663cb7d320c5a80274b7ca83af3f3b18c7 (diff) |
Added AIFF support to parser
Signed-off-by: Damien Zammit <damien@zamaudio.com>
-rw-r--r-- | ptfformat.cc | 15 | ||||
-rw-r--r-- | ptfformat.h | 1 |
2 files changed, 11 insertions, 5 deletions
diff --git a/ptfformat.cc b/ptfformat.cc index 42bb3f1..adb4ca6 100644 --- a/ptfformat.cc +++ b/ptfformat.cc @@ -348,10 +348,10 @@ PTFFormat::parserest(void) { uint16_t numberofwavs; char wavname[256]; for (i = k; i > 4; i--) { - if ( (ptfunxored[i ] == 'W') && - (ptfunxored[i-1] == 'A') && - (ptfunxored[i-2] == 'V') && - (ptfunxored[i-3] == 'E')) { + if ( ((ptfunxored[i ] == 'W') || (ptfunxored[i ] == 'A')) && + ((ptfunxored[i-1] == 'A') || (ptfunxored[i-1] == 'I')) && + ((ptfunxored[i-2] == 'V') || (ptfunxored[i-2] == 'F')) && + ((ptfunxored[i-3] == 'E') || (ptfunxored[i-3] == 'F'))) { j = i-4; l = 0; while (ptfunxored[j] != '\0') { @@ -360,6 +360,11 @@ PTFFormat::parserest(void) { j--; } wavname[l] = 0; + if (ptfunxored[i] == 'W') { + extension = string(".wav"); + } else { + extension = string(".aif"); + } //uint8_t playlist = ptfunxored[j-8]; if (first) { @@ -509,7 +514,7 @@ PTFFormat::parserest(void) { break; } j+=somethingbytes; - std::string filename = string(name) + ".wav"; + std::string filename = string(name) + extension; wav_t f = { filename, 0, diff --git a/ptfformat.h b/ptfformat.h index 394b727..d287778 100644 --- a/ptfformat.h +++ b/ptfformat.h @@ -128,6 +128,7 @@ private: void parserest(void); std::vector<wav_t> actualwavs; float ratefactor; + std::string extension; }; |