2 Copyright (C) 2015 Damien Zammit
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
28 /* Return values: 0 success
29 -1 could not open file as ptf
31 int load(std::string path, int64_t targetsr);
40 bool operator ==(const struct wav& other) {
41 return (this->index == other.index);
46 typedef struct region {
54 bool operator ==(const struct region& other) {
55 return (this->index == other.index);
59 typedef struct track {
65 bool operator ==(const struct track& other) {
66 return (this->index == other.index);
70 std::vector<wav_t> audiofiles;
71 std::vector<region_t> regions;
72 std::vector<track_t> tracks;
74 static bool trackexistsin(std::vector<track_t> tr, uint16_t index) {
75 std::vector<track_t>::iterator begin = tr.begin();
76 std::vector<track_t>::iterator finish = tr.end();
77 std::vector<track_t>::iterator found;
79 track_t f = { std::string(""), index };
81 if ((found = std::find(begin, finish, f)) != finish) {
87 static bool regionexistsin(std::vector<region_t> reg, uint16_t index) {
88 std::vector<region_t>::iterator begin = reg.begin();
89 std::vector<region_t>::iterator finish = reg.end();
90 std::vector<region_t>::iterator found;
92 region_t r = { std::string(""), index };
94 if ((found = std::find(begin, finish, r)) != finish) {
100 static bool wavexistsin(std::vector<wav_t> wv, uint16_t index) {
101 std::vector<wav_t>::iterator begin = wv.begin();
102 std::vector<wav_t>::iterator finish = wv.end();
103 std::vector<wav_t>::iterator found;
105 wav_t w = { std::string(""), index };
107 if ((found = std::find(begin, finish, w)) != finish) {
119 unsigned char *ptfunxored;
123 bool foundin(std::string haystack, std::string needle);
126 void parse8header(void);
127 void parse9header(void);
128 void parserest(void);
129 std::vector<wav_t> actualwavs;