comparison src/vamp-hostsdk/PluginLoader.cpp @ 456:86624d166f88 outputid-string-in-featureset

Introduce ListResponse type as well
author Chris Cannam
date Mon, 19 Sep 2016 14:10:19 +0100
parents 5c07a86abddd
children eb30742e5e43
comparison
equal deleted inserted replaced
455:5c07a86abddd 456:86624d166f88
59 public: 59 public:
60 Impl(); 60 Impl();
61 virtual ~Impl(); 61 virtual ~Impl();
62 62
63 PluginKeyList listPlugins(); 63 PluginKeyList listPlugins();
64 PluginStaticDataList listPluginData(); 64
65 ListResponse listPluginData();
65 66
66 Plugin *loadPlugin(PluginKey key, 67 Plugin *loadPlugin(PluginKey key,
67 float inputSampleRate, 68 float inputSampleRate,
68 int adapterFlags); 69 int adapterFlags);
69 70
147 PluginLoader::listPlugins() 148 PluginLoader::listPlugins()
148 { 149 {
149 return m_impl->listPlugins(); 150 return m_impl->listPlugins();
150 } 151 }
151 152
152 PluginLoader::PluginStaticDataList 153 ListResponse
153 PluginLoader::listPluginData() 154 PluginLoader::listPluginData()
154 { 155 {
155 return m_impl->listPluginData(); 156 return m_impl->listPluginData();
156 } 157 }
157 158
220 } 221 }
221 222
222 return plugins; 223 return plugins;
223 } 224 }
224 225
225 PluginLoader::PluginStaticDataList 226 ListResponse
226 PluginLoader::Impl::listPluginData() 227 PluginLoader::Impl::listPluginData()
227 { 228 {
228 PluginKeyList keys = listPlugins(); 229 PluginKeyList keys = listPlugins();
229 PluginStaticDataList dataList; 230 ListResponse response;
230 231
231 for (PluginKeyList::const_iterator ki = keys.begin(); ki != keys.end(); ++ki) { 232 for (PluginKeyList::const_iterator ki = keys.begin(); ki != keys.end(); ++ki) {
232 string key = *ki; 233 string key = *ki;
233 Plugin *p = loadPlugin(key, 44100, 0); 234 Plugin *p = loadPlugin(key, 44100, 0);
234 if (p) { 235 if (p) {
235 PluginCategoryHierarchy category = getPluginCategory(key); 236 PluginCategoryHierarchy category = getPluginCategory(key);
236 dataList.push_back(PluginStaticData::fromPlugin(key, category, p)); 237 response.pluginData.push_back
238 (PluginStaticData::fromPlugin(key, category, p));
237 } 239 }
238 delete p; 240 delete p;
239 } 241 }
240 242
241 return dataList; 243 return response;
242 } 244 }
243 245
244 void 246 void
245 PluginLoader::Impl::enumeratePlugins(PluginKey forPlugin) 247 PluginLoader::Impl::enumeratePlugins(PluginKey forPlugin)
246 { 248 {