lots and lots of work to correctly deduce AU IO configurations and related issues
[ardour.git] / libs / ardour / globals.cc
index c873ac02ab5b03fd211d39671d1eb41b9af8b7ac..c5f96d67647da6f2c9f98ad4fb545e72b64a1b25 100644 (file)
 #include <fst.h>
 #endif
 
+#ifdef HAVE_AUDIOUNITS
+#include <ardour/audio_unit.h>
+#endif
+
 #ifdef __SSE__
 #include <xmmintrin.h>
 #endif
@@ -328,6 +332,10 @@ ARDOUR::init (bool use_vst, bool try_optimization)
                return -1;
        }
 #endif
+
+#ifdef HAVE_AUDIOUNITS
+       AUPluginInfo::load_cached_info ();
+#endif
        
        /* Make VAMP look in our library ahead of anything else */
 
@@ -413,13 +421,13 @@ string
 ARDOUR::get_user_ardour_path ()
 {
        string path;
-       char* envvar;
-       
-       if ((envvar = getenv ("HOME")) == 0 || strlen (envvar) == 0) {
+               
+       path = Glib::get_home_dir();
+
+       if (path.empty()) {
                return "/";
        }
-               
-       path = envvar;
+
        path += "/.ardour2/";
 
        /* create it if necessary */
@@ -493,11 +501,12 @@ find_file (string name, string dir, string subdir = "")
        path = get_user_ardour_path();
                
        if (subdir.length()) {
-               path += subdir + "/";
+               path = Glib::build_filename (path, subdir);
        }
                
-       path += name;
-       if (access (path.c_str(), R_OK) == 0) {
+       path = Glib::build_filename (path, name);
+
+       if (Glib::file_test (path.c_str(), Glib::FILE_TEST_EXISTS)) {
                return path;
        }
 
@@ -543,6 +552,8 @@ ARDOUR::find_bindings_files (map<string,string>& files)
        vector<string*> *found;
        string full_path;
        
+       /* XXX building path, so separators are fixed */
+
        full_path = get_user_ardour_path ();
        full_path += ':';
        full_path = get_system_data_path ();