summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/NodeModel.cpp15
-rw-r--r--src/client/PluginModel.cpp52
-rw-r--r--src/client/PluginModel.hpp16
-rw-r--r--src/client/PluginUI.cpp12
-rw-r--r--src/client/PluginUI.hpp2
-rw-r--r--src/gui/NodeMenu.cpp32
-rw-r--r--src/gui/PatchCanvas.cpp31
-rw-r--r--src/gui/PatchCanvas.hpp12
-rw-r--r--src/server/LV2Info.hpp16
-rw-r--r--src/server/LV2Node.cpp40
-rw-r--r--src/server/LV2Node.hpp4
-rw-r--r--src/server/LV2Plugin.cpp4
-rw-r--r--src/server/LV2Plugin.hpp6
-rw-r--r--src/server/NodeFactory.cpp4
-rw-r--r--src/shared/World.cpp4
-rw-r--r--src/shared/World.hpp4
16 files changed, 132 insertions, 122 deletions
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp
index f7321472..4c00e6ec 100644
--- a/src/client/NodeModel.cpp
+++ b/src/client/NodeModel.cpp
@@ -217,15 +217,18 @@ NodeModel::port_label(SharedPtr<PortModel> port) const
#ifdef HAVE_LILV
if (_plugin && _plugin->type() == PluginModel::LV2) {
- LilvWorld c_world = _plugin->lilv_world();
- LilvPlugin c_plugin = _plugin->lilv_plugin();
- LilvValue c_sym = lilv_value_new_string(c_world, port->symbol().c_str());
- LilvPort c_port = lilv_plugin_get_port_by_symbol(c_plugin, c_sym);
+ LilvWorld* c_world = _plugin->lilv_world();
+ const LilvPlugin* c_plugin = _plugin->lilv_plugin();
+ LilvValue* c_sym = lilv_value_new_string(c_world, port->symbol().c_str());
+ const LilvPort* c_port = lilv_plugin_get_port_by_symbol(c_plugin, c_sym);
if (c_port) {
- LilvValue c_name = lilv_port_get_name(c_plugin, c_port);
+ LilvValue* c_name = lilv_port_get_name(c_plugin, c_port);
if (c_name && lilv_value_is_string(c_name)) {
- return lilv_value_as_string(c_name);
+ std::string ret(lilv_value_as_string(c_name));
+ lilv_value_free(c_name);
+ return ret;
}
+ lilv_value_free(c_name);
}
}
#endif
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index dd22549b..62bed5fb 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -36,8 +36,8 @@ namespace Ingen {
namespace Client {
#ifdef HAVE_LILV
-LilvWorld PluginModel::_lilv_world = NULL;
-LilvPlugins PluginModel::_lilv_plugins = NULL;
+LilvWorld* PluginModel::_lilv_world = NULL;
+const LilvPlugins* PluginModel::_lilv_plugins = NULL;
#endif
Sord::World* PluginModel::_rdf_world = NULL;
@@ -52,7 +52,7 @@ PluginModel::PluginModel(Shared::LV2URIMap& uris,
assert(_rdf_world);
add_property("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", this->type_uri());
#ifdef HAVE_LILV
- LilvValue plugin_uri = lilv_value_new_uri(_lilv_world, uri.c_str());
+ LilvValue* plugin_uri = lilv_value_new_uri(_lilv_world, uri.c_str());
_lilv_plugin = lilv_plugins_get_by_uri(_lilv_plugins, plugin_uri);
lilv_value_free(plugin_uri);
#endif
@@ -100,11 +100,11 @@ PluginModel::get_property(const URI& key) const
#ifdef HAVE_LILV
if (_lilv_plugin) {
boost::optional<Raul::Atom&> ret;
- LilvValue lv2_pred = lilv_value_new_uri(_lilv_world, key.str().c_str());
- LilvValues values = lilv_plugin_get_value(_lilv_plugin, lv2_pred);
+ LilvValue* lv2_pred = lilv_value_new_uri(_lilv_world, key.str().c_str());
+ LilvValues* values = lilv_plugin_get_value(_lilv_plugin, lv2_pred);
lilv_value_free(lv2_pred);
LILV_FOREACH(values, i, values) {
- LilvValue val = lilv_values_get(values, i);
+ const LilvValue* val = lilv_values_get(values, i);
if (lilv_value_is_uri(val)) {
ret = set_property(key, Atom(Atom::URI, lilv_value_as_uri(val)));
break;
@@ -173,9 +173,9 @@ PluginModel::port_human_name(uint32_t index) const
{
#ifdef HAVE_LILV
if (_lilv_plugin) {
- LilvPort port = lilv_plugin_get_port_by_index(_lilv_plugin, index);
- LilvValue name = lilv_port_get_name(_lilv_plugin, port);
- string ret = lilv_value_as_string(name);
+ const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, index);
+ LilvValue* name = lilv_port_get_name(_lilv_plugin, port);
+ const string ret(lilv_value_as_string(name));
lilv_value_free(name);
return ret;
}
@@ -187,8 +187,10 @@ PluginModel::port_human_name(uint32_t index) const
bool
PluginModel::has_ui() const
{
- LilvUIs uis = lilv_plugin_get_uis(_lilv_plugin);
- return (lilv_values_size(uis) > 0);
+ LilvUIs* uis = lilv_plugin_get_uis(_lilv_plugin);
+ const bool ret = (lilv_values_size(uis) > 0);
+ lilv_uis_free(uis);
+ return ret;
}
SharedPtr<PluginUI>
@@ -213,16 +215,16 @@ PluginModel::icon_path() const
/** RDF world mutex must be held by the caller */
string
-PluginModel::get_lv2_icon_path(LilvPlugin plugin)
+PluginModel::get_lv2_icon_path(const LilvPlugin* plugin)
{
string result;
- LilvValue svg_icon_pred = lilv_value_new_uri(_lilv_world,
+ LilvValue* svg_icon_pred = lilv_value_new_uri(_lilv_world,
"http://ll-plugins.nongnu.org/lv2/namespace#svgIcon");
- LilvValues paths = lilv_plugin_get_value(plugin, svg_icon_pred);
+ LilvValues* paths = lilv_plugin_get_value(plugin, svg_icon_pred);
if (lilv_values_size(paths) > 0) {
- LilvValue value = lilv_values_get_first(paths);
+ const LilvValue* value = lilv_values_get_first(paths);
if (lilv_value_is_uri(value))
result = lilv_uri_to_path(lilv_value_as_string(value));
lilv_values_free(paths);
@@ -243,12 +245,12 @@ PluginModel::documentation() const
//LilvValue lv2_documentation = lilv_value_new_uri(
// _lilv_world, LILV_NAMESPACE_LV2 "documentation");
- LilvValue rdfs_comment = lilv_value_new_uri(
+ LilvValue* rdfs_comment = lilv_value_new_uri(
_lilv_world, "http://www.w3.org/2000/01/rdf-schema#comment");
- LilvValues vals = lilv_plugin_get_value(_lilv_plugin,
- rdfs_comment);
- LilvValue val = lilv_values_get_first(vals);
+ LilvValues* vals = lilv_plugin_get_value(_lilv_plugin,
+ rdfs_comment);
+ const LilvValue* val = lilv_values_get_first(vals);
if (lilv_value_is_string(val)) {
doc += lilv_value_as_string(val);
}
@@ -266,17 +268,17 @@ PluginModel::port_documentation(uint32_t index) const
if (!_lilv_plugin)
return doc;
- LilvPort port = lilv_plugin_get_port_by_index(_lilv_plugin, index);
+ const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, index);
//LilvValue lv2_documentation = lilv_value_new_uri(
// _lilv_world, LILV_NAMESPACE_LV2 "documentation");
- LilvValue rdfs_comment = lilv_value_new_uri(
+ LilvValue* rdfs_comment = lilv_value_new_uri(
_lilv_world, "http://www.w3.org/2000/01/rdf-schema#comment");
- LilvValues vals = lilv_port_get_value(_lilv_plugin,
- port,
- rdfs_comment);
- LilvValue val = lilv_values_get_first(vals);
+ LilvValues* vals = lilv_port_get_value(_lilv_plugin,
+ port,
+ rdfs_comment);
+ const LilvValue* val = lilv_values_get_first(vals);
if (lilv_value_is_string(val)) {
doc += lilv_value_as_string(val);
}
diff --git a/src/client/PluginModel.hpp b/src/client/PluginModel.hpp
index e7076ff2..faba8c8b 100644
--- a/src/client/PluginModel.hpp
+++ b/src/client/PluginModel.hpp
@@ -68,14 +68,14 @@ public:
std::string port_human_name(uint32_t index) const;
#ifdef HAVE_LILV
- static LilvWorld lilv_world() { return _lilv_world; }
- LilvPlugin lilv_plugin() const { return _lilv_plugin; }
+ static LilvWorld* lilv_world() { return _lilv_world; }
+ const LilvPlugin* lilv_plugin() const { return _lilv_plugin; }
- LilvPort lilv_port(uint32_t index) {
+ const LilvPort* lilv_port(uint32_t index) {
return lilv_plugin_get_port_by_index(_lilv_plugin, index);
}
- static void set_lilv_world(LilvWorld world) {
+ static void set_lilv_world(LilvWorld* world) {
_lilv_world = world;
_lilv_plugins = lilv_world_get_all_plugins(_lilv_world);
}
@@ -86,7 +86,7 @@ public:
SharedPtr<NodeModel> node) const;
const std::string& icon_path() const;
- static std::string get_lv2_icon_path(LilvPlugin plugin);
+ static std::string get_lv2_icon_path(const LilvPlugin* plugin);
#endif
std::string documentation() const;
@@ -110,10 +110,10 @@ private:
Type _type;
#ifdef HAVE_LILV
- static LilvWorld _lilv_world;
- static LilvPlugins _lilv_plugins;
+ static LilvWorld* _lilv_world;
+ static const LilvPlugins* _lilv_plugins;
- LilvPlugin _lilv_plugin;
+ const LilvPlugin* _lilv_plugin;
mutable std::string _icon_path;
#endif
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index 437e0f27..d545d670 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -117,7 +117,7 @@ PluginUI::~PluginUI()
SharedPtr<PluginUI>
PluginUI::create(Ingen::Shared::World* world,
SharedPtr<NodeModel> node,
- LilvPlugin plugin)
+ const LilvPlugin* plugin)
{
if (!PluginUI::ui_host) {
PluginUI::ui_host = suil_host_new(lv2_ui_write, NULL, NULL, NULL);
@@ -125,13 +125,13 @@ PluginUI::create(Ingen::Shared::World* world,
static const char* gtk_ui_uri = "http://lv2plug.in/ns/extensions/ui#GtkUI";
- LilvValue gtk_ui = lilv_value_new_uri(world->lilv_world(), gtk_ui_uri);
+ LilvValue* gtk_ui = lilv_value_new_uri(world->lilv_world(), gtk_ui_uri);
- LilvUIs uis = lilv_plugin_get_uis(plugin);
- LilvUI ui = NULL;
- LilvValue ui_type = NULL;
+ LilvUIs* uis = lilv_plugin_get_uis(plugin);
+ const LilvUI* ui = NULL;
+ const LilvValue* ui_type = NULL;
LILV_FOREACH(uis, u, uis) {
- LilvUI this_ui = lilv_uis_get(uis, u);
+ const LilvUI* this_ui = lilv_uis_get(uis, u);
if (lilv_ui_is_supported(this_ui,
suil_ui_supported,
gtk_ui,
diff --git a/src/client/PluginUI.hpp b/src/client/PluginUI.hpp
index fd8d14f4..cedc4fe2 100644
--- a/src/client/PluginUI.hpp
+++ b/src/client/PluginUI.hpp
@@ -46,7 +46,7 @@ public:
static SharedPtr<PluginUI> create(Ingen::Shared::World* world,
SharedPtr<NodeModel> node,
- LilvPlugin plugin);
+ const LilvPlugin* plugin);
SuilWidget get_widget();
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 0c5c88fb..871ccaf9 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -86,23 +86,23 @@ NodeMenu::init(SharedPtr<NodeModel> node)
#ifdef HAVE_LILV
if (plugin && plugin->type() == PluginModel::LV2) {
- LilvValue preset_pred = lilv_value_new_uri(
+ LilvValue* preset_pred = lilv_value_new_uri(
plugin->lilv_world(),
"http://lv2plug.in/ns/dev/presets#hasPreset");
- LilvValue title_pred = lilv_value_new_uri(
+ LilvValue* title_pred = lilv_value_new_uri(
plugin->lilv_world(),
"http://dublincore.org/documents/dcmi-namespace/title");
- LilvValues presets = lilv_plugin_get_value(
+ LilvValues* presets = lilv_plugin_get_value(
plugin->lilv_plugin(), preset_pred);
if (presets) {
_presets_menu = Gtk::manage(new Gtk::Menu());
LILV_FOREACH(values, i, presets) {
- LilvValue uri = lilv_values_get(presets, i);
- LilvValues titles = lilv_plugin_get_value_for_subject(
+ const LilvValue* uri = lilv_values_get(presets, i);
+ LilvValues* titles = lilv_plugin_get_value_for_subject(
plugin->lilv_plugin(), uri, title_pred);
if (titles) {
- LilvValue title = lilv_values_get_first(titles);
+ const LilvValue* title = lilv_values_get_first(titles);
_presets_menu->items().push_back(
Gtk::Menu_Helpers::MenuElem(
lilv_value_as_string(title),
@@ -182,30 +182,30 @@ NodeMenu::on_preset_activated(const std::string& uri)
const NodeModel* const node = (NodeModel*)_object.get();
const PluginModel* const plugin = dynamic_cast<const PluginModel*>(node->plugin());
- LilvValue port_pred = lilv_value_new_uri(
+ LilvValue* port_pred = lilv_value_new_uri(
plugin->lilv_world(),
"http://lv2plug.in/ns/lv2core#port");
- LilvValue symbol_pred = lilv_value_new_uri(
+ LilvValue* symbol_pred = lilv_value_new_uri(
plugin->lilv_world(),
"http://lv2plug.in/ns/lv2core#symbol");
- LilvValue value_pred = lilv_value_new_uri(
+ LilvValue* value_pred = lilv_value_new_uri(
plugin->lilv_world(),
"http://lv2plug.in/ns/ext/presets#value");
- LilvValue subject = lilv_value_new_uri(plugin->lilv_world(), uri.c_str());
- LilvValues ports = lilv_plugin_get_value_for_subject(
+ LilvValue* subject = lilv_value_new_uri(plugin->lilv_world(), uri.c_str());
+ LilvValues* ports = lilv_plugin_get_value_for_subject(
plugin->lilv_plugin(),
subject,
port_pred);
App::instance().engine()->bundle_begin();
LILV_FOREACH(values, i, ports) {
- LilvValue uri = lilv_values_get(ports, i);
- LilvValues values = lilv_plugin_get_value_for_subject(
+ const LilvValue* uri = lilv_values_get(ports, i);
+ LilvValues* values = lilv_plugin_get_value_for_subject(
plugin->lilv_plugin(), uri, value_pred);
- LilvValues symbols = lilv_plugin_get_value_for_subject(
+ LilvValues* symbols = lilv_plugin_get_value_for_subject(
plugin->lilv_plugin(), uri, symbol_pred);
if (values && symbols) {
- LilvValue val = lilv_values_get_first(values);
- LilvValue sym = lilv_values_get_first(symbols);
+ const LilvValue* val = lilv_values_get_first(values);
+ const LilvValue* sym = lilv_values_get_first(symbols);
App::instance().engine()->set_property(
node->path().base() + lilv_value_as_string(sym),
App::instance().uris().ingen_value,
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index e8532007..bf48b121 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -196,13 +196,15 @@ PatchCanvas::build_menus()
*/
size_t
PatchCanvas::build_plugin_class_menu(
- Gtk::Menu* menu,
- LilvPluginClass plugin_class, LilvPluginClasses classes, const LV2Children& children,
- std::set<const char*>& ancestors)
+ Gtk::Menu* menu,
+ const LilvPluginClass* plugin_class,
+ const LilvPluginClasses* classes,
+ const LV2Children& children,
+ std::set<const char*>& ancestors)
{
- size_t num_items = 0;
- LilvValue class_uri = lilv_plugin_class_get_uri(plugin_class);
- const char* class_uri_str = lilv_value_as_string(class_uri);
+ size_t num_items = 0;
+ const LilvValue* class_uri = lilv_plugin_class_get_uri(plugin_class);
+ const char* class_uri_str = lilv_value_as_string(class_uri);
const std::pair<LV2Children::const_iterator, LV2Children::const_iterator> kids
= children.equal_range(class_uri_str);
@@ -213,7 +215,7 @@ PatchCanvas::build_plugin_class_menu(
// Add submenus
ancestors.insert(class_uri_str);
for (LV2Children::const_iterator i = kids.first; i != kids.second; ++i) {
- LilvPluginClass c = i->second;
+ const LilvPluginClass* c = i->second;
const char* sub_label_str = lilv_value_as_string(lilv_plugin_class_get_label(c));
const char* sub_uri_str = lilv_value_as_string(lilv_plugin_class_get_uri(c));
if (ancestors.find(sub_uri_str) != ancestors.end()) {
@@ -259,13 +261,14 @@ PatchCanvas::build_plugin_menu()
_menu->reorder_child(*plugin_menu_item, 5);
}
- LilvPluginClass lv2_plugin = lilv_world_get_plugin_class(PluginModel::lilv_world());
- LilvPluginClasses classes = lilv_world_get_plugin_classes(PluginModel::lilv_world());
+ const LilvWorld* world = PluginModel::lilv_world();
+ const LilvPluginClass* lv2_plugin = lilv_world_get_plugin_class(world);
+ const LilvPluginClasses* classes = lilv_world_get_plugin_classes(world);
LV2Children children;
LILV_FOREACH(plugin_classes, i, classes) {
- LilvPluginClass c = lilv_plugin_classes_get(classes, i);
- LilvValue p = lilv_plugin_class_get_parent_uri(c);
+ const LilvPluginClass* c = lilv_plugin_classes_get(classes, i);
+ const LilvValue* p = lilv_plugin_class_get_parent_uri(c);
if (!p)
p = lilv_plugin_class_get_uri(lv2_plugin);
children.insert(make_pair(lilv_value_as_string(p), c));
@@ -351,9 +354,9 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p)
return;
}
- LilvPluginClass pc = lilv_plugin_get_class(p->lilv_plugin());
- LilvValue class_uri = lilv_plugin_class_get_uri(pc);
- const char* class_uri_str = lilv_value_as_string(class_uri);
+ const LilvPluginClass* pc = lilv_plugin_get_class(p->lilv_plugin());
+ const LilvValue* class_uri = lilv_plugin_class_get_uri(pc);
+ const char* class_uri_str = lilv_value_as_string(class_uri);
Glib::RefPtr<Gdk::Pixbuf> icon = App::instance().icon_from_path(
PluginModel::get_lv2_icon_path(p->lilv_plugin()), 16);
diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp
index 7be3a813..1263b8ac 100644
--- a/src/gui/PatchCanvas.hpp
+++ b/src/gui/PatchCanvas.hpp
@@ -111,14 +111,14 @@ private:
void auto_menu_position(int& x, int& y, bool& push_in);
#ifdef HAVE_LILV
- typedef std::multimap<const std::string, LilvPluginClass> LV2Children;
+ typedef std::multimap<const std::string, const LilvPluginClass*> LV2Children;
void build_plugin_menu();
size_t build_plugin_class_menu(
- Gtk::Menu* menu,
- LilvPluginClass plugin_class,
- LilvPluginClasses classes,
- const LV2Children& children,
- std::set<const char*>& ancestors);
+ Gtk::Menu* menu,
+ const LilvPluginClass* plugin_class,
+ const LilvPluginClasses* classes,
+ const LV2Children& children,
+ std::set<const char*>& ancestors);
#endif
GraphObject::Properties get_initial_data();
diff --git a/src/server/LV2Info.hpp b/src/server/LV2Info.hpp
index 4f3e45f1..ff26d1f6 100644
--- a/src/server/LV2Info.hpp
+++ b/src/server/LV2Info.hpp
@@ -41,16 +41,16 @@ public:
explicit LV2Info(Ingen::Shared::World* world);
~LV2Info();
- LilvValue input_class;
- LilvValue output_class;
- LilvValue control_class;
- LilvValue audio_class;
- LilvValue event_class;
- LilvValue value_port_class;
- LilvValue message_port_class;
+ LilvValue* input_class;
+ LilvValue* output_class;
+ LilvValue* control_class;
+ LilvValue* audio_class;
+ LilvValue* event_class;
+ LilvValue* value_port_class;
+ LilvValue* message_port_class;
Ingen::Shared::World& world() { return *_world; }
- LilvWorld lv2_world() { return _world->lilv_world(); }
+ LilvWorld* lv2_world() { return _world->lilv_world(); }
private:
Ingen::Shared::World* _world;
diff --git a/src/server/LV2Node.cpp b/src/server/LV2Node.cpp
index 04d48905..0f53b6a3 100644
--- a/src/server/LV2Node.cpp
+++ b/src/server/LV2Node.cpp
@@ -104,7 +104,7 @@ LV2Node::prepare_poly(BufferFactory& bufs, uint32_t poly)
}
if (_activated)
- lilv_instance_activate((LilvInstance)(*_prepared_instances)[i].get());
+ lilv_instance_activate((LilvInstance*)(*_prepared_instances)[i].get());
}
return true;
@@ -139,7 +139,7 @@ LV2Node::instantiate(BufferFactory& bufs)
{
const Ingen::Shared::LV2URIMap& uris = bufs.uris();
SharedPtr<LV2Info> info = _lv2_plugin->lv2_info();
- LilvPlugin plug = _lv2_plugin->lilv_plugin();
+ const LilvPlugin* plug = _lv2_plugin->lilv_plugin();
uint32_t num_ports = lilv_plugin_get_num_ports(plug);
assert(num_ports > 0);
@@ -150,8 +150,8 @@ LV2Node::instantiate(BufferFactory& bufs)
_features = info->world().lv2_features()->lv2_features(&info->world(), this);
uint32_t port_buffer_size = 0;
- LilvValue ctx_ext_uri = lilv_value_new_uri(info->lv2_world(),
- LV2_CONTEXTS_URI "#MessageContext");
+ LilvValue* ctx_ext_uri = lilv_value_new_uri(info->lv2_world(),
+ LV2_CONTEXTS_URI "#MessageContext");
for (uint32_t i = 0; i < _polyphony; ++i) {
(*_instances)[i] = SharedPtr<void>(
@@ -189,26 +189,26 @@ LV2Node::instantiate(BufferFactory& bufs)
float* def_values = new float[num_ports];
lilv_plugin_get_port_ranges_float(plug, min_values, max_values, def_values);
- LilvValue context_pred = lilv_value_new_uri(info->lv2_world(),
+ LilvValue* context_pred = lilv_value_new_uri(info->lv2_world(),
"http://lv2plug.in/ns/ext/contexts#context");
- LilvValue default_pred = lilv_value_new_uri(info->lv2_world(),
+ LilvValue* default_pred = lilv_value_new_uri(info->lv2_world(),
"http://lv2plug.in/ns/lv2core#default");
- LilvValue min_size_pred = lilv_value_new_uri(info->lv2_world(),
+ LilvValue* min_size_pred = lilv_value_new_uri(info->lv2_world(),
"http://lv2plug.in/ns/ext/resize-port#minimumSize");
- LilvValue port_property_pred = lilv_value_new_uri(info->lv2_world(),
+ LilvValue* port_property_pred = lilv_value_new_uri(info->lv2_world(),
"http://lv2plug.in/ns/lv2core#portProperty");
- LilvValue supports_pred = lilv_value_new_uri(info->lv2_world(),
+ LilvValue* supports_pred = lilv_value_new_uri(info->lv2_world(),
"http://lv2plug.in/ns/ext/atom#supports");
//LilvValue as_large_as_pred = lilv_value_new_uri(info->lv2_world(),
// "http://lv2plug.in/ns/ext/resize-port#asLargeAs");
for (uint32_t j = 0; j < num_ports; ++j) {
- LilvPort id = lilv_plugin_get_port_by_index(plug, j);
+ const LilvPort* id = lilv_plugin_get_port_by_index(plug, j);
// LV2 port symbols are guaranteed to be unique, valid C identifiers
port_name = lilv_value_as_string(lilv_port_get_symbol(plug, id));
@@ -242,9 +242,9 @@ LV2Node::instantiate(BufferFactory& bufs)
if (data_type == PortType::VALUE || data_type == PortType::MESSAGE) {
// Get default value, and its length
- LilvValues defaults = lilv_port_get_value(plug, id, default_pred);
+ LilvValues* defaults = lilv_port_get_value(plug, id, default_pred);
LILV_FOREACH(values, i, defaults) {
- LilvValue d = lilv_values_get(defaults, i);
+ const LilvValue* d = lilv_values_get(defaults, i);
if (lilv_value_is_string(d)) {
const char* str_val = lilv_value_as_string(d);
const size_t str_val_len = strlen(str_val);
@@ -254,9 +254,9 @@ LV2Node::instantiate(BufferFactory& bufs)
}
// Get minimum size, if set in data
- LilvValues sizes = lilv_port_get_value(plug, id, min_size_pred);
+ LilvValues* sizes = lilv_port_get_value(plug, id, min_size_pred);
LILV_FOREACH(values, i, sizes) {
- LilvValue d = lilv_values_get(sizes, i);
+ const LilvValue* d = lilv_values_get(sizes, i);
if (lilv_value_is_int(d)) {
size_t size_val = lilv_value_as_int(d);
port_buffer_size = size_val;
@@ -296,26 +296,26 @@ LV2Node::instantiate(BufferFactory& bufs)
}
// Set lv2:portProperty properties
- LilvValues properties = lilv_port_get_value(plug, id, port_property_pred);
+ LilvValues* properties = lilv_port_get_value(plug, id, port_property_pred);
LILV_FOREACH(values, i, properties) {
- LilvValue p = lilv_values_get(properties, i);
+ const LilvValue* p = lilv_values_get(properties, i);
if (lilv_value_is_uri(p)) {
port->set_property(uris.lv2_portProperty, Raul::URI(lilv_value_as_uri(p)));
}
}
// Set atom:supports properties
- LilvValues types = lilv_port_get_value(plug, id, supports_pred);
+ LilvValues* types = lilv_port_get_value(plug, id, supports_pred);
LILV_FOREACH(values, i, types) {
- LilvValue type = lilv_values_get(types, i);
+ const LilvValue* type = lilv_values_get(types, i);
if (lilv_value_is_uri(type)) {
port->add_property(uris.atom_supports, Raul::URI(lilv_value_as_uri(type)));
}
}
- LilvValues contexts = lilv_port_get_value(plug, id, context_pred);
+ LilvValues* contexts = lilv_port_get_value(plug, id, context_pred);
LILV_FOREACH(values, i, contexts) {
- LilvValue c = lilv_values_get(contexts, i);
+ const LilvValue* c = lilv_values_get(contexts, i);
const char* context = lilv_value_as_string(c);
if (!strcmp(LV2_CONTEXTS_URI "#MessageContext", context)) {
if (!_message_funcs) {
diff --git a/src/server/LV2Node.hpp b/src/server/LV2Node.hpp
index 29a9d717..81a6113d 100644
--- a/src/server/LV2Node.hpp
+++ b/src/server/LV2Node.hpp
@@ -62,7 +62,9 @@ public:
IntrusivePtr<Buffer> buf, SampleCount offset);
protected:
- inline LilvInstance instance(uint32_t voice) { return (LilvInstance)(*_instances)[voice].get(); }
+ inline LilvInstance* instance(uint32_t voice) {
+ return (LilvInstance*)(*_instances)[voice].get();
+ }
typedef Raul::Array< SharedPtr<void> > Instances;
diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp
index 75476fa4..b9768f23 100644
--- a/src/server/LV2Plugin.cpp
+++ b/src/server/LV2Plugin.cpp
@@ -86,7 +86,7 @@ LV2Plugin::instantiate(BufferFactory& bufs,
}
void
-LV2Plugin::lilv_plugin(LilvPlugin p)
+LV2Plugin::lilv_plugin(const LilvPlugin* p)
{
_lilv_plugin = p;
}
@@ -96,7 +96,7 @@ LV2Plugin::library_path() const
{
static const std::string empty_string;
if (_library_path.empty()) {
- LilvValue v = lilv_plugin_get_library_uri(_lilv_plugin);
+ const LilvValue* v = lilv_plugin_get_library_uri(_lilv_plugin);
if (v) {
_library_path = lilv_uri_to_path(lilv_value_as_uri(v));
} else {
diff --git a/src/server/LV2Plugin.hpp b/src/server/LV2Plugin.hpp
index 127300cf..6e25c671 100644
--- a/src/server/LV2Plugin.hpp
+++ b/src/server/LV2Plugin.hpp
@@ -61,11 +61,11 @@ public:
const std::string& library_path() const;
- LilvPlugin lilv_plugin() const { return _lilv_plugin; }
- void lilv_plugin(LilvPlugin p);
+ const LilvPlugin* lilv_plugin() const { return _lilv_plugin; }
+ void lilv_plugin(const LilvPlugin* p);
private:
- LilvPlugin _lilv_plugin;
+ const LilvPlugin* _lilv_plugin;
SharedPtr<LV2Info> _lv2_info;
};
diff --git a/src/server/NodeFactory.cpp b/src/server/NodeFactory.cpp
index 90e1a84e..611f98ea 100644
--- a/src/server/NodeFactory.cpp
+++ b/src/server/NodeFactory.cpp
@@ -127,10 +127,10 @@ NodeFactory::load_internal_plugins()
void
NodeFactory::load_lv2_plugins()
{
- LilvPlugins plugins = lilv_world_get_all_plugins(_world->lilv_world());
+ const LilvPlugins* plugins = lilv_world_get_all_plugins(_world->lilv_world());
LILV_FOREACH(plugins, i, plugins) {
- LilvPlugin lv2_plug = lilv_plugins_get(plugins, i);
+ const LilvPlugin* lv2_plug = lilv_plugins_get(plugins, i);
const string uri(lilv_value_as_uri(lilv_plugin_get_uri(lv2_plug)));
diff --git a/src/shared/World.cpp b/src/shared/World.cpp
index 235bda91..e0bff450 100644
--- a/src/shared/World.cpp
+++ b/src/shared/World.cpp
@@ -177,7 +177,7 @@ public:
SharedPtr<Serialisation::Serialiser> serialiser;
SharedPtr<Serialisation::Parser> parser;
SharedPtr<Store> store;
- LilvWorld lilv_world;
+ LilvWorld* lilv_world;
std::string jack_uuid;
};
@@ -210,7 +210,7 @@ Raul::Configuration* World::conf() { return _impl->conf;
LV2Features* World::lv2_features() { return _impl->lv2_features; }
#ifdef HAVE_LILV
-LilvWorld World::lilv_world() { return _impl->lilv_world; }
+LilvWorld* World::lilv_world() { return _impl->lilv_world; }
#endif
Sord::World* World::rdf_world() { return _impl->rdf_world; }
SharedPtr<LV2URIMap> World::uris() { return _impl->uris; }
diff --git a/src/shared/World.hpp b/src/shared/World.hpp
index 44e2478e..76f40442 100644
--- a/src/shared/World.hpp
+++ b/src/shared/World.hpp
@@ -29,7 +29,7 @@
#include "raul/Configuration.hpp"
#include "raul/SharedPtr.hpp"
-typedef struct _LilvWorld* LilvWorld;
+typedef struct LilvWorldImpl LilvWorld;
namespace Sord { class World; }
@@ -99,7 +99,7 @@ public:
virtual LV2Features* lv2_features();
- virtual LilvWorld lilv_world();
+ virtual LilvWorld* lilv_world();
virtual void set_jack_uuid(const std::string& uuid);
virtual std::string jack_uuid();