global static path to plugin scanner app.

This commit is contained in:
Robin Gareus 2014-02-25 13:06:13 +01:00
parent e1c82dfd85
commit 30de04a58c
3 changed files with 14 additions and 14 deletions

View file

@ -41,6 +41,7 @@ class Plugin;
class LIBARDOUR_API PluginManager : public boost::noncopyable {
public:
static PluginManager& instance();
static std::string scanner_bin_path;
~PluginManager ();

View file

@ -93,6 +93,7 @@ using namespace PBD;
using namespace std;
PluginManager* PluginManager::_instance = 0;
std::string PluginManager::scanner_bin_path = "";
PluginManager&
PluginManager::instance()
@ -114,6 +115,12 @@ PluginManager::PluginManager ()
char* s;
string lrdf_path;
if (!PBD::find_file_in_search_path (
PBD::Searchpath(Glib::build_filename(ARDOUR::ardour_dll_directory(), "fst")),
"ardour-vst-scanner", scanner_bin_path)) {
PBD::warning << "VST scanner app not found.'" << endmsg;
}
load_statuses ();
if ((s = getenv ("LADSPA_RDF_PATH"))){

View file

@ -44,7 +44,7 @@
#ifndef VST_SCANNER_APP
#include "pbd/system_exec.h"
#include "pbd/file_utils.h"
#include "ardour/plugin_manager.h" // scanner_bin_path
#endif
#include "ardour/filesystem_paths.h"
@ -723,23 +723,15 @@ vstfx_get_info (const char* dllpath, int type, enum VSTScanMode mode)
}
#ifndef VST_SCANNER_APP
std::string scanner_bin_path = ARDOUR::PluginManager::scanner_bin_path;
if (mode == VST_SCAN_CACHE_ONLY) {
/* never scan explicitly, use cache only */
return infos;
}
else if (mode == VST_SCAN_USE_APP) {
/* use external scanner app -- TODO resolve path only once use static
* ARDOUR::PluginManager::scanner_bin_path
*/
std::string scanner_bin_path; //= "/home/rgareus/src/git/ardourCairoCanvas/build/libs/fst/ardour-vst-scanner"; // XXX
if (!PBD::find_file_in_search_path (
PBD::Searchpath(Glib::build_filename(ARDOUR::ardour_dll_directory(), "fst")),
"ardour-vst-scanner", scanner_bin_path)) {
PBD::error << "VST scanner app not found.'" << endmsg;
// TODO: fall-through !?
return infos;
}
/* note: these are free()d in the dtor of PBD::SystemExec */
else if (mode == VST_SCAN_USE_APP && scanner_bin_path != "") {
/* use external scanner app */
char **argp= (char**) calloc(3,sizeof(char*));
argp[0] = strdup(scanner_bin_path.c_str());
argp[1] = strdup(dllpath);