X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsearch_paths.cc;h=0fc9f0c4f5fe29d9da64fcb3351c6e4970063d09;hb=8a44aa9aba635ea43429dc929ebcd0d3d57da23c;hp=243e5207764c5ec0659624558e4683eb563fdfa5;hpb=06fe0a51723aa7970347e0e2d478344ebefb084f;p=ardour.git diff --git a/libs/ardour/search_paths.cc b/libs/ardour/search_paths.cc index 243e520776..0fc9f0c4f5 100644 --- a/libs/ardour/search_paths.cc +++ b/libs/ardour/search_paths.cc @@ -20,12 +20,17 @@ #include +#include "pbd/pathexpand.h" + #include "ardour/search_paths.h" #include "ardour/directory_names.h" #include "ardour/filesystem_paths.h" namespace { const char * const backend_env_variable_name = "ARDOUR_BACKEND_PATH"; + const char * const surfaces_env_variable_name = "ARDOUR_SURFACES_PATH"; + const char * const export_env_variable_name = "ARDOUR_EXPORT_FORMATS_PATH"; + const char * const ladspa_env_variable_name = "LADSPA_PATH"; } // anonymous using namespace PBD; @@ -43,4 +48,65 @@ backend_search_path () return spath; } +Searchpath +control_protocol_search_path () +{ + Searchpath spath(user_config_directory ()); + spath += ardour_dll_directory (); + spath.add_subdirectory_to_paths (surfaces_dir_name); + + spath += Searchpath(Glib::getenv(surfaces_env_variable_name)); + return spath; +} + +Searchpath +export_formats_search_path () +{ + Searchpath spath (ardour_data_search_path()); + spath.add_subdirectory_to_paths (export_formats_dir_name); + + bool export_formats_path_defined = false; + Searchpath spath_env (Glib::getenv(export_env_variable_name, export_formats_path_defined)); + + if (export_formats_path_defined) { + spath += spath_env; + } + + return spath; +} + +Searchpath +ladspa_search_path () +{ + Searchpath spath_env (Glib::getenv(ladspa_env_variable_name)); + + Searchpath spath (user_config_directory ()); + + spath += ardour_dll_directory (); + spath.add_subdirectory_to_paths (ladspa_dir_name); + +#ifndef PLATFORM_WINDOWS + spath.push_back ("/usr/local/lib64/ladspa"); + spath.push_back ("/usr/local/lib/ladspa"); + spath.push_back ("/usr/lib64/ladspa"); + spath.push_back ("/usr/lib/ladspa"); +#endif + +#ifdef __APPLE__ + spath.push_back (path_expand ("~/Library/Audio/Plug-Ins/LADSPA")); + spath.push_back ("/Library/Audio/Plug-Ins/LADSPA"); +#endif + + return spath_env + spath; +} + +Searchpath +lv2_bundled_search_path () +{ + Searchpath spath( ardour_dll_directory () ); + spath.add_subdirectory_to_paths ("LV2"); + + return spath; +} + } // namespace ARDOUR