# HG changeset patch # User Chris Cannam # Date 1474288556 -3600 # Node ID 5c07a86abdddfbb7b1bdb97b9903b5dac9591224 # Parent d6262c77e5a590d0b9f558bbdc04f9a8ab6477fc Make RequestResponse types more consistent by adding plugin to ConfigurationResponse and introducing a FinishRequest diff -r d6262c77e5a5 -r 5c07a86abddd src/vamp-hostsdk/PluginLoader.cpp --- 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)) { diff -r d6262c77e5a5 -r 5c07a86abddd vamp-hostsdk/RequestResponse.h --- 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 + * + * 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; +}; + } }