13
0

Don't require liblrdf on windows

This removes dependence on liblrdf, libraptor and libxslt
This commit is contained in:
Paul Davis 2013-07-11 14:20:02 -04:00
parent 1b21eec042
commit 742753a996
8 changed files with 62 additions and 9 deletions

View File

@ -43,8 +43,6 @@
#include "ardour/plugin_insert.h"
#include "ardour/session.h"
#include <lrdf.h>
#include "ardour_ui.h"
#include "prompter.h"
#include "plugin_ui.h"

View File

@ -21,7 +21,6 @@
#endif
#include <cstdio>
#include <lrdf.h>
#include <map>
#include <algorithm>

View File

@ -59,8 +59,6 @@
#include "lv2_plugin_ui.h"
#endif
#include <lrdf.h>
#include "ardour_window.h"
#include "ardour_ui.h"
#include "prompter.h"

View File

@ -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
}

View File

@ -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 ();

View File

@ -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

View File

@ -32,7 +32,9 @@
#include <cerrno>
#include <utility>
#ifdef HAVE_LRDF
#include <lrdf.h>
#endif
#include "pbd/compose.h"
#include "pbd/error.h"

View File

@ -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