comparison host/vamp-simple-host.cpp @ 460:b409560a805b

Merge from branch vampipe
author Chris Cannam
date Mon, 10 Oct 2016 15:48:35 +0100
parents 22b29720da41
children
comparison
equal deleted inserted replaced
442:4101e3f80aa0 460:b409560a805b
506 void 506 void
507 printFeatures(int frame, int sr, 507 printFeatures(int frame, int sr,
508 const Plugin::OutputDescriptor &output, int outputNo, 508 const Plugin::OutputDescriptor &output, int outputNo,
509 const Plugin::FeatureSet &features, ofstream *out, bool useFrames) 509 const Plugin::FeatureSet &features, ofstream *out, bool useFrames)
510 { 510 {
511 static int featureCount = 0; 511 static int featureCount = -1;
512 512
513 if (features.find(outputNo) == features.end()) return; 513 if (features.find(outputNo) == features.end()) return;
514 514
515 for (size_t i = 0; i < features.at(outputNo).size(); ++i) { 515 for (size_t i = 0; i < features.at(outputNo).size(); ++i) {
516 516
521 521
522 if (output.sampleType == Plugin::OutputDescriptor::VariableSampleRate) { 522 if (output.sampleType == Plugin::OutputDescriptor::VariableSampleRate) {
523 rt = f.timestamp; 523 rt = f.timestamp;
524 haveRt = true; 524 haveRt = true;
525 } else if (output.sampleType == Plugin::OutputDescriptor::FixedSampleRate) { 525 } else if (output.sampleType == Plugin::OutputDescriptor::FixedSampleRate) {
526 int n = featureCount; 526 int n = featureCount + 1;
527 if (f.hasTimestamp) { 527 if (f.hasTimestamp) {
528 n = int(round(toSeconds(f.timestamp) * output.sampleRate)); 528 n = int(round(toSeconds(f.timestamp) * output.sampleRate));
529 } 529 }
530 rt = RealTime::fromSeconds(double(n) / output.sampleRate); 530 rt = RealTime::fromSeconds(double(n) / output.sampleRate);
531 haveRt = true; 531 haveRt = true;
532 featureCount = n;
532 } 533 }
533 534
534 if (useFrames) { 535 if (useFrames) {
535 536
536 int displayFrame = frame; 537 int displayFrame = frame;
568 (out ? *out : cout) << " " << f.values[j]; 569 (out ? *out : cout) << " " << f.values[j];
569 } 570 }
570 (out ? *out : cout) << " " << f.label; 571 (out ? *out : cout) << " " << f.label;
571 572
572 (out ? *out : cout) << endl; 573 (out ? *out : cout) << endl;
573
574 ++featureCount;
575 } 574 }
576 } 575 }
577 576
578 void 577 void
579 printPluginPath(bool verbose) 578 printPluginPath(bool verbose)