summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2015-07-26 16:08:30 +1000
committerDamien Zammit <damien@zamaudio.com>2015-07-26 16:08:30 +1000
commit2a18c741e8c85612108e73b4e19ca487ff7ed04d (patch)
treee393b1f22686799711df86dea1dfa8570ddb4b05
parentb200d086ed3e7e50fae6109579e39d14af2d07cc (diff)
Fixed ordering of offsets and labelling
Signed-off-by: Damien Zammit <damien@zamaudio.com>
-rw-r--r--ptfformat.cc22
-rw-r--r--ptfformat.h4
-rw-r--r--ptftool.cc8
3 files changed, 20 insertions, 14 deletions
diff --git a/ptfformat.cc b/ptfformat.cc
index c0651ae..2818e0b 100644
--- a/ptfformat.cc
+++ b/ptfformat.cc
@@ -314,10 +314,16 @@ PTFFormat::parse(void) {
}
std::string filename = string(name) + ".wav";
files_t f = {
- filename,
- (int64_t)sampleoffset,
- (int64_t)start,
- (int64_t)length
+ filename,
+ (int64_t)sampleoffset,
+ (int64_t)start,
+ (int64_t)length
+ };
+ files_t r = {
+ name,
+ (int64_t)sampleoffset,
+ (int64_t)length,
+ (int64_t)start,
};
vector<files_t>::iterator begin = this->actualwavs.begin();
vector<files_t>::iterator finish = this->actualwavs.end();
@@ -325,7 +331,7 @@ PTFFormat::parse(void) {
if (std::find(begin, finish, f) != finish) {
this->audiofiles.push_back(f);
} else {
- this->othertracks.push_back(f);
+ this->regions.push_back(r);
}
}
}
@@ -338,11 +344,11 @@ PTFFormat::parse(void) {
}
k++;
}
- // Number of other tracks
+ // Regions
uint32_t offset;
for (vector<files_t>::iterator of =
- this->othertracks.begin();
- of != this->othertracks.end();) {
+ this->regions.begin();
+ of != this->regions.end();) {
if ( (ptfunxored[k ] == 0x5a) &&
(ptfunxored[k+1] == 0x07)) {
diff --git a/ptfformat.h b/ptfformat.h
index e8c340d..a451296 100644
--- a/ptfformat.h
+++ b/ptfformat.h
@@ -934,11 +934,11 @@ public:
std::vector<files_t> audiofiles;
- std::vector<files_t> othertracks;
- std::vector<files_t> actualwavs;
+ std::vector<files_t> regions;
private:
void parse(void);
+ std::vector<files_t> actualwavs;
unsigned char *ptfunxored;
unsigned char c0;
unsigned char c1;
diff --git a/ptftool.cc b/ptftool.cc
index be10a22..0d5f46f 100644
--- a/ptftool.cc
+++ b/ptftool.cc
@@ -35,7 +35,7 @@ int main (int argc, char **argv) {
break;
case 0:
if (ptf.audiofiles.size() > 0) {
- printf("Audio file recorded @ offset:\n");
+ printf("Audio file recorded @ offset, length:\n");
for (vector<PTFFormat::files_t>::iterator
a = ptf.audiofiles.begin();
a != ptf.audiofiles.end(); ++a) {
@@ -43,10 +43,10 @@ int main (int argc, char **argv) {
printf("%s @ %lu, len=%lu\n", a->filename.c_str(),
a->posabsolute, a->length);
}
- printf("\nRegion @ absolute + inter-sample, length:\n");
+ printf("\nRegion @ absolute + into-sample, length:\n");
for (vector<PTFFormat::files_t>::iterator
- a = ptf.othertracks.begin();
- a != ptf.othertracks.end(); ++a) {
+ a = ptf.regions.begin();
+ a != ptf.regions.end(); ++a) {
//printf("%s @ 0x%08x + 0x%08x, len=0x%08x\n", a->filename.c_str(),
printf("%s @ %lu + %lu, len=%lu\n", a->filename.c_str(),
a->posabsolute, a->sampleoffset, a->length);