diff runner/FeatureExtractionManager.h @ 109:78a7c77ba432

A more general solution (I hope) to the problem of making sure transforms are always run in a consistent order
author Chris Cannam
date Thu, 02 Oct 2014 14:54:09 +0100
parents 8b4924a9a072
children ca565b18ba3e
line wrap: on
line diff
--- a/runner/FeatureExtractionManager.h	Thu Oct 02 14:31:47 2014 +0100
+++ b/runner/FeatureExtractionManager.h	Thu Oct 02 14:54:09 2014 +0100
@@ -79,6 +79,16 @@
     typedef map<Vamp::Plugin *, TransformWriterMap> PluginMap;
     PluginMap m_plugins;
 
+    // When we run plugins, we want to run them in a known order so as
+    // to get the same results on each run of Sonic Annotator with the
+    // same transforms. But if we just iterate through our PluginMap,
+    // we get them in an arbitrary order based on pointer
+    // address. This vector provides an underlying order for us. Note
+    // that the TransformWriterMap is consistently ordered (because
+    // the key is a Transform which has a proper ordering) so using
+    // this gives us a consistent order across the whole PluginMap
+    vector<Vamp::Plugin *> m_orderedPlugins;
+
     // And a map back from transforms to their plugins.  Note that
     // this is keyed by transform, not transform ID -- two differently
     // configured transforms with the same ID must use different