changeset 455:5c07a86abddd outputid-string-in-featureset

Make RequestResponse types more consistent by adding plugin to ConfigurationResponse and introducing a FinishRequest
author Chris Cannam
date Mon, 19 Sep 2016 13:35:56 +0100
parents d6262c77e5a5
children 86624d166f88
files src/vamp-hostsdk/PluginLoader.cpp vamp-hostsdk/RequestResponse.h
diffstat 2 files changed, 31 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginLoader.cpp	Fri Sep 16 14:13:21 2016 +0100
+++ b/src/vamp-hostsdk/PluginLoader.cpp	Mon Sep 19 13:35:56 2016 +0100
@@ -469,6 +469,8 @@
 
     ConfigurationResponse response;
 
+    response.plugin = req.plugin;
+    
     if (req.plugin->initialise(req.configuration.channelCount,
                                req.configuration.stepSize,
                                req.configuration.blockSize)) {
--- a/vamp-hostsdk/RequestResponse.h	Fri Sep 16 14:13:21 2016 +0100
+++ b/vamp-hostsdk/RequestResponse.h	Mon Sep 19 13:35:56 2016 +0100
@@ -186,9 +186,10 @@
 struct ConfigurationResponse
 {
 public:
-    ConfigurationResponse() // failed by default
-    { }
+    ConfigurationResponse() : // failed by default
+        plugin(0) { }
 
+    Plugin *plugin;
     Plugin::OutputList outputs;
 };
 
@@ -242,6 +243,32 @@
     Plugin::FeatureSet features;
 };
 
+/**
+ * \class FinishRequest RequestResponse.h <vamp-hostsdk/RequestResponse.h>
+ *
+ * A structure that bundles the necessary data for finishing
+ * processing, i.e. calling getRemainingFeatures(). This consists only
+ * of the plugin pointer. Caller retains ownership of the plugin.
+ *
+ * \see Plugin::getRemainingFeatures()
+ *
+ * \note This class was introduced in version 2.7 of the Vamp plugin
+ * SDK, but it is not currently used by the SDK. It is supplied as a
+ * convenience for code using the SDK, and for symmetry with the load
+ * and configuration request structs.
+ *
+ * \note The response to a finish request (getRemainingFeatures()) is
+ * a ProcessResponse, just as it is for a process request.
+ */
+struct FinishRequest
+{
+public:
+    FinishRequest() : // invalid by default
+        plugin(0) { }
+
+    Plugin *plugin;
+};
+
 }
 
 }