diff plugin/LADSPAPluginFactory.cpp @ 186:06ad01f3e553

* Add system-specific LADSPA and DSSI plugin paths (for OS/X and Windows) * Add ability to open more than one audio file at once from the command line * Add plugin input source selection (with some caveats) * Show name of file being decoded in Ogg/mp3 decode progress dialog
author Chris Cannam
date Thu, 12 Oct 2006 14:56:28 +0000
parents 702fc936e6a6
children 4882563bd2b3
line wrap: on
line diff
--- a/plugin/LADSPAPluginFactory.cpp	Wed Oct 11 16:18:51 2006 +0000
+++ b/plugin/LADSPAPluginFactory.cpp	Thu Oct 12 14:56:28 2006 +0000
@@ -528,9 +528,27 @@
     if (cpath) path = cpath;
 
     if (path == "") {
-	path = "/usr/local/lib/ladspa:/usr/lib/ladspa";
+
+        path = DEFAULT_LADSPA_PATH;
+
 	char *home = getenv("HOME");
-	if (home) path = std::string(home) + "/.ladspa:" + path;
+	if (home) {
+            std::string::size_type f;
+            while ((f = path.find("$HOME")) != std::string::npos &&
+                   f < path.length()) {
+                path.replace(f, 5, home);
+            }
+        }
+
+#ifdef _WIN32
+        home = getenv("ProgramFiles");
+        if (!home) home = "C:\\Program Files";
+        std::string::size_type f;
+        while ((f = path.find("%ProgramFiles%")) != std::string::npos &&
+               f < path.length()) {
+            path.replace(f, 14, pfiles);
+        }
+#endif
     }
 
     std::string::size_type index = 0, newindex = 0;