Mercurial > hg > piper-cpp
comparison vamp-support/LoaderRequests.h @ 127:5b113c87b6e6
Add and implement the "from" param for list request. The simple-server implementation is not yet correct.
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 02 Nov 2016 14:27:42 +0000 |
parents | 247d8d533a9c |
children | 3dcf0394971d |
comparison
equal
deleted
inserted
replaced
126:2004ec2b653e | 127:5b113c87b6e6 |
---|---|
49 | 49 |
50 class LoaderRequests | 50 class LoaderRequests |
51 { | 51 { |
52 public: | 52 public: |
53 ListResponse | 53 ListResponse |
54 listPluginData() { | 54 listPluginData(ListRequest req) { |
55 | 55 |
56 auto loader = Vamp::HostExt::PluginLoader::getInstance(); | 56 auto loader = Vamp::HostExt::PluginLoader::getInstance(); |
57 auto keys = loader->listPlugins(); | 57 |
58 std::vector<std::string> keys; | |
59 if (req.from.empty()) { | |
60 keys = loader->listPlugins(); | |
61 } else { | |
62 keys = loader->listPluginsIn(req.from); | |
63 } | |
64 | |
58 ListResponse response; | 65 ListResponse response; |
59 | |
60 for (std::string key: keys) { | 66 for (std::string key: keys) { |
61 Vamp::Plugin *p = loader->loadPlugin(key, 44100, 0); | 67 Vamp::Plugin *p = loader->loadPlugin(key, 44100, 0); |
62 if (!p) continue; | 68 if (!p) continue; |
63 auto category = loader->getPluginCategory(key); | 69 auto category = loader->getPluginCategory(key); |
64 response.available.push_back | 70 response.available.push_back |