diff options
author | Damien Zammit <damien@zamaudio.com> | 2016-02-02 16:49:12 +1100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-13 09:50:52 +0100 |
commit | 81a9f7a956f3cf3c353f72e6d80e4d7bec0271c7 (patch) | |
tree | 11138665a17f7438a2499f752e6ce1d9ba0f6633 /libs/ptformat/ptfformat.h | |
parent | 255fbe7b5500271537390f94b38ab65337378479 (diff) |
Unjumble the PT5 wav ordering in regions/tracks
by sorting alphanumerically and case insensitively
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Diffstat (limited to 'libs/ptformat/ptfformat.h')
-rw-r--r-- | libs/ptformat/ptfformat.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/ptformat/ptfformat.h b/libs/ptformat/ptfformat.h index be7076dbfd..1d3dac2ba3 100644 --- a/libs/ptformat/ptfformat.h +++ b/libs/ptformat/ptfformat.h @@ -16,10 +16,10 @@ #define PTFFORMAT_H #include <string> +#include <cstring> #include <algorithm> #include <vector> #include <stdint.h> - #include "ptformat/visibility.h" class LIBPTFORMAT_API PTFFormat { @@ -39,6 +39,11 @@ public: int64_t posabsolute; int64_t length; + bool operator <(const struct wav& other) { + return (strcasecmp(this->filename.c_str(), + other.filename.c_str()) < 0); + } + bool operator ==(const struct wav& other) { return (this->filename == other.filename || this->index == other.index); @@ -125,6 +130,7 @@ private: void parserest10(void); void parseaudio5(void); void parseaudio(void); + void resort(std::vector<wav_t> *ws); std::vector<wav_t> actualwavs; float ratefactor; std::string extension; |