summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-07-11 14:20:02 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-07-11 14:20:02 -0400
commit742753a9969f443e4a548fc11d3ed82efe74f5e9 (patch)
treeb753b3a800d3bbcbb4f6c2893a13080eccf9e105 /libs
parent1b21eec042ca3c689cfeddbef9d00d1fa653079a (diff)
Don't require liblrdf on windows
This removes dependence on liblrdf, libraptor and libxslt
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/audio_library.cc18
-rw-r--r--libs/ardour/globals.cc6
-rw-r--r--libs/ardour/ladspa_plugin.cc26
-rw-r--r--libs/ardour/plugin.cc2
-rw-r--r--libs/ardour/plugin_manager.cc14
5 files changed, 62 insertions, 4 deletions
diff --git a/libs/ardour/audio_library.cc b/libs/ardour/audio_library.cc
index c2b2f1bff7..4a6089dac3 100644
--- a/libs/ardour/audio_library.cc
+++ b/libs/ardour/audio_library.cc
@@ -17,11 +17,18 @@
*/
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
#include <sstream>
#include <libxml/uri.h>
+#ifdef HAVE_LRDF
#include <lrdf.h>
+#endif
+
#include <glibmm/miscutils.h>
#include <glibmm/convert.h>
@@ -57,7 +64,9 @@ AudioLibrary::AudioLibrary ()
touch_file(sfdb_file_path);
+#ifdef HAVE_LRDF
lrdf_read_file(src.c_str());
+#endif
}
AudioLibrary::~AudioLibrary ()
@@ -67,14 +76,17 @@ AudioLibrary::~AudioLibrary ()
void
AudioLibrary::save_changes ()
{
+#ifdef HAVE_LRDF
if (lrdf_export_by_source(src.c_str(), src.substr(5).c_str())) {
PBD::warning << string_compose(_("Could not open %1. Audio Library not saved"), src) << endmsg;
}
+#endif
}
void
AudioLibrary::set_tags (string member, vector<string> tags)
{
+#ifdef HAVE_LRDF
sort (tags.begin(), tags.end());
tags.erase (unique(tags.begin(), tags.end()), tags.end());
@@ -85,12 +97,14 @@ AudioLibrary::set_tags (string member, vector<string> tags)
for (vector<string>::iterator i = tags.begin(); i != tags.end(); ++i) {
lrdf_add_triple (src.c_str(), file_uri.c_str(), TAG, (*i).c_str(), lrdf_literal);
}
+#endif
}
vector<string>
AudioLibrary::get_tags (string member)
{
vector<string> tags;
+#ifdef HAVE_LRDF
lrdf_statement pattern;
pattern.subject = strdup(Glib::filename_to_uri(member).c_str());
@@ -111,13 +125,14 @@ AudioLibrary::get_tags (string member)
lrdf_free_statements (matches);
sort (tags.begin(), tags.end());
-
+#endif
return tags;
}
void
AudioLibrary::search_members_and (vector<string>& members, const vector<string>& tags)
{
+#ifdef HAVE_LRDF
lrdf_statement **head;
lrdf_statement* pattern = 0;
lrdf_statement* old = 0;
@@ -153,4 +168,5 @@ AudioLibrary::search_members_and (vector<string>& members, const vector<string>&
pattern = pattern->next;
delete old;
}
+#endif
}
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index cc427f7428..fe07332d85 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -57,7 +57,9 @@
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
+#ifdef HAVE_LRDF
#include <lrdf.h>
+#endif
#include "pbd/cpus.h"
#include "pbd/error.h"
@@ -265,7 +267,9 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
// allow ardour the absolute maximum number of open files
lotsa_files_please ();
+#ifdef HAVE_LRDF
lrdf_init();
+#endif
Library = new AudioLibrary;
BootMessage (_("Loading configuration"));
@@ -360,7 +364,9 @@ int
ARDOUR::cleanup ()
{
delete Library;
+#ifdef HAVE_LRDF
lrdf_cleanup ();
+#endif
delete &ControlProtocolManager::instance();
#ifdef WINDOWS_VST_SUPPORT
fst_exit ();
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index b306269276..6ee810f6b1 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -17,6 +17,10 @@
*/
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
#include <inttypes.h>
#include <vector>
@@ -29,7 +33,9 @@
#include <sys/stat.h>
#include <cerrno>
+#ifdef HAVE_LRDF
#include <lrdf.h>
+#endif
#include "pbd/compose.h"
#include "pbd/error.h"
@@ -625,10 +631,11 @@ LadspaPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
boost::shared_ptr<Plugin::ScalePoints>
LadspaPlugin::get_scale_points(uint32_t port_index) const
{
+ boost::shared_ptr<Plugin::ScalePoints> ret;
+#ifdef HAVE_LRDF
const uint32_t id = atol(unique_id().c_str());
lrdf_defaults* points = lrdf_get_scale_values(id, port_index);
- boost::shared_ptr<Plugin::ScalePoints> ret;
if (!points) {
return ret;
}
@@ -641,6 +648,7 @@ LadspaPlugin::get_scale_points(uint32_t port_index) const
}
lrdf_free_setting_values(points);
+#endif
return ret;
}
@@ -725,6 +733,7 @@ LadspaPluginInfo::LadspaPluginInfo()
void
LadspaPlugin::find_presets ()
{
+#ifdef HAVE_LRDF
uint32_t id;
std::string unique (unique_id());
@@ -745,12 +754,14 @@ LadspaPlugin::find_presets ()
}
lrdf_free_uris(set_uris);
}
+#endif
}
bool
LadspaPlugin::load_preset (PresetRecord r)
{
+#ifdef HAVE_LRDF
lrdf_defaults* defs = lrdf_get_setting_values (r.uri.c_str());
if (defs) {
@@ -763,6 +774,7 @@ LadspaPlugin::load_preset (PresetRecord r)
}
Plugin::load_preset (r);
+#endif
return true;
}
@@ -770,6 +782,7 @@ LadspaPlugin::load_preset (PresetRecord r)
static void
lrdf_remove_preset (const char* /*source*/, const char *setting_uri)
{
+#ifdef HAVE_LRDF
lrdf_statement p;
lrdf_statement *q;
lrdf_statement *i;
@@ -803,11 +816,13 @@ lrdf_remove_preset (const char* /*source*/, const char *setting_uri)
p.predicate = NULL;
p.object = NULL;
lrdf_remove_matches (&p);
+#endif
}
void
LadspaPlugin::do_remove_preset (string name)
{
+#ifdef HAVE_LRDF
string const envvar = preset_envvar ();
if (envvar.empty()) {
warning << _("Could not locate HOME. Preset not removed.") << endmsg;
@@ -823,6 +838,7 @@ LadspaPlugin::do_remove_preset (string name)
lrdf_remove_preset (source.c_str(), p->uri.c_str ());
write_preset_file (envvar);
+#endif
}
string
@@ -845,6 +861,7 @@ LadspaPlugin::preset_source (string envvar) const
bool
LadspaPlugin::write_preset_file (string envvar)
{
+#ifdef HAVE_LRDF
string path = string_compose("%1/.ladspa", envvar);
if (g_mkdir_with_parents (path.c_str(), 0775)) {
warning << string_compose(_("Could not create %1. Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
@@ -865,11 +882,15 @@ LadspaPlugin::write_preset_file (string envvar)
}
return true;
+#else
+ return false;
+#endif
}
string
LadspaPlugin::do_save_preset (string name)
{
+#ifdef HAVE_LRDF
/* make a vector of pids that are input parameters */
vector<int> input_parameter_pids;
for (uint32_t i = 0; i < parameter_count(); ++i) {
@@ -913,6 +934,9 @@ LadspaPlugin::do_save_preset (string name)
}
return uri;
+#else
+ return string();
+#endif
}
LADSPA_PortDescriptor
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc
index e76353e8d5..ec9e333285 100644
--- a/libs/ardour/plugin.cc
+++ b/libs/ardour/plugin.cc
@@ -32,7 +32,9 @@
#include <cerrno>
#include <utility>
+#ifdef HAVE_LRDF
#include <lrdf.h>
+#endif
#include "pbd/compose.h"
#include "pbd/error.h"
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
index a3a7fb48da..6ea0292872 100644
--- a/libs/ardour/plugin_manager.cc
+++ b/libs/ardour/plugin_manager.cc
@@ -25,10 +25,13 @@
#include <sys/types.h>
#include <cstdio>
-#include <lrdf.h>
#include <cstdlib>
#include <fstream>
+#ifdef HAVE_LRDF
+#include <lrdf.h>
+#endif
+
#ifdef WINDOWS_VST_SUPPORT
#include "fst.h"
#include "pbd/basename.h"
@@ -314,7 +317,7 @@ PluginManager::add_lxvst_presets()
void
PluginManager::add_presets(string domain)
{
-
+#ifdef HAVE_LRDF
PathScanner scanner;
vector<string *> *presets;
vector<string *>::iterator x;
@@ -337,11 +340,13 @@ PluginManager::add_presets(string domain)
vector_delete (presets);
}
+#endif
}
void
PluginManager::add_lrdf_data (const string &path)
{
+#ifdef HAVE_LRDF
PathScanner scanner;
vector<string *>* rdf_files;
vector<string *>::iterator x;
@@ -359,6 +364,7 @@ PluginManager::add_lrdf_data (const string &path)
vector_delete (rdf_files);
}
+#endif
}
int
@@ -448,6 +454,7 @@ PluginManager::ladspa_discover (string path)
string
PluginManager::get_ladspa_category (uint32_t plugin_id)
{
+#ifdef HAVE_LRDF
char buf[256];
lrdf_statement pattern;
@@ -505,6 +512,9 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
} else {
return label;
}
+#else
+ return ("Unknown");
+#endif
}
#ifdef LV2_SUPPORT