diff vamp-support/PluginConfiguration.h @ 185:3eb00e5c76c4

Pull step & block size out into framing struct, return in config Update the C++ code to separate out the framing parameters (step and block size) from the configuration structure into their own structure, as in the latest schema, and to return the accepted framing params in the configuration response. This also implies that the plugin stub (which adapts Piper API back to Vamp) makes a note of the returned values, making them available via its own getPreferredStep/BlockSize so that the host can retry the initialise call in the case where it failed for having the wrong values first time.
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 03 Feb 2017 16:23:21 +0000
parents 427c4c725085
children ad6025dc0b04
line wrap: on
line diff
--- a/vamp-support/PluginConfiguration.h	Fri Feb 03 13:00:42 2017 +0000
+++ b/vamp-support/PluginConfiguration.h	Fri Feb 03 16:23:21 2017 +0000
@@ -45,6 +45,20 @@
 namespace piper_vamp {
 
 /**
+ * \struct Framing
+ * 
+ * A structure bundling the processing step and block size.
+ */
+struct Framing
+{
+    Framing() : // invalid by default 
+        stepSize(0), blockSize(0) { }
+    
+    int stepSize;
+    int blockSize;
+};
+
+/**
  * \class PluginConfiguration
  * 
  * PluginConfiguration is a structure bundling together data that
@@ -59,11 +73,10 @@
 struct PluginConfiguration
 {
     PluginConfiguration() : // invalid configuration by default
-	channelCount(0), stepSize(0), blockSize(0) { }
+	channelCount(0) { }
 	
     int channelCount;
-    int stepSize;
-    int blockSize;
+    Framing framing;
     typedef std::map<std::string, float> ParameterMap;
     ParameterMap parameterValues;
     std::string currentProgram;
@@ -77,8 +90,8 @@
 	PluginConfiguration c;
 	
 	c.channelCount = channelCount;
-	c.stepSize = stepSize;
-	c.blockSize = blockSize;
+	c.framing.stepSize = stepSize;
+	c.framing.blockSize = blockSize;
 
 	Vamp::PluginBase::ParameterList params = p->getParameterDescriptors();
 	for (Vamp::PluginBase::ParameterList::const_iterator i = params.begin();