summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-12-11 00:18:14 +0000
committerTim E. Real <termtech@rogers.com>2012-12-11 00:18:14 +0000
commit809a67cf14ff73aa08a77cfb8fb88ec0d909049f (patch)
tree52e923222ddafd76d29f477fb0ac82d588f78953 /muse2/muse
parent5d45a0a6a4d44bb83098641d2595daec686b5a65 (diff)
Fix native vst path (VST_NATIVE_PATH, VST_PATH, then preset).
Also ladspa, dssi paths. Added -help text.
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/dssihost.cpp9
-rw-r--r--muse2/muse/main.cpp16
-rw-r--r--muse2/muse/plugin.cpp14
-rw-r--r--muse2/muse/vst_native.cpp38
4 files changed, 69 insertions, 8 deletions
diff --git a/muse2/muse/dssihost.cpp b/muse2/muse/dssihost.cpp
index f62d1434..8e49b368 100644
--- a/muse2/muse/dssihost.cpp
+++ b/muse2/muse/dssihost.cpp
@@ -32,6 +32,7 @@
// Support vst state saving/loading with vst chunks.
//#define DSSI_VST_CHUNK_SUPPORT
+#include <string>
#include <string.h>
#include <signal.h>
#include <dlfcn.h>
@@ -187,10 +188,14 @@ static void scanDSSIDir(const QString& s)
void initDSSI()
{
+ std::string s;
const char* dssiPath = getenv("DSSI_PATH");
if (dssiPath == 0)
- dssiPath = "/usr/local/lib64/dssi:/usr/lib64/dssi:/usr/local/lib/dssi:/usr/lib/dssi";
-
+ {
+ const char* home = getenv("HOME");
+ s = std::string(home) + std::string("/dssi:/usr/local/lib64/dssi:/usr/lib64/dssi:/usr/local/lib/dssi:/usr/lib/dssi");
+ dssiPath = s.c_str();
+ }
const char* p = dssiPath;
while (*p != '\0') {
const char* pe = p;
diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp
index e233a28e..644fe65d 100644
--- a/muse2/muse/main.cpp
+++ b/muse2/muse/main.cpp
@@ -277,6 +277,22 @@ static void usage(const char* prog, const char* txt)
" -graphicssystem Set backend used for on-screen widgets/QPixmaps: raster or opengl\n"
" -qmljsdebugger = port Activate QML/JS debugger with port, formatted port:1234[,block]\n"
);
+
+ fprintf(stderr, "\n");
+
+ fprintf(stderr, "Some useful environment variables:\n");
+ fprintf(stderr, " LADSPA_PATH: Override where to look for ladspa plugins, or else\n"
+ " ~/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa\n\n");
+#ifdef DSSI_SUPPORT
+ fprintf(stderr, " DSSI_PATH: Override where to look for dssi plugins (dssi-vst plugins: VST_PATH), or else\n"
+ " ~/dssi:/usr/local/lib64/dssi:/usr/lib64/dssi:/usr/local/lib/dssi:/usr/lib/dssi\n\n" );
+#endif
+#ifdef VST_NATIVE_SUPPORT
+ fprintf(stderr, " VST_NATIVE_PATH: Override where to look for native vst plugins, or else VST_PATH, or else\n"
+ " ~/vst:/usr/local/lib64/vst:/usr/local/lib/vst:/usr/lib64/vst:/usr/lib/vst\n\n");
+#endif
+
+ fprintf(stderr, " LANG: Help browser language suffix (en etc.)\n");
fprintf(stderr, "\n");
}
diff --git a/muse2/muse/plugin.cpp b/muse2/muse/plugin.cpp
index 0ca7524c..203aac63 100644
--- a/muse2/muse/plugin.cpp
+++ b/muse2/muse/plugin.cpp
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <dlfcn.h>
#include <cmath>
+#include <string>
#include <math.h>
#include <sys/stat.h>
@@ -1076,13 +1077,18 @@ void initPlugins()
{
loadPluginDir(MusEGlobal::museGlobalLib + QString("/plugins"));
+ std::string s;
const char* p = 0;
// Take care of DSSI plugins first...
#ifdef DSSI_SUPPORT
const char* dssiPath = getenv("DSSI_PATH");
if (dssiPath == 0)
- dssiPath = "/usr/local/lib64/dssi:/usr/lib64/dssi:/usr/local/lib/dssi:/usr/lib/dssi";
+ {
+ const char* home = getenv("HOME");
+ s = std::string(home) + std::string("/dssi:/usr/local/lib64/dssi:/usr/lib64/dssi:/usr/local/lib/dssi:/usr/lib/dssi");
+ dssiPath = s.c_str();
+ }
p = dssiPath;
while (*p != '\0') {
const char* pe = p;
@@ -1106,7 +1112,11 @@ void initPlugins()
// Now do LADSPA plugins...
const char* ladspaPath = getenv("LADSPA_PATH");
if (ladspaPath == 0)
- ladspaPath = "/usr/local/lib64/ladspa:/usr/lib64/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa";
+ {
+ const char* home = getenv("HOME");
+ s = std::string(home) + std::string("/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa");
+ ladspaPath = s.c_str();
+ }
p = ladspaPath;
if(MusEGlobal::debugMsg)
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;