Mercurial > hg > piper-cpp
comparison vamp-support/LoaderRequests.h @ 150:bf8e3e7dd7de
Move some things around, and add overall test script
| author | Chris Cannam <cannam@all-day-breakfast.com> | 
|---|---|
| date | Fri, 20 Jan 2017 17:45:54 +0000 | 
| parents | 3dcf0394971d | 
| children | 3eb00e5c76c4 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 149:70bf40743d6a | 150:bf8e3e7dd7de | 
|---|---|
| 54 ListResponse | 54 ListResponse | 
| 55 listPluginData(ListRequest req) { | 55 listPluginData(ListRequest req) { | 
| 56 | 56 | 
| 57 auto loader = Vamp::HostExt::PluginLoader::getInstance(); | 57 auto loader = Vamp::HostExt::PluginLoader::getInstance(); | 
| 58 | 58 | 
| 59 std::cerr << "listPluginData: about to ask loader to list plugins" << std::endl; | 59 // std::cerr << "listPluginData: about to ask loader to list plugins" << std::endl; | 
| 60 | 60 | 
| 61 std::vector<std::string> keys; | 61 std::vector<std::string> keys; | 
| 62 if (req.from.empty()) { | 62 if (req.from.empty()) { | 
| 63 keys = loader->listPlugins(); | 63 keys = loader->listPlugins(); | 
| 64 } else { | 64 } else { | 
| 65 keys = loader->listPluginsIn(req.from); | 65 keys = loader->listPluginsIn(req.from); | 
| 66 } | 66 } | 
| 67 | 67 | 
| 68 std::cerr << "listPluginData: loader listed " << keys.size() << " plugins" << std::endl; | 68 // std::cerr << "listPluginData: loader listed " << keys.size() << " plugins" << std::endl; | 
| 69 | 69 | 
| 70 ListResponse response; | 70 ListResponse response; | 
| 71 for (std::string key: keys) { | 71 for (std::string key: keys) { | 
| 72 std::cerr << "listPluginData: loading plugin and querying static data: " << key << std::endl; | 72 // std::cerr << "listPluginData: loading plugin and querying static data: " << key << std::endl; | 
| 73 Vamp::Plugin *p = loader->loadPlugin(key, 44100, 0); | 73 Vamp::Plugin *p = loader->loadPlugin(key, 44100, 0); | 
| 74 if (!p) continue; | 74 if (!p) continue; | 
| 75 auto category = loader->getPluginCategory(key); | 75 auto category = loader->getPluginCategory(key); | 
| 76 response.available.push_back | 76 response.available.push_back | 
| 77 (PluginStaticData::fromPlugin(key, category, p)); | 77 (PluginStaticData::fromPlugin(key, category, p)); | 
