diff plugin/DSSIPluginFactory.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 665342c6ec57
children e08cb0158e81
line wrap: on
line diff
--- a/plugin/DSSIPluginFactory.cpp	Wed Oct 11 16:18:51 2006 +0000
+++ b/plugin/DSSIPluginFactory.cpp	Thu Oct 12 14:56:28 2006 +0000
@@ -204,12 +204,27 @@
     if (cpath) path = cpath;
 
     if (path == "") {
-	path = "/usr/local/lib/dssi:/usr/lib/dssi";
+
+        path = DEFAULT_DSSI_PATH;
+
 	char *home = getenv("HOME");
 	if (home) {
-            path = std::string(home) + "/dssi:" +
-                   std::string(home) + "/.dssi:" + path;
+            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;