diff options
author | Tim E. Real <termtech@rogers.com> | 2012-12-11 00:18:14 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2012-12-11 00:18:14 +0000 |
commit | 809a67cf14ff73aa08a77cfb8fb88ec0d909049f (patch) | |
tree | 52e923222ddafd76d29f477fb0ac82d588f78953 /muse2/muse/vst_native.cpp | |
parent | 5d45a0a6a4d44bb83098641d2595daec686b5a65 (diff) |
Fix native vst path (VST_NATIVE_PATH, VST_PATH, then preset).
Also ladspa, dssi paths. Added -help text.
Diffstat (limited to 'muse2/muse/vst_native.cpp')
-rw-r--r-- | muse2/muse/vst_native.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/muse2/muse/vst_native.cpp b/muse2/muse/vst_native.cpp index 4cfc6113..bc058e9c 100644 --- a/muse2/muse/vst_native.cpp +++ b/muse2/muse/vst_native.cpp @@ -33,6 +33,7 @@ #include <dlfcn.h> #include <cmath> #include <set> +#include <string> #include <jack/jack.h> #include "globals.h" @@ -456,10 +457,39 @@ static void scanVstNativeDir(const QString& s) void initVST_Native() { - const char* vstPath = getenv("VST_NATIVE_PATH"); // FIXME TODO: What's the right path and env var? - if (vstPath == 0) - vstPath = "/usr/lib/vst:/usr/local/lib/vst"; - + std::string s; + const char* vstPath = getenv("VST_NATIVE_PATH"); + if (vstPath) + { + if (MusEGlobal::debugMsg) + fprintf(stderr, "scan native vst: VST_NATIVE_PATH is: %s\n", vstPath); + } + else + { + if (MusEGlobal::debugMsg) + fprintf(stderr, "scan native vst: VST_NATIVE_PATH not set\n"); + } + + if(!vstPath) + { + vstPath = getenv("VST_PATH"); + if (vstPath) + { + if (MusEGlobal::debugMsg) + fprintf(stderr, "scan native vst: VST_PATH is: %s\n", vstPath); + } + else + { + if (MusEGlobal::debugMsg) + fprintf(stderr, "scan native vst: VST_PATH not set\n"); + const char* home = getenv("HOME"); + s = std::string(home) + std::string("/vst:/usr/local/lib64/vst:/usr/local/lib/vst:/usr/lib64/vst:/usr/lib/vst"); + vstPath = s.c_str(); + if (MusEGlobal::debugMsg) + fprintf(stderr, "scan native vst: defaulting to path: %s\n", vstPath); + } + } + const char* p = vstPath; while (*p != '\0') { const char* pe = p; |