major rationalization of use of search paths. ardour now has just 4 functions used...
[ardour.git] / libs / ardour / control_protocol_search_path.cc
index c7c9b635a38fad610e58617ac6e1eb1ee5219fc0..157531cbf251eba7e398e9f76a4f450e570ba5f7 100644 (file)
@@ -17,6 +17,8 @@
 
 */
 
+#include <iostream>
+
 #include <glibmm/miscutils.h>
 
 #include "ardour/control_protocol_search_path.h"
@@ -34,18 +36,18 @@ namespace ARDOUR {
 SearchPath
 control_protocol_search_path ()
 {
+       SearchPath spath (user_config_directory ());
+
+       spath += ardour_dll_directory ();
+       spath.add_subdirectory_to_paths (surfaces_dir_name);
+
        bool surfaces_path_defined = false;
        SearchPath spath_env (Glib::getenv(surfaces_env_variable_name, surfaces_path_defined));
-
+       
        if (surfaces_path_defined) {
-               return spath_env;
+               spath += spath_env;
        }
 
-       SearchPath spath (user_config_directory ());
-
-       spath += ardour_module_directory ();
-       spath.add_subdirectory_to_paths (surfaces_dir_name);
-
        return spath;
 }