Mercurial > hg > piper-cpp
changeset 21:dff96610ac05
A couple more conversions
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 20 May 2016 14:37:28 +0100 |
parents | 7ca64f74add2 |
children | b0fc4eb51547 |
files | utilities/json-to-capnp.cpp |
diffstat | 1 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/utilities/json-to-capnp.cpp Fri May 20 11:08:53 2016 +0100 +++ b/utilities/json-to-capnp.cpp Fri May 20 14:37:28 2016 +0100 @@ -47,7 +47,7 @@ virtual Vamp::Plugin *handleToPlugin(int32_t h) { m_handle = h; - m_plugin = reinterpret_cast<Vamp::Plugin *>(1); + m_plugin = reinterpret_cast<Vamp::Plugin *>(h); return m_plugin; } @@ -69,14 +69,15 @@ throw VampJson::Failure("can't convert Basic block on its own"); } else if (type == "configurationrequest") { - auto req = message.initRoot<ConfigurationRequest>(); PreservingPluginHandleMapper mapper; VampnProto::buildConfigurationRequest (req, VampJson::toConfigurationRequest(payload, mapper), mapper); } else if (type == "configurationresponse") { - throw VampJson::Failure("not implemented yet"); ///!!! + auto resp = message.initRoot<ConfigurationResponse>(); + VampnProto::buildConfigurationResponse + (resp, VampJson::toConfigurationResponse(payload)); } else if (type == "feature") { auto f = message.initRoot<Feature>(); @@ -94,10 +95,10 @@ (req, VampJson::toLoadRequest(payload)); } else if (type == "loadresponse") { - //!!! response types & configure call for plugin handles, but - //!!! we don't have any context in which a plugin handle can - //!!! be persistent here - throw VampJson::Failure("not implemented yet"); ///!!! + auto resp = message.initRoot<LoadResponse>(); + PreservingPluginHandleMapper mapper; + VampnProto::buildLoadResponse + (resp, VampJson::toLoadResponse(payload, mapper), mapper); } else if (type == "outputdescriptor") { auto od = message.initRoot<OutputDescriptor>();