diff 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
line wrap: on
line diff
--- a/src/MatchVampPlugin.cpp	Fri Nov 14 13:53:58 2014 +0000
+++ b/src/MatchVampPlugin.cpp	Tue Nov 18 10:03:36 2014 +0000
@@ -505,12 +505,33 @@
 MatchVampPlugin::FeatureSet
 MatchVampPlugin::getRemainingFeatures()
 {
+    FeatureSet returnFeatures;
+    
+    MatchFeeder::Features ff = feeder->finishAndGetFeatures();
+
+    Feature f;
+    f.hasTimestamp = false;
+
+    for (int i = 0; i < (int)ff.f1.size(); ++i) {
+        f.values.clear();
+        for (int j = 0; j < (int)ff.f1[i].size(); ++j) {
+            f.values.push_back(float(ff.f1[i][j]));
+        }
+        returnFeatures[m_aFeaturesOutNo].push_back(f);
+    }
+
+    for (int i = 0; i < (int)ff.f2.size(); ++i) {
+        f.values.clear();
+        for (int j = 0; j < (int)ff.f2[i].size(); ++j) {
+            f.values.push_back(float(ff.f2[i][j]));
+        }
+        returnFeatures[m_bFeaturesOutNo].push_back(f);
+    }
+
     Finder *finder = feeder->getFinder();
     std::vector<int> pathx;
     std::vector<int> pathy;
     int len = finder->retrievePath(m_smooth, pathx, pathy);
-    
-    FeatureSet returnFeatures;
 
     int prevx = 0;
     int prevy = 0;