2 Copyright (C) 2011 Tim Mayberry
3 Copyright (C) 2013 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <glibmm/miscutils.h>
23 #include "pbd/pathexpand.h"
25 #include "ardour/search_paths.h"
26 #include "ardour/directory_names.h"
27 #include "ardour/filesystem_paths.h"
30 const char * const backend_env_variable_name = "ARDOUR_BACKEND_PATH";
31 const char * const surfaces_env_variable_name = "ARDOUR_SURFACES_PATH";
32 const char * const export_env_variable_name = "ARDOUR_EXPORT_FORMATS_PATH";
33 const char * const ladspa_env_variable_name = "LADSPA_PATH";
34 const char * const midi_patch_env_variable_name = "ARDOUR_MIDI_PATCH_PATH";
42 backend_search_path ()
44 Searchpath spath(user_config_directory ());
45 spath += ardour_dll_directory ();
46 spath.add_subdirectory_to_paths(backend_dir_name);
48 spath += Searchpath(Glib::getenv(backend_env_variable_name));
53 control_protocol_search_path ()
55 Searchpath spath(user_config_directory ());
56 spath += ardour_dll_directory ();
57 spath.add_subdirectory_to_paths (surfaces_dir_name);
59 spath += Searchpath(Glib::getenv(surfaces_env_variable_name));
64 export_formats_search_path ()
66 Searchpath spath (ardour_data_search_path());
67 spath.add_subdirectory_to_paths (export_formats_dir_name);
69 bool export_formats_path_defined = false;
70 Searchpath spath_env (Glib::getenv(export_env_variable_name, export_formats_path_defined));
72 if (export_formats_path_defined) {
82 Searchpath spath_env (Glib::getenv(ladspa_env_variable_name));
84 Searchpath spath (user_config_directory ());
86 spath += ardour_dll_directory ();
87 spath.add_subdirectory_to_paths (ladspa_dir_name);
89 #ifndef PLATFORM_WINDOWS
90 spath.push_back ("/usr/local/lib64/ladspa");
91 spath.push_back ("/usr/local/lib/ladspa");
92 spath.push_back ("/usr/lib64/ladspa");
93 spath.push_back ("/usr/lib/ladspa");
97 spath.push_back (path_expand ("~/Library/Audio/Plug-Ins/LADSPA"));
98 spath.push_back ("/Library/Audio/Plug-Ins/LADSPA");
101 return spath_env + spath;
105 lv2_bundled_search_path ()
107 Searchpath spath( ardour_dll_directory () );
108 spath.add_subdirectory_to_paths ("LV2");
114 midi_patch_search_path ()
116 Searchpath spath (ardour_data_search_path());
117 spath.add_subdirectory_to_paths(midi_patch_dir_name);
119 bool midi_patch_path_defined = false;
120 Searchpath spath_env (Glib::getenv(midi_patch_env_variable_name, midi_patch_path_defined));
122 if (midi_patch_path_defined) {
129 } // namespace ARDOUR