13
0

Clean up LADSPA preset path

* Allow to bundle presets
* Do not use /usr/[local] on Windows
(This may need further work, for Windows, since default user
presets are in `file://$HOME/.ladspa/rdf/`)
This commit is contained in:
Robin Gareus 2022-10-11 16:25:13 +02:00
parent 340a260b30
commit 5324c9092e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 19 additions and 9 deletions

View File

@ -44,6 +44,10 @@
class CAComponentDescription;
#endif
namespace PBD {
class Searchpath;
}
namespace ARDOUR {
class Plugin;
@ -324,7 +328,7 @@ private:
void lxvst_refresh (bool cache_only);
void vst3_refresh (bool cache_only);
void add_lrdf_data (const std::string &path);
void add_lrdf_data (PBD::Searchpath const&);
void add_lrdf_presets (std::string domain);
#ifdef AUDIOUNIT_SUPPORT

View File

@ -720,6 +720,7 @@ LadspaPluginInfo::get_presets (bool /*user_only*/) const
if (set_uris) {
for (uint32_t i = 0; i < (uint32_t) set_uris->count; ++i) {
// TODO somehow mark factory presets as such..
if (char* label = lrdf_get_label (set_uris->items[i])) {
p.push_back (Plugin::PresetRecord (set_uris->items[i], label));
}

View File

@ -195,7 +195,6 @@ PluginManager::PluginManager ()
, _enable_scan_timeout (false)
{
char* s;
string lrdf_path;
#if defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT || defined MACVST_SUPPORT || defined VST3_SUPPORT
// source-tree (ardev, etc)
@ -262,15 +261,21 @@ PluginManager::PluginManager ()
load_tags ();
load_stats ();
Searchpath rdfs (ARDOUR::ardour_data_search_path());
if ((s = getenv ("LADSPA_RDF_PATH"))){
lrdf_path = s;
rdfs.add_subdirectory_to_paths ("rdf");
Searchpath t (s);
rdfs += t;
} else {
#ifndef PLATFORM_WINDOWS
rdfs += "usr/local/share/ladspa";
rdfs += "usr/share/ladspa";
#endif
rdfs.add_subdirectory_to_paths ("rdf");
}
if (lrdf_path.length() == 0) {
lrdf_path = "/usr/local/share/ladspa/rdf:/usr/share/ladspa/rdf";
}
add_lrdf_data(lrdf_path);
add_lrdf_data (rdfs);
add_lrdf_presets ("ladspa");
@ -842,7 +847,7 @@ PluginManager::add_lrdf_presets(string domain)
}
void
PluginManager::add_lrdf_data (const string &path)
PluginManager::add_lrdf_data (Searchpath const& path)
{
#ifdef HAVE_LRDF
vector<string> rdf_files;