fix Preference checkbox sensitivity for inline displays
[ardour.git] / libs / ptformat / ptfformat.h
index be7076dbfda7d274209c773f9fb945e849a2bf93..785544daa054e53ff851b4c0e6ddcb91c38e016b 100644 (file)
 #define PTFFORMAT_H
 
 #include <string>
+#include <cstring>
 #include <algorithm>
 #include <vector>
 #include <stdint.h>
-
 #include "ptformat/visibility.h"
 
 class LIBPTFORMAT_API PTFFormat {
@@ -32,19 +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) {
+               bool operator <(const struct wav_t& other) const {
+                       return (strcasecmp(this->filename.c_str(),
+                                       other.filename.c_str()) < 0);
+               }
+
+               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;
@@ -108,11 +113,11 @@ public:
        unsigned char c0;
        unsigned char c1;
        unsigned char *ptfunxored;
-       int len;
+       uint64_t len;
 
 private:
        bool foundin(std::string haystack, std::string needle);
-       void parse(void);
+       int parse(void);
        void unxor10(void);
        void setrates(void);
        void parse5header(void);
@@ -125,6 +130,8 @@ private:
        void parserest10(void);
        void parseaudio5(void);
        void parseaudio(void);
+       void resort(std::vector<wav_t>& ws);
+       uint8_t mostfrequent(uint32_t start, uint32_t stop);
        std::vector<wav_t> actualwavs;
        float ratefactor;
        std::string extension;