Mercurial > hg > piper-cpp
comparison utilities/json-cli.cpp @ 16:913fc1d3710a
Create process request in JSON version, plus a fix
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 18 May 2016 14:38:27 +0100 |
parents | 828930f9a65d |
children | 533ca5ca3404 |
comparison
equal
deleted
inserted
replaced
15:d907576aa299 | 16:913fc1d3710a |
---|---|
75 | 75 |
76 Vamp::HostExt::ConfigurationResponse | 76 Vamp::HostExt::ConfigurationResponse |
77 configurePlugin(Vamp::Plugin *plugin, json11::Json j) { | 77 configurePlugin(Vamp::Plugin *plugin, json11::Json j) { |
78 | 78 |
79 auto config = VampJson::toPluginConfiguration(j); | 79 auto config = VampJson::toPluginConfiguration(j); |
80 Vamp::HostExt::ConfigurationRequest req; | |
81 req.plugin = plugin; | |
82 req.configuration = config; | |
80 auto loader = Vamp::HostExt::PluginLoader::getInstance(); | 83 auto loader = Vamp::HostExt::PluginLoader::getInstance(); |
81 auto outputs = loader->configurePlugin(plugin, config); | 84 |
82 | 85 auto response = loader->configurePlugin(req); |
83 if (outputs.empty()) { | 86 if (response.outputs.empty()) { |
84 throw VampJson::Failure("plugin initialisation failed (invalid channelCount, stepSize, blockSize?)"); | 87 throw VampJson::Failure("plugin initialisation failed (invalid channelCount, stepSize, blockSize?)"); |
85 } | 88 } |
86 | |
87 Vamp::HostExt::ConfigurationResponse response; | |
88 response.outputs = outputs; | |
89 return response; | 89 return response; |
90 } | 90 } |
91 | 91 |
92 Json | 92 Json |
93 handle_list(Json content) | 93 handle_list(Json content) |