X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fptformat%2Fptfformat.h;h=3a702aa10bd257246f1fd21475c2c8d217861252;hb=5eacf424b6cd5d68e1d5d25e587a46ea7df905ce;hp=8b2f58de73845046abe0ac7ca9b6f66c77715229;hpb=48532baaa7eeda99e9b5ea880f52308570dc3181;p=ardour.git diff --git a/libs/ptformat/ptfformat.h b/libs/ptformat/ptfformat.h index 8b2f58de73..3a702aa10b 100644 --- a/libs/ptformat/ptfformat.h +++ b/libs/ptformat/ptfformat.h @@ -32,24 +32,24 @@ public: */ int load(std::string path, int64_t targetsr); - typedef struct wav { + struct wav_t { std::string filename; uint16_t index; int64_t posabsolute; int64_t length; - bool operator <(const struct wav& other) const { + bool operator <(const struct wav_t& other) const { return (strcasecmp(this->filename.c_str(), other.filename.c_str()) < 0); } - bool operator ==(const struct wav& other) const { + bool operator ==(const struct wav_t& other) const { return (this->filename == other.filename || this->index == other.index); } - } wav_t; + }; typedef struct region { std::string name; @@ -65,25 +65,6 @@ public: } region_t; typedef struct track { - track () - : index (0) - , playlist (0) - { - memset ((void*)®, 0, sizeof(region_t)); - } - - track (std::string n, uint16_t i, uint8_t p, region_t *r) - : name (n) - , index (i) - , playlist (p) - { - set_region (r); - } - - void set_region (region_t *r) { - memcpy ((void*)®, (void*)r, sizeof(region_t)); - } - std::string name; uint16_t index; uint8_t playlist; @@ -136,8 +117,9 @@ public: private: bool foundin(std::string haystack, std::string needle); - void parse(void); + int parse(void); void unxor10(void); + void unxor_ptx_to_ptf(void); void setrates(void); void parse5header(void); void parse7header(void); @@ -149,7 +131,7 @@ private: void parserest10(void); void parseaudio5(void); void parseaudio(void); - void resort(std::vector *ws); + void resort(std::vector& ws); uint8_t mostfrequent(uint32_t start, uint32_t stop); std::vector actualwavs; float ratefactor;