Move a few declarations to first use.
[ardour.git] / libs / ardour / control_protocol_search_path.cc
index a728b3c10fde964cb28783860922982b628ba300..345989277bef662f571b17585dca960fe5d15efb 100644 (file)
@@ -17,7 +17,6 @@
 
 */
 
-#include <iostream>
 #include <glibmm/miscutils.h>
 
 #include "ardour/control_protocol_search_path.h"
@@ -35,20 +34,18 @@ namespace ARDOUR {
 SearchPath
 control_protocol_search_path ()
 {
-       bool surfaces_path_defined = false;
-       SearchPath spath_env (Glib::getenv(surfaces_env_variable_name, surfaces_path_defined));
-
-       if (surfaces_path_defined) {
-               return spath_env;
-       }
-
        SearchPath spath (user_config_directory ());
 
-        std::cerr << "for CPS, AMD = " << ardour_module_directory().to_string() << std::endl;
-
        spath += ardour_module_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) {
+               spath += spath_env;
+       }
+
        return spath;
 }