comparison src/MatchVampPlugin.cpp @ 63:a540137d393b refactors_no_float

Fix handling of empty queues -- we should continue processing when a queue is empty only if we've reached end of file on both
author Chris Cannam
date Tue, 18 Nov 2014 10:03:36 +0000
parents 8cce4e13ede3
children da9ead46abe9
comparison
equal deleted inserted replaced
60:faa523be20f9 63:a540137d393b
503 } 503 }
504 504
505 MatchVampPlugin::FeatureSet 505 MatchVampPlugin::FeatureSet
506 MatchVampPlugin::getRemainingFeatures() 506 MatchVampPlugin::getRemainingFeatures()
507 { 507 {
508 FeatureSet returnFeatures;
509
510 MatchFeeder::Features ff = feeder->finishAndGetFeatures();
511
512 Feature f;
513 f.hasTimestamp = false;
514
515 for (int i = 0; i < (int)ff.f1.size(); ++i) {
516 f.values.clear();
517 for (int j = 0; j < (int)ff.f1[i].size(); ++j) {
518 f.values.push_back(float(ff.f1[i][j]));
519 }
520 returnFeatures[m_aFeaturesOutNo].push_back(f);
521 }
522
523 for (int i = 0; i < (int)ff.f2.size(); ++i) {
524 f.values.clear();
525 for (int j = 0; j < (int)ff.f2[i].size(); ++j) {
526 f.values.push_back(float(ff.f2[i][j]));
527 }
528 returnFeatures[m_bFeaturesOutNo].push_back(f);
529 }
530
508 Finder *finder = feeder->getFinder(); 531 Finder *finder = feeder->getFinder();
509 std::vector<int> pathx; 532 std::vector<int> pathx;
510 std::vector<int> pathy; 533 std::vector<int> pathy;
511 int len = finder->retrievePath(m_smooth, pathx, pathy); 534 int len = finder->retrievePath(m_smooth, pathx, pathy);
512
513 FeatureSet returnFeatures;
514 535
515 int prevx = 0; 536 int prevx = 0;
516 int prevy = 0; 537 int prevy = 0;
517 538
518 for (int i = 0; i < len; ++i) { 539 for (int i = 0; i < len; ++i) {