Mercurial > hg > vamp-plugin-sdk
comparison src/vamp-hostsdk/PluginLoader.cpp @ 295:0e08ebd5c13b
* More error reporting fixes
author | cannam |
---|---|
date | Tue, 22 Sep 2009 11:23:23 +0000 |
parents | a331172e11ba |
children | 9648ba9812d6 |
comparison
equal
deleted
inserted
replaced
294:3f14a3891817 | 295:0e08ebd5c13b |
---|---|
278 continue; | 278 continue; |
279 } | 279 } |
280 | 280 |
281 int index = 0; | 281 int index = 0; |
282 const VampPluginDescriptor *descriptor = 0; | 282 const VampPluginDescriptor *descriptor = 0; |
283 bool found = false; | |
283 | 284 |
284 while ((descriptor = fn(VAMP_API_VERSION, index))) { | 285 while ((descriptor = fn(VAMP_API_VERSION, index))) { |
285 ++index; | 286 ++index; |
286 if (identifier != "") { | 287 if (identifier != "") { |
287 if (descriptor->identifier != identifier) continue; | 288 if (descriptor->identifier != identifier) continue; |
288 } | 289 } |
290 found = true; | |
289 PluginKey key = composePluginKey(*fi, descriptor->identifier); | 291 PluginKey key = composePluginKey(*fi, descriptor->identifier); |
290 // std::cerr << "enumerate: " << key << " (path: " << fullPath << ")" << std::endl; | 292 // std::cerr << "enumerate: " << key << " (path: " << fullPath << ")" << std::endl; |
291 if (m_pluginLibraryNameMap.find(key) == | 293 if (m_pluginLibraryNameMap.find(key) == |
292 m_pluginLibraryNameMap.end()) { | 294 m_pluginLibraryNameMap.end()) { |
293 m_pluginLibraryNameMap[key] = fullPath; | 295 m_pluginLibraryNameMap[key] = fullPath; |
294 } | 296 } |
295 } | 297 } |
298 | |
299 if (!found && forPlugin != "") { | |
300 cerr << "Vamp::HostExt::PluginLoader: Plugin \"" | |
301 << identifier << "\" not found in library \"" | |
302 << fullPath << "\"" << endl; | |
303 } | |
296 | 304 |
297 unloadLibrary(handle); | 305 unloadLibrary(handle); |
298 } | 306 } |
299 } | 307 } |
300 | 308 |
368 return 0; | 376 return 0; |
369 } | 377 } |
370 | 378 |
371 string fullPath = getLibraryPathForPlugin(key); | 379 string fullPath = getLibraryPathForPlugin(key); |
372 if (fullPath == "") { | 380 if (fullPath == "") { |
373 std::cerr << "Vamp::HostExt::PluginLoader: No valid \"" | 381 std::cerr << "Vamp::HostExt::PluginLoader: No library found in Vamp path for plugin \"" << key << "\"" << std::endl; |
374 << libname << "." << PLUGIN_SUFFIX | |
375 << "\" found in Vamp path" << std::endl; | |
376 return 0; | 382 return 0; |
377 } | 383 } |
378 | 384 |
379 void *handle = loadLibrary(fullPath); | 385 void *handle = loadLibrary(fullPath); |
380 if (!handle) return 0; | 386 if (!handle) return 0; |