comparison vamp-support/LoaderRequests.h @ 134:3dcf0394971d

Debug output improvements, and make the checker actually attempt to call the descriptor function for known plugin types
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 16 Nov 2016 16:12:42 +0000
parents 5b113c87b6e6
children bf8e3e7dd7de
comparison
equal deleted inserted replaced
133:74a7c2a8d6b6 134:3dcf0394971d
42 42
43 #include <vamp-hostsdk/PluginLoader.h> 43 #include <vamp-hostsdk/PluginLoader.h>
44 44
45 #include <map> 45 #include <map>
46 #include <string> 46 #include <string>
47 #include <iostream>
47 48
48 namespace piper_vamp { 49 namespace piper_vamp {
49 50
50 class LoaderRequests 51 class LoaderRequests
51 { 52 {
52 public: 53 public:
53 ListResponse 54 ListResponse
54 listPluginData(ListRequest req) { 55 listPluginData(ListRequest req) {
55 56
56 auto loader = Vamp::HostExt::PluginLoader::getInstance(); 57 auto loader = Vamp::HostExt::PluginLoader::getInstance();
58
59 std::cerr << "listPluginData: about to ask loader to list plugins" << std::endl;
57 60
58 std::vector<std::string> keys; 61 std::vector<std::string> keys;
59 if (req.from.empty()) { 62 if (req.from.empty()) {
60 keys = loader->listPlugins(); 63 keys = loader->listPlugins();
61 } else { 64 } else {
62 keys = loader->listPluginsIn(req.from); 65 keys = loader->listPluginsIn(req.from);
63 } 66 }
64 67
68 std::cerr << "listPluginData: loader listed " << keys.size() << " plugins" << std::endl;
69
65 ListResponse response; 70 ListResponse response;
66 for (std::string key: keys) { 71 for (std::string key: keys) {
72 std::cerr << "listPluginData: loading plugin and querying static data: " << key << std::endl;
67 Vamp::Plugin *p = loader->loadPlugin(key, 44100, 0); 73 Vamp::Plugin *p = loader->loadPlugin(key, 44100, 0);
68 if (!p) continue; 74 if (!p) continue;
69 auto category = loader->getPluginCategory(key); 75 auto category = loader->getPluginCategory(key);
70 response.available.push_back 76 response.available.push_back
71 (PluginStaticData::fromPlugin(key, category, p)); 77 (PluginStaticData::fromPlugin(key, category, p));