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";
35 const char * const panner_env_variable_name = "ARDOUR_PANNER_PATH";
43 backend_search_path ()
45 Searchpath spath(user_config_directory ());
46 spath += ardour_dll_directory ();
47 spath.add_subdirectory_to_paths(backend_dir_name);
49 spath += Searchpath(Glib::getenv(backend_env_variable_name));
54 control_protocol_search_path ()
56 Searchpath spath(user_config_directory ());
57 spath += ardour_dll_directory ();
58 spath.add_subdirectory_to_paths (surfaces_dir_name);
60 spath += Searchpath(Glib::getenv(surfaces_env_variable_name));
65 export_formats_search_path ()
67 Searchpath spath (ardour_data_search_path());
68 spath.add_subdirectory_to_paths (export_formats_dir_name);
70 bool export_formats_path_defined = false;
71 Searchpath spath_env (Glib::getenv(export_env_variable_name, export_formats_path_defined));
73 if (export_formats_path_defined) {
83 Searchpath spath_env (Glib::getenv(ladspa_env_variable_name));
85 Searchpath spath (user_config_directory ());
87 spath += ardour_dll_directory ();
88 spath.add_subdirectory_to_paths (ladspa_dir_name);
90 #ifndef PLATFORM_WINDOWS
91 spath.push_back ("/usr/local/lib64/ladspa");
92 spath.push_back ("/usr/local/lib/ladspa");
93 spath.push_back ("/usr/lib64/ladspa");
94 spath.push_back ("/usr/lib/ladspa");
98 spath.push_back (path_expand ("~/Library/Audio/Plug-Ins/LADSPA"));
99 spath.push_back ("/Library/Audio/Plug-Ins/LADSPA");
102 return spath_env + spath;
106 lv2_bundled_search_path ()
108 Searchpath spath( ardour_dll_directory () );
109 spath.add_subdirectory_to_paths ("LV2");
115 midi_patch_search_path ()
117 Searchpath spath (ardour_data_search_path());
118 spath.add_subdirectory_to_paths(midi_patch_dir_name);
120 bool midi_patch_path_defined = false;
121 Searchpath spath_env (Glib::getenv(midi_patch_env_variable_name, midi_patch_path_defined));
123 if (midi_patch_path_defined) {
131 panner_search_path ()
133 Searchpath spath(user_config_directory ());
135 spath += ardour_dll_directory ();
136 spath.add_subdirectory_to_paths(panner_dir_name);
137 spath += Searchpath(Glib::getenv(panner_env_variable_name));
142 } // namespace ARDOUR