Mercurial > hg > piper-cpp
diff vamp-client/client.cpp @ 95:b6ac26b72b59
Implement list, use request-response classes in loader
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 13 Oct 2016 14:31:10 +0100 |
parents | a660dca988f8 |
children | 215c9fb6b7a4 |
line wrap: on
line diff
--- a/vamp-client/client.cpp Thu Oct 13 14:10:55 2016 +0100 +++ b/vamp-client/client.cpp Thu Oct 13 14:31:10 2016 +0100 @@ -12,7 +12,19 @@ piper::vampclient::ProcessQtTransport transport("../bin/piper-vamp-server"); piper::vampclient::CapnpClient client(&transport); - Vamp::Plugin *plugin = client.load("vamp-example-plugins:zerocrossing", 16, 0); + Vamp::HostExt::ListResponse lr = client.listPluginData(); + cerr << "Plugins available:" << endl; + int i = 1; + for (const auto &p: lr.available) { + cerr << i++ << ". [" << p.pluginKey << "] " << p.basic.name << endl; + } + + Vamp::HostExt::LoadRequest req; + req.pluginKey = "vamp-example-plugins:zerocrossing"; + req.inputSampleRate = 16; + Vamp::HostExt::LoadResponse resp = client.loadPlugin(req); + Vamp::Plugin *plugin = resp.plugin; + if (!plugin->initialise(1, 4, 4)) { cerr << "initialisation failed" << endl; } else {