changeset 241:fdab0a246298

Report and fail if no plugins found (i.e. wrong library name, usually)
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 13 Jun 2017 16:24:24 +0100
parents d00199f3b010
children d607ae858682
files vamp-stubber/stubber.cpp
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/vamp-stubber/stubber.cpp	Tue Jun 13 16:07:58 2017 +0100
+++ b/vamp-stubber/stubber.cpp	Tue Jun 13 16:24:24 2017 +0100
@@ -322,7 +322,13 @@
     }
     
     string libname = arg;
-
+    
+    auto li = libname.rfind('.');
+    if (li != std::string::npos) {
+        cerr << "NOTE: library name is to be specified without extension, dropping \"" << libname.substr(li) << "\"" << endl;
+        libname = libname.substr(0, li);
+    }
+    
     try {            
         initFds(false);
     } catch (exception &e) {
@@ -336,6 +342,16 @@
 
     resumeOutput();
 
+    if (resp.available.empty()) {
+        cerr << "ERROR: No plugin(s) found in library named \""
+             << libname << "\"\nCheck that the library name is correct and the right files are in $VAMP_PATH.\nThat would mean either "
+             << libname << ".so, " << libname << ".dll, or " << libname
+             << ".dylib (depending on your platform), as well as "
+             << libname << ".n3 and " << libname << ".cat."
+             << endl;
+        exit(1);
+    }
+    
     emitFor(libname, resp);
     
     exit(0);