diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/ingen.i | 2 | ||||
-rw-r--r-- | src/client/NodeModel.cpp | 22 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 142 | ||||
-rw-r--r-- | src/client/PluginModel.hpp | 30 | ||||
-rw-r--r-- | src/client/PluginUI.cpp | 32 | ||||
-rw-r--r-- | src/client/PluginUI.hpp | 4 | ||||
-rw-r--r-- | src/client/wscript | 2 | ||||
-rw-r--r-- | src/gui/App.cpp | 8 | ||||
-rw-r--r-- | src/gui/ConnectWindow.hpp | 4 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/NodeMenu.cpp | 84 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 2 | ||||
-rw-r--r-- | src/gui/PatchCanvas.cpp | 42 | ||||
-rw-r--r-- | src/gui/PatchCanvas.hpp | 8 | ||||
-rw-r--r-- | src/gui/wscript | 2 | ||||
-rw-r--r-- | src/ingen/wscript | 2 | ||||
-rw-r--r-- | src/serialisation/wscript | 2 | ||||
-rw-r--r-- | src/server/LV2Info.cpp | 28 | ||||
-rw-r--r-- | src/server/LV2Info.hpp | 22 | ||||
-rw-r--r-- | src/server/LV2Node.cpp | 122 | ||||
-rw-r--r-- | src/server/LV2Node.hpp | 4 | ||||
-rw-r--r-- | src/server/LV2Plugin.cpp | 10 | ||||
-rw-r--r-- | src/server/LV2Plugin.hpp | 12 | ||||
-rw-r--r-- | src/server/NodeFactory.cpp | 22 | ||||
-rw-r--r-- | src/server/NodeFactory.hpp | 6 | ||||
-rw-r--r-- | src/server/wscript | 4 | ||||
-rw-r--r-- | src/shared/World.cpp | 26 | ||||
-rw-r--r-- | src/shared/World.hpp | 6 | ||||
-rw-r--r-- | src/shared/wscript | 2 |
29 files changed, 327 insertions, 327 deletions
diff --git a/src/bindings/ingen.i b/src/bindings/ingen.i index c1207415..7eb99d57 100644 --- a/src/bindings/ingen.i +++ b/src/bindings/ingen.i @@ -39,7 +39,7 @@ namespace Ingen { namespace Shared { Ingen::Shared::script_iteration($self); } - /*SLV2World slv2() { return $self->me->slv2_world; }*/ + /*LILVWorld lilv() { return $self->me->lilv_world; }*/ }; } } diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index 34c70765..f7321472 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -169,14 +169,14 @@ NodeModel::default_port_value_range(SharedPtr<PortModel> port, float& min, float max = 1.0; // Get range from client-side LV2 data -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV if (_plugin && _plugin->type() == PluginModel::LV2) { if (!_min_values) { - _num_values = slv2_plugin_get_num_ports(_plugin->slv2_plugin()); + _num_values = lilv_plugin_get_num_ports(_plugin->lilv_plugin()); _min_values = new float[_num_values]; _max_values = new float[_num_values]; - slv2_plugin_get_port_ranges_float(_plugin->slv2_plugin(), + lilv_plugin_get_port_ranges_float(_plugin->lilv_plugin(), _min_values, _max_values, 0); } @@ -215,16 +215,16 @@ NodeModel::port_label(SharedPtr<PortModel> port) const return name.get_string(); } -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV if (_plugin && _plugin->type() == PluginModel::LV2) { - SLV2World c_world = _plugin->slv2_world(); - SLV2Plugin c_plugin = _plugin->slv2_plugin(); - SLV2Value c_sym = slv2_value_new_string(c_world, port->symbol().c_str()); - SLV2Port c_port = slv2_plugin_get_port_by_symbol(c_plugin, c_sym); + 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); if (c_port) { - SLV2Value c_name = slv2_port_get_name(c_plugin, c_port); - if (c_name && slv2_value_is_string(c_name)) { - return slv2_value_as_string(c_name); + 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); } } } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 77b3e4c9..dd22549b 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -35,9 +35,9 @@ using namespace Raul; namespace Ingen { namespace Client { -#ifdef HAVE_SLV2 -SLV2World PluginModel::_slv2_world = NULL; -SLV2Plugins PluginModel::_slv2_plugins = NULL; +#ifdef HAVE_LILV +LilvWorld PluginModel::_lilv_world = NULL; +LilvPlugins PluginModel::_lilv_plugins = NULL; #endif Sord::World* PluginModel::_rdf_world = NULL; @@ -51,10 +51,10 @@ 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_SLV2 - SLV2Value plugin_uri = slv2_value_new_uri(_slv2_world, uri.c_str()); - _slv2_plugin = slv2_plugins_get_by_uri(_slv2_plugins, plugin_uri); - slv2_value_free(plugin_uri); +#ifdef HAVE_LILV + 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 if (_type == Internal) set_property("http://usefulinc.com/ns/doap#name", @@ -97,29 +97,29 @@ PluginModel::get_property(const URI& key) const return get_property(key); } -#ifdef HAVE_SLV2 - if (_slv2_plugin) { +#ifdef HAVE_LILV + if (_lilv_plugin) { boost::optional<Raul::Atom&> ret; - SLV2Value lv2_pred = slv2_value_new_uri(_slv2_world, key.str().c_str()); - SLV2Values values = slv2_plugin_get_value(_slv2_plugin, lv2_pred); - slv2_value_free(lv2_pred); - SLV2_FOREACH(values, i, values) { - SLV2Value val = slv2_values_get(values, i); - if (slv2_value_is_uri(val)) { - ret = set_property(key, Atom(Atom::URI, slv2_value_as_uri(val))); + 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); + if (lilv_value_is_uri(val)) { + ret = set_property(key, Atom(Atom::URI, lilv_value_as_uri(val))); break; - } else if (slv2_value_is_string(val)) { - ret = set_property(key, slv2_value_as_string(val)); + } else if (lilv_value_is_string(val)) { + ret = set_property(key, lilv_value_as_string(val)); break; - } else if (slv2_value_is_float(val)) { - ret = set_property(key, Atom(slv2_value_as_float(val))); + } else if (lilv_value_is_float(val)) { + ret = set_property(key, Atom(lilv_value_as_float(val))); break; - } else if (slv2_value_is_int(val)) { - ret = set_property(key, Atom(slv2_value_as_int(val))); + } else if (lilv_value_is_int(val)) { + ret = set_property(key, Atom(lilv_value_as_int(val))); break; } } - slv2_values_free(values); + lilv_values_free(values); if (ret) return *ret; @@ -134,10 +134,10 @@ PluginModel::set(SharedPtr<PluginModel> p) { _type = p->_type; -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV _icon_path = p->_icon_path; - if (p->_slv2_plugin) - _slv2_plugin = p->_slv2_plugin; + if (p->_lilv_plugin) + _lilv_plugin = p->_lilv_plugin; #endif for (Properties::const_iterator v = p->properties().begin(); v != p->properties().end(); ++v) { @@ -171,24 +171,24 @@ PluginModel::human_name() string PluginModel::port_human_name(uint32_t index) const { -#ifdef HAVE_SLV2 - if (_slv2_plugin) { - SLV2Port port = slv2_plugin_get_port_by_index(_slv2_plugin, index); - SLV2Value name = slv2_port_get_name(_slv2_plugin, port); - string ret = slv2_value_as_string(name); - slv2_value_free(name); +#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); + lilv_value_free(name); return ret; } #endif return ""; } -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV bool PluginModel::has_ui() const { - SLV2UIs uis = slv2_plugin_get_uis(_slv2_plugin); - return (slv2_values_size(uis) > 0); + LilvUIs uis = lilv_plugin_get_uis(_lilv_plugin); + return (lilv_values_size(uis) > 0); } SharedPtr<PluginUI> @@ -197,7 +197,7 @@ PluginModel::ui(Ingen::Shared::World* world, SharedPtr<NodeModel> node) const if (_type != LV2) return SharedPtr<PluginUI>(); - SharedPtr<PluginUI> ret = PluginUI::create(world, node, _slv2_plugin); + SharedPtr<PluginUI> ret = PluginUI::create(world, node, _lilv_plugin); return ret; } @@ -205,7 +205,7 @@ const string& PluginModel::icon_path() const { if (_icon_path.empty() && _type == LV2) { - _icon_path = get_lv2_icon_path(_slv2_plugin); + _icon_path = get_lv2_icon_path(_lilv_plugin); } return _icon_path; @@ -213,22 +213,22 @@ PluginModel::icon_path() const /** RDF world mutex must be held by the caller */ string -PluginModel::get_lv2_icon_path(SLV2Plugin plugin) +PluginModel::get_lv2_icon_path(LilvPlugin plugin) { string result; - SLV2Value svg_icon_pred = slv2_value_new_uri(_slv2_world, + LilvValue svg_icon_pred = lilv_value_new_uri(_lilv_world, "http://ll-plugins.nongnu.org/lv2/namespace#svgIcon"); - SLV2Values paths = slv2_plugin_get_value(plugin, svg_icon_pred); + LilvValues paths = lilv_plugin_get_value(plugin, svg_icon_pred); - if (slv2_values_size(paths) > 0) { - SLV2Value value = slv2_values_get_first(paths); - if (slv2_value_is_uri(value)) - result = slv2_uri_to_path(slv2_value_as_string(value)); - slv2_values_free(paths); + if (lilv_values_size(paths) > 0) { + 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); } - slv2_value_free(svg_icon_pred); + lilv_value_free(svg_icon_pred); return result; } #endif @@ -237,23 +237,23 @@ std::string PluginModel::documentation() const { std::string doc; - #ifdef HAVE_SLV2 - if (!_slv2_plugin) + #ifdef HAVE_LILV + if (!_lilv_plugin) return doc; - //SLV2Value lv2_documentation = slv2_value_new_uri( - // _slv2_world, SLV2_NAMESPACE_LV2 "documentation"); - SLV2Value rdfs_comment = slv2_value_new_uri( - _slv2_world, "http://www.w3.org/2000/01/rdf-schema#comment"); + //LilvValue lv2_documentation = lilv_value_new_uri( + // _lilv_world, LILV_NAMESPACE_LV2 "documentation"); + LilvValue rdfs_comment = lilv_value_new_uri( + _lilv_world, "http://www.w3.org/2000/01/rdf-schema#comment"); - SLV2Values vals = slv2_plugin_get_value(_slv2_plugin, + LilvValues vals = lilv_plugin_get_value(_lilv_plugin, rdfs_comment); - SLV2Value val = slv2_values_get_first(vals); - if (slv2_value_is_string(val)) { - doc += slv2_value_as_string(val); + LilvValue val = lilv_values_get_first(vals); + if (lilv_value_is_string(val)) { + doc += lilv_value_as_string(val); } - slv2_value_free(rdfs_comment); - slv2_values_free(vals); + lilv_value_free(rdfs_comment); + lilv_values_free(vals); #endif return doc; } @@ -262,26 +262,26 @@ std::string PluginModel::port_documentation(uint32_t index) const { std::string doc; - #ifdef HAVE_SLV2 - if (!_slv2_plugin) + #ifdef HAVE_LILV + if (!_lilv_plugin) return doc; - SLV2Port port = slv2_plugin_get_port_by_index(_slv2_plugin, index); + LilvPort port = lilv_plugin_get_port_by_index(_lilv_plugin, index); - //SLV2Value lv2_documentation = slv2_value_new_uri( - // _slv2_world, SLV2_NAMESPACE_LV2 "documentation"); - SLV2Value rdfs_comment = slv2_value_new_uri( - _slv2_world, "http://www.w3.org/2000/01/rdf-schema#comment"); + //LilvValue lv2_documentation = lilv_value_new_uri( + // _lilv_world, LILV_NAMESPACE_LV2 "documentation"); + LilvValue rdfs_comment = lilv_value_new_uri( + _lilv_world, "http://www.w3.org/2000/01/rdf-schema#comment"); - SLV2Values vals = slv2_port_get_value(_slv2_plugin, + LilvValues vals = lilv_port_get_value(_lilv_plugin, port, rdfs_comment); - SLV2Value val = slv2_values_get_first(vals); - if (slv2_value_is_string(val)) { - doc += slv2_value_as_string(val); + LilvValue val = lilv_values_get_first(vals); + if (lilv_value_is_string(val)) { + doc += lilv_value_as_string(val); } - slv2_value_free(rdfs_comment); - slv2_values_free(vals); + lilv_value_free(rdfs_comment); + lilv_values_free(vals); #endif return doc; } diff --git a/src/client/PluginModel.hpp b/src/client/PluginModel.hpp index 0d72af12..e7076ff2 100644 --- a/src/client/PluginModel.hpp +++ b/src/client/PluginModel.hpp @@ -27,8 +27,8 @@ #include "ingen-config.h" -#ifdef HAVE_SLV2 -#include "slv2/slv2.h" +#ifdef HAVE_LILV +#include "lilv/lilv.h" #endif #include "ingen/ServerInterface.hpp" #include "ingen/Plugin.hpp" @@ -67,17 +67,17 @@ public: std::string human_name(); std::string port_human_name(uint32_t index) const; -#ifdef HAVE_SLV2 - static SLV2World slv2_world() { return _slv2_world; } - SLV2Plugin slv2_plugin() const { return _slv2_plugin; } +#ifdef HAVE_LILV + static LilvWorld lilv_world() { return _lilv_world; } + LilvPlugin lilv_plugin() const { return _lilv_plugin; } - SLV2Port slv2_port(uint32_t index) { - return slv2_plugin_get_port_by_index(_slv2_plugin, index); + LilvPort lilv_port(uint32_t index) { + return lilv_plugin_get_port_by_index(_lilv_plugin, index); } - static void set_slv2_world(SLV2World world) { - _slv2_world = world; - _slv2_plugins = slv2_world_get_all_plugins(_slv2_world); + static void set_lilv_world(LilvWorld world) { + _lilv_world = world; + _lilv_plugins = lilv_world_get_all_plugins(_lilv_world); } bool has_ui() const; @@ -86,7 +86,7 @@ public: SharedPtr<NodeModel> node) const; const std::string& icon_path() const; - static std::string get_lv2_icon_path(SLV2Plugin plugin); + static std::string get_lv2_icon_path(LilvPlugin plugin); #endif std::string documentation() const; @@ -109,11 +109,11 @@ protected: private: Type _type; -#ifdef HAVE_SLV2 - static SLV2World _slv2_world; - static SLV2Plugins _slv2_plugins; +#ifdef HAVE_LILV + static LilvWorld _lilv_world; + static LilvPlugins _lilv_plugins; - SLV2Plugin _slv2_plugin; + LilvPlugin _lilv_plugin; mutable std::string _icon_path; #endif diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index f8232426..437e0f27 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, - SLV2Plugin plugin) + LilvPlugin plugin) { if (!PluginUI::ui_host) { PluginUI::ui_host = suil_host_new(lv2_ui_write, NULL, NULL, NULL); @@ -125,14 +125,14 @@ PluginUI::create(Ingen::Shared::World* world, static const char* gtk_ui_uri = "http://lv2plug.in/ns/extensions/ui#GtkUI"; - SLV2Value gtk_ui = slv2_value_new_uri(world->slv2_world(), gtk_ui_uri); + LilvValue gtk_ui = lilv_value_new_uri(world->lilv_world(), gtk_ui_uri); - SLV2UIs uis = slv2_plugin_get_uis(plugin); - SLV2UI ui = NULL; - SLV2Value ui_type = NULL; - SLV2_FOREACH(uis, u, uis) { - SLV2UI this_ui = slv2_uis_get(uis, u); - if (slv2_ui_is_supported(this_ui, + LilvUIs uis = lilv_plugin_get_uis(plugin); + LilvUI ui = NULL; + LilvValue ui_type = NULL; + LILV_FOREACH(uis, u, uis) { + LilvUI this_ui = lilv_uis_get(uis, u); + if (lilv_ui_is_supported(this_ui, suil_ui_supported, gtk_ui, &ui_type)) { @@ -143,7 +143,7 @@ PluginUI::create(Ingen::Shared::World* world, } if (!ui) { - slv2_value_free(gtk_ui); + lilv_value_free(gtk_ui); return SharedPtr<PluginUI>(); } @@ -153,15 +153,15 @@ PluginUI::create(Ingen::Shared::World* world, SuilInstance* instance = suil_instance_new( PluginUI::ui_host, ret.get(), - slv2_value_as_uri(gtk_ui), - slv2_value_as_uri(slv2_plugin_get_uri(plugin)), - slv2_value_as_uri(slv2_ui_get_uri(ui)), - slv2_value_as_uri(ui_type), - slv2_uri_to_path(slv2_value_as_uri(slv2_ui_get_bundle_uri(ui))), - slv2_uri_to_path(slv2_value_as_uri(slv2_ui_get_binary_uri(ui))), + lilv_value_as_uri(gtk_ui), + lilv_value_as_uri(lilv_plugin_get_uri(plugin)), + lilv_value_as_uri(lilv_ui_get_uri(ui)), + lilv_value_as_uri(ui_type), + lilv_uri_to_path(lilv_value_as_uri(lilv_ui_get_bundle_uri(ui))), + lilv_uri_to_path(lilv_value_as_uri(lilv_ui_get_binary_uri(ui))), ret->_features->array()); - slv2_value_free(gtk_ui); + lilv_value_free(gtk_ui); if (instance) { ret->_instance = instance; diff --git a/src/client/PluginUI.hpp b/src/client/PluginUI.hpp index d2e13d9d..fd8d14f4 100644 --- a/src/client/PluginUI.hpp +++ b/src/client/PluginUI.hpp @@ -20,7 +20,7 @@ #include "raul/SharedPtr.hpp" -#include "slv2/slv2.h" +#include "lilv/lilv.h" #include "suil/suil.h" @@ -46,7 +46,7 @@ public: static SharedPtr<PluginUI> create(Ingen::Shared::World* world, SharedPtr<NodeModel> node, - SLV2Plugin plugin); + LilvPlugin plugin); SuilWidget get_widget(); diff --git a/src/client/wscript b/src/client/wscript index be1e64f1..99b1c1b6 100644 --- a/src/client/wscript +++ b/src/client/wscript @@ -36,4 +36,4 @@ def build(bld): obj.target = 'ingen_client' obj.install_path = '${LIBDIR}' obj.use = 'libingen_shared' - autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE SLV2 SUIL RAUL SORD SOUP SIGCPP LIBLO SOUP') + autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE LILV SUIL RAUL SORD SOUP SIGCPP LIBLO SOUP') diff --git a/src/gui/App.cpp b/src/gui/App.cpp index e4a8c167..7c15701e 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -49,8 +49,8 @@ #include "ThreadedLoader.hpp" #include "WindowFactory.hpp" #include "Port.hpp" -#ifdef HAVE_SLV2 -#include "slv2/slv2.h" +#ifdef HAVE_LILV +#include "lilv/lilv.h" #endif using namespace std; @@ -92,8 +92,8 @@ App::App(Ingen::Shared::World* world) PluginModel::set_rdf_world(*world->rdf_world()); -#ifdef HAVE_SLV2 - PluginModel::set_slv2_world(world->slv2_world()); +#ifdef HAVE_LILV + PluginModel::set_lilv_world(world->lilv_world()); #endif } diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp index 1e5fdd37..92f29f16 100644 --- a/src/gui/ConnectWindow.hpp +++ b/src/gui/ConnectWindow.hpp @@ -20,8 +20,8 @@ #include "ingen-config.h" -#ifdef HAVE_SLV2 -#include "slv2/slv2.h" +#ifdef HAVE_LILV +#include "lilv/lilv.h" #endif #include <gtkmm.h> diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index cf780f2d..d305e4fb 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -243,7 +243,7 @@ LoadPluginWindow::set_row(Gtk::TreeModel::Row& row, SharedPtr<PluginModel> plugi void LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin) { - if (plugin->slv2_plugin() && slv2_plugin_is_replaced(plugin->slv2_plugin())) { + if (plugin->lilv_plugin() && lilv_plugin_is_replaced(plugin->lilv_plugin())) { return; } diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index e89f0d41..0c5c88fb 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -84,38 +84,38 @@ NodeMenu::init(SharedPtr<NodeModel> node) _embed_gui_menuitem->hide(); } -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV if (plugin && plugin->type() == PluginModel::LV2) { - SLV2Value preset_pred = slv2_value_new_uri( - plugin->slv2_world(), + LilvValue preset_pred = lilv_value_new_uri( + plugin->lilv_world(), "http://lv2plug.in/ns/dev/presets#hasPreset"); - SLV2Value title_pred = slv2_value_new_uri( - plugin->slv2_world(), + LilvValue title_pred = lilv_value_new_uri( + plugin->lilv_world(), "http://dublincore.org/documents/dcmi-namespace/title"); - SLV2Values presets = slv2_plugin_get_value( - plugin->slv2_plugin(), preset_pred); + LilvValues presets = lilv_plugin_get_value( + plugin->lilv_plugin(), preset_pred); if (presets) { _presets_menu = Gtk::manage(new Gtk::Menu()); - SLV2_FOREACH(values, i, presets) { - SLV2Value uri = slv2_values_get(presets, i); - SLV2Values titles = slv2_plugin_get_value_for_subject( - plugin->slv2_plugin(), uri, title_pred); + LILV_FOREACH(values, i, presets) { + LilvValue uri = lilv_values_get(presets, i); + LilvValues titles = lilv_plugin_get_value_for_subject( + plugin->lilv_plugin(), uri, title_pred); if (titles) { - SLV2Value title = slv2_values_get_first(titles); + LilvValue title = lilv_values_get_first(titles); _presets_menu->items().push_back( Gtk::Menu_Helpers::MenuElem( - slv2_value_as_string(title), + lilv_value_as_string(title), sigc::bind( sigc::mem_fun(this, &NodeMenu::on_preset_activated), - string(slv2_value_as_string(uri))))); + string(lilv_value_as_string(uri))))); // I have no idea why this is necessary, signal_activated doesn't work // in this menu (and only this menu) Gtk::MenuItem* item = &(_presets_menu->items().back()); item->signal_button_release_event().connect( sigc::bind<0>(sigc::mem_fun(this, &NodeMenu::on_preset_clicked), - string(slv2_value_as_string(uri)))); + string(lilv_value_as_string(uri)))); } } items().push_front(Gtk::Menu_Helpers::SeparatorElem()); @@ -124,9 +124,9 @@ NodeMenu::init(SharedPtr<NodeModel> node) Gtk::MenuItem* presets_menu_item = &(items().front()); presets_menu_item->set_submenu(*_presets_menu); } - slv2_values_free(presets); - slv2_value_free(title_pred); - slv2_value_free(preset_pred); + lilv_values_free(presets); + lilv_value_free(title_pred); + lilv_value_free(preset_pred); } #endif @@ -178,45 +178,45 @@ NodeMenu::on_menu_disconnect() void NodeMenu::on_preset_activated(const std::string& uri) { -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV const NodeModel* const node = (NodeModel*)_object.get(); const PluginModel* const plugin = dynamic_cast<const PluginModel*>(node->plugin()); - SLV2Value port_pred = slv2_value_new_uri( - plugin->slv2_world(), + LilvValue port_pred = lilv_value_new_uri( + plugin->lilv_world(), "http://lv2plug.in/ns/lv2core#port"); - SLV2Value symbol_pred = slv2_value_new_uri( - plugin->slv2_world(), + LilvValue symbol_pred = lilv_value_new_uri( + plugin->lilv_world(), "http://lv2plug.in/ns/lv2core#symbol"); - SLV2Value value_pred = slv2_value_new_uri( - plugin->slv2_world(), + LilvValue value_pred = lilv_value_new_uri( + plugin->lilv_world(), "http://lv2plug.in/ns/ext/presets#value"); - SLV2Value subject = slv2_value_new_uri(plugin->slv2_world(), uri.c_str()); - SLV2Values ports = slv2_plugin_get_value_for_subject( - plugin->slv2_plugin(), + 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(); - SLV2_FOREACH(values, i, ports) { - SLV2Value uri = slv2_values_get(ports, i); - SLV2Values values = slv2_plugin_get_value_for_subject( - plugin->slv2_plugin(), uri, value_pred); - SLV2Values symbols = slv2_plugin_get_value_for_subject( - plugin->slv2_plugin(), uri, symbol_pred); + LILV_FOREACH(values, i, ports) { + 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( + plugin->lilv_plugin(), uri, symbol_pred); if (values && symbols) { - SLV2Value val = slv2_values_get_first(values); - SLV2Value sym = slv2_values_get_first(symbols); + LilvValue val = lilv_values_get_first(values); + LilvValue sym = lilv_values_get_first(symbols); App::instance().engine()->set_property( - node->path().base() + slv2_value_as_string(sym), + node->path().base() + lilv_value_as_string(sym), App::instance().uris().ingen_value, - slv2_value_as_float(val)); + lilv_value_as_float(val)); } } App::instance().engine()->bundle_end(); - slv2_values_free(ports); - slv2_value_free(value_pred); - slv2_value_free(symbol_pred); - slv2_value_free(port_pred); + lilv_values_free(ports); + lilv_value_free(value_pred); + lilv_value_free(symbol_pred); + lilv_value_free(port_pred); #endif } diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index d8f22ecd..497d0461 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -289,7 +289,7 @@ NodeModule::remove_port(SharedPtr<PortModel> model) bool NodeModule::popup_gui() { -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV if (_node->plugin() && _node->plugin()->type() == PluginModel::LV2) { if (_plugin_ui) { warn << "LV2 GUI already embedded, cannot pop up" << endl; diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 9ff0ba31..e8532007 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -167,7 +167,7 @@ PatchCanvas::build_menus() } // Build skeleton LV2 plugin class heirarchy for 'Plugin' menu -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV if (!_plugin_menu) build_plugin_menu(); @@ -189,7 +189,7 @@ PatchCanvas::build_menus() add_plugin(i->second); } -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV /** Recursively build the plugin class menu heirarchy rooted at * @a plugin class into @a menu @@ -197,12 +197,12 @@ PatchCanvas::build_menus() size_t PatchCanvas::build_plugin_class_menu( Gtk::Menu* menu, - SLV2PluginClass plugin_class, SLV2PluginClasses classes, const LV2Children& children, + LilvPluginClass plugin_class, LilvPluginClasses classes, const LV2Children& children, std::set<const char*>& ancestors) { size_t num_items = 0; - SLV2Value class_uri = slv2_plugin_class_get_uri(plugin_class); - const char* class_uri_str = slv2_value_as_string(class_uri); + 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,9 +213,9 @@ PatchCanvas::build_plugin_class_menu( // Add submenus ancestors.insert(class_uri_str); for (LV2Children::const_iterator i = kids.first; i != kids.second; ++i) { - SLV2PluginClass c = i->second; - const char* sub_label_str = slv2_value_as_string(slv2_plugin_class_get_label(c)); - const char* sub_uri_str = slv2_value_as_string(slv2_plugin_class_get_uri(c)); + 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()) { LOG(warn) << "Infinite LV2 class recursion: " << class_uri_str << " <: " << sub_uri_str << endl; @@ -259,16 +259,16 @@ PatchCanvas::build_plugin_menu() _menu->reorder_child(*plugin_menu_item, 5); } - SLV2PluginClass lv2_plugin = slv2_world_get_plugin_class(PluginModel::slv2_world()); - SLV2PluginClasses classes = slv2_world_get_plugin_classes(PluginModel::slv2_world()); + LilvPluginClass lv2_plugin = lilv_world_get_plugin_class(PluginModel::lilv_world()); + LilvPluginClasses classes = lilv_world_get_plugin_classes(PluginModel::lilv_world()); LV2Children children; - SLV2_FOREACH(plugin_classes, i, classes) { - SLV2PluginClass c = slv2_plugin_classes_get(classes, i); - SLV2Value p = slv2_plugin_class_get_parent_uri(c); + LILV_FOREACH(plugin_classes, i, classes) { + LilvPluginClass c = lilv_plugin_classes_get(classes, i); + LilvValue p = lilv_plugin_class_get_parent_uri(c); if (!p) - p = slv2_plugin_class_get_uri(lv2_plugin); - children.insert(make_pair(slv2_value_as_string(p), c)); + p = lilv_plugin_class_get_uri(lv2_plugin); + children.insert(make_pair(lilv_value_as_string(p), c)); } std::set<const char*> ancestors; build_plugin_class_menu(_plugin_menu, lv2_plugin, classes, children, ancestors); @@ -345,18 +345,18 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p) if (_internal_menu && p->type() == Plugin::Internal) { _internal_menu->items().push_back(Gtk::Menu_Helpers::MenuElem(p->human_name(), sigc::bind(sigc::mem_fun(this, &PatchCanvas::load_plugin), p))); - } else if (_plugin_menu && p->type() == Plugin::LV2 && p->slv2_plugin()) { - if (slv2_plugin_is_replaced(p->slv2_plugin())) { + } else if (_plugin_menu && p->type() == Plugin::LV2 && p->lilv_plugin()) { + if (lilv_plugin_is_replaced(p->lilv_plugin())) { //info << (boost::format("[Menu] LV2 plugin <%s> hidden") % p->uri()) << endl; return; } - SLV2PluginClass pc = slv2_plugin_get_class(p->slv2_plugin()); - SLV2Value class_uri = slv2_plugin_class_get_uri(pc); - const char* class_uri_str = slv2_value_as_string(class_uri); + 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); Glib::RefPtr<Gdk::Pixbuf> icon = App::instance().icon_from_path( - PluginModel::get_lv2_icon_path(p->slv2_plugin()), 16); + PluginModel::get_lv2_icon_path(p->lilv_plugin()), 16); pair<iterator,iterator> range = _class_menus.equal_range(class_uri_str); if (range.first == _class_menus.end() || range.first == range.second diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index f55fca58..7be3a813 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -110,13 +110,13 @@ private: void auto_menu_position(int& x, int& y, bool& push_in); -#ifdef HAVE_SLV2 - typedef std::multimap<const std::string, SLV2PluginClass> LV2Children; +#ifdef HAVE_LILV + typedef std::multimap<const std::string, LilvPluginClass> LV2Children; void build_plugin_menu(); size_t build_plugin_class_menu( Gtk::Menu* menu, - SLV2PluginClass plugin_class, - SLV2PluginClasses classes, + LilvPluginClass plugin_class, + LilvPluginClasses classes, const LV2Children& children, std::set<const char*>& ancestors); #endif diff --git a/src/gui/wscript b/src/gui/wscript index cef45ccb..f5f28499 100644 --- a/src/gui/wscript +++ b/src/gui/wscript @@ -62,7 +62,7 @@ def build(bld): SORD SIGCPP LV2CORE - SLV2 + LILV SOUP SUIL ''') diff --git a/src/ingen/wscript b/src/ingen/wscript index 97750515..b5c09105 100644 --- a/src/ingen/wscript +++ b/src/ingen/wscript @@ -9,6 +9,6 @@ def build(bld): obj.defines = 'VERSION="' + bld.env['INGEN_VERSION'] + '"' obj.use = 'libingen_shared' obj.install_path = '${BINDIR}' - autowaf.use_lib(bld, obj, 'GTHREAD GLIBMM SORD RAUL LV2CORE SLV2 INGEN LIBLO SOUP') + autowaf.use_lib(bld, obj, 'GTHREAD GLIBMM SORD RAUL LV2CORE LILV INGEN LIBLO SOUP') bld.install_files('${DATADIR}/applications', 'ingen.desktop') diff --git a/src/serialisation/wscript b/src/serialisation/wscript index 7e9ddbf8..69b457fb 100644 --- a/src/serialisation/wscript +++ b/src/serialisation/wscript @@ -17,4 +17,4 @@ def build(bld): obj.target = 'ingen_serialisation' obj.install_path = '${LIBDIR}' obj.use = 'libingen_shared' - autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE SLV2 RAUL SORD') + autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE LILV RAUL SORD') diff --git a/src/server/LV2Info.cpp b/src/server/LV2Info.cpp index 6ce5792b..ea263f91 100644 --- a/src/server/LV2Info.cpp +++ b/src/server/LV2Info.cpp @@ -39,14 +39,14 @@ namespace Ingen { namespace Server { LV2Info::LV2Info(Ingen::Shared::World* world) - : input_class(slv2_value_new_uri(world->slv2_world(), SLV2_PORT_CLASS_INPUT)) - , output_class(slv2_value_new_uri(world->slv2_world(), SLV2_PORT_CLASS_OUTPUT)) - , control_class(slv2_value_new_uri(world->slv2_world(), SLV2_PORT_CLASS_CONTROL)) - , audio_class(slv2_value_new_uri(world->slv2_world(), SLV2_PORT_CLASS_AUDIO)) - , event_class(slv2_value_new_uri(world->slv2_world(), SLV2_PORT_CLASS_EVENT)) - , value_port_class(slv2_value_new_uri(world->slv2_world(), + : input_class(lilv_value_new_uri(world->lilv_world(), LILV_PORT_CLASS_INPUT)) + , output_class(lilv_value_new_uri(world->lilv_world(), LILV_PORT_CLASS_OUTPUT)) + , control_class(lilv_value_new_uri(world->lilv_world(), LILV_PORT_CLASS_CONTROL)) + , audio_class(lilv_value_new_uri(world->lilv_world(), LILV_PORT_CLASS_AUDIO)) + , event_class(lilv_value_new_uri(world->lilv_world(), LILV_PORT_CLASS_EVENT)) + , value_port_class(lilv_value_new_uri(world->lilv_world(), "http://lv2plug.in/ns/ext/atom#ValuePort")) - , message_port_class(slv2_value_new_uri(world->slv2_world(), + , message_port_class(lilv_value_new_uri(world->lilv_world(), "http://lv2plug.in/ns/ext/atom#MessagePort")) , _world(world) { @@ -64,13 +64,13 @@ LV2Info::LV2Info(Ingen::Shared::World* world) LV2Info::~LV2Info() { - slv2_value_free(input_class); - slv2_value_free(output_class); - slv2_value_free(control_class); - slv2_value_free(audio_class); - slv2_value_free(event_class); - slv2_value_free(value_port_class); - slv2_value_free(message_port_class); + lilv_value_free(input_class); + lilv_value_free(output_class); + lilv_value_free(control_class); + lilv_value_free(audio_class); + lilv_value_free(event_class); + lilv_value_free(value_port_class); + lilv_value_free(message_port_class); } } // namespace Server diff --git a/src/server/LV2Info.hpp b/src/server/LV2Info.hpp index de252d82..4f3e45f1 100644 --- a/src/server/LV2Info.hpp +++ b/src/server/LV2Info.hpp @@ -19,13 +19,13 @@ #define INGEN_ENGINE_LV2INFO_HPP #include "ingen-config.h" -#ifndef HAVE_SLV2 -#error "This file requires SLV2, but HAVE_SLV2 is not defined. Please report." +#ifndef HAVE_LILV +#error "This file requires Lilv, but HAVE_LILV is not defined. Please report." #endif #include <map> #include <string> -#include "slv2/slv2.h" +#include "lilv/lilv.h" #include "shared/World.hpp" namespace Ingen { @@ -41,16 +41,16 @@ public: explicit LV2Info(Ingen::Shared::World* world); ~LV2Info(); - SLV2Value input_class; - SLV2Value output_class; - SLV2Value control_class; - SLV2Value audio_class; - SLV2Value event_class; - SLV2Value value_port_class; - SLV2Value 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; } - SLV2World lv2_world() { return _world->slv2_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 48d00a6d..04d48905 100644 --- a/src/server/LV2Node.cpp +++ b/src/server/LV2Node.cpp @@ -81,9 +81,9 @@ LV2Node::prepare_poly(BufferFactory& bufs, uint32_t poly) _prepared_instances = new Instances(poly, *_instances, SharedPtr<void>()); for (uint32_t i = _polyphony; i < _prepared_instances->size(); ++i) { _prepared_instances->at(i) = SharedPtr<void>( - slv2_plugin_instantiate( - _lv2_plugin->slv2_plugin(), _srate, _features->array()), - slv2_instance_free); + lilv_plugin_instantiate( + _lv2_plugin->lilv_plugin(), _srate, _features->array()), + lilv_instance_free); if (!_prepared_instances->at(i)) { error << "Failed to instantiate plugin" << endl; @@ -104,7 +104,7 @@ LV2Node::prepare_poly(BufferFactory& bufs, uint32_t poly) } if (_activated) - slv2_instance_activate((SLV2Instance)(*_prepared_instances)[i].get()); + lilv_instance_activate((LilvInstance)(*_prepared_instances)[i].get()); } return true; @@ -139,9 +139,9 @@ LV2Node::instantiate(BufferFactory& bufs) { const Ingen::Shared::LV2URIMap& uris = bufs.uris(); SharedPtr<LV2Info> info = _lv2_plugin->lv2_info(); - SLV2Plugin plug = _lv2_plugin->slv2_plugin(); + LilvPlugin plug = _lv2_plugin->lilv_plugin(); - uint32_t num_ports = slv2_plugin_get_num_ports(plug); + uint32_t num_ports = lilv_plugin_get_num_ports(plug); assert(num_ports > 0); _ports = new Raul::Array<PortImpl*>(num_ports, NULL); @@ -150,13 +150,13 @@ LV2Node::instantiate(BufferFactory& bufs) _features = info->world().lv2_features()->lv2_features(&info->world(), this); uint32_t port_buffer_size = 0; - SLV2Value ctx_ext_uri = slv2_value_new_uri(info->lv2_world(), + 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>( - slv2_plugin_instantiate(plug, _srate, _features->array()), - slv2_instance_free); + lilv_plugin_instantiate(plug, _srate, _features->array()), + lilv_instance_free); if (!instance(i)) { error << "Failed to instantiate plugin " << _lv2_plugin->uri() @@ -164,10 +164,10 @@ LV2Node::instantiate(BufferFactory& bufs) return false; } - if (!slv2_plugin_has_feature(plug, ctx_ext_uri)) + if (!lilv_plugin_has_feature(plug, ctx_ext_uri)) continue; - const void* ctx_ext = slv2_instance_get_extension_data( + const void* ctx_ext = lilv_instance_get_extension_data( instance(i), LV2_CONTEXTS_URI "#MessageContext"); if (i == 0 && ctx_ext) { @@ -176,7 +176,7 @@ LV2Node::instantiate(BufferFactory& bufs) } } - slv2_value_free(ctx_ext_uri); + lilv_value_free(ctx_ext_uri); string port_name; Path port_path; @@ -187,31 +187,31 @@ LV2Node::instantiate(BufferFactory& bufs) float* min_values = new float[num_ports]; float* max_values = new float[num_ports]; float* def_values = new float[num_ports]; - slv2_plugin_get_port_ranges_float(plug, min_values, max_values, def_values); + lilv_plugin_get_port_ranges_float(plug, min_values, max_values, def_values); - SLV2Value context_pred = slv2_value_new_uri(info->lv2_world(), + LilvValue context_pred = lilv_value_new_uri(info->lv2_world(), "http://lv2plug.in/ns/ext/contexts#context"); - SLV2Value default_pred = slv2_value_new_uri(info->lv2_world(), + LilvValue default_pred = lilv_value_new_uri(info->lv2_world(), "http://lv2plug.in/ns/lv2core#default"); - SLV2Value min_size_pred = slv2_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"); - SLV2Value port_property_pred = slv2_value_new_uri(info->lv2_world(), + LilvValue port_property_pred = lilv_value_new_uri(info->lv2_world(), "http://lv2plug.in/ns/lv2core#portProperty"); - SLV2Value supports_pred = slv2_value_new_uri(info->lv2_world(), + LilvValue supports_pred = lilv_value_new_uri(info->lv2_world(), "http://lv2plug.in/ns/ext/atom#supports"); - //SLV2Value as_large_as_pred = slv2_value_new_uri(info->lv2_world(), + //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) { - SLV2Port id = slv2_plugin_get_port_by_index(plug, j); + LilvPort id = lilv_plugin_get_port_by_index(plug, j); // LV2 port symbols are guaranteed to be unique, valid C identifiers - port_name = slv2_value_as_string(slv2_port_get_symbol(plug, id)); + port_name = lilv_value_as_string(lilv_port_get_symbol(plug, id)); if (!Symbol::is_valid(port_name)) { error << "Plugin " << _lv2_plugin->uri() << " port " << j @@ -226,15 +226,15 @@ LV2Node::instantiate(BufferFactory& bufs) Raul::Atom val; PortType data_type = PortType::UNKNOWN; - if (slv2_port_is_a(plug, id, info->control_class)) { + if (lilv_port_is_a(plug, id, info->control_class)) { data_type = PortType::CONTROL; - } else if (slv2_port_is_a(plug, id, info->audio_class)) { + } else if (lilv_port_is_a(plug, id, info->audio_class)) { data_type = PortType::AUDIO; - } else if (slv2_port_is_a(plug, id, info->event_class)) { + } else if (lilv_port_is_a(plug, id, info->event_class)) { data_type = PortType::EVENTS; - } else if (slv2_port_is_a(plug, id, info->value_port_class)) { + } else if (lilv_port_is_a(plug, id, info->value_port_class)) { data_type = PortType::VALUE; - } else if (slv2_port_is_a(plug, id, info->message_port_class)) { + } else if (lilv_port_is_a(plug, id, info->message_port_class)) { data_type = PortType::MESSAGE; } @@ -242,11 +242,11 @@ LV2Node::instantiate(BufferFactory& bufs) if (data_type == PortType::VALUE || data_type == PortType::MESSAGE) { // Get default value, and its length - SLV2Values defaults = slv2_port_get_value(plug, id, default_pred); - SLV2_FOREACH(values, i, defaults) { - SLV2Value d = slv2_values_get(defaults, i); - if (slv2_value_is_string(d)) { - const char* str_val = slv2_value_as_string(d); + LilvValues defaults = lilv_port_get_value(plug, id, default_pred); + LILV_FOREACH(values, i, defaults) { + 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); val = str_val; port_buffer_size = str_val_len; @@ -254,20 +254,20 @@ LV2Node::instantiate(BufferFactory& bufs) } // Get minimum size, if set in data - SLV2Values sizes = slv2_port_get_value(plug, id, min_size_pred); - SLV2_FOREACH(values, i, sizes) { - SLV2Value d = slv2_values_get(sizes, i); - if (slv2_value_is_int(d)) { - size_t size_val = slv2_value_as_int(d); + LilvValues sizes = lilv_port_get_value(plug, id, min_size_pred); + LILV_FOREACH(values, i, sizes) { + 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; } } } enum { UNKNOWN, INPUT, OUTPUT } direction = UNKNOWN; - if (slv2_port_is_a(plug, id, info->input_class)) { + if (lilv_port_is_a(plug, id, info->input_class)) { direction = INPUT; - } else if (slv2_port_is_a(plug, id, info->output_class)) { + } else if (lilv_port_is_a(plug, id, info->output_class)) { direction = OUTPUT; } @@ -296,27 +296,27 @@ LV2Node::instantiate(BufferFactory& bufs) } // Set lv2:portProperty properties - SLV2Values properties = slv2_port_get_value(plug, id, port_property_pred); - SLV2_FOREACH(values, i, properties) { - SLV2Value p = slv2_values_get(properties, i); - if (slv2_value_is_uri(p)) { - port->set_property(uris.lv2_portProperty, Raul::URI(slv2_value_as_uri(p))); + LilvValues properties = lilv_port_get_value(plug, id, port_property_pred); + LILV_FOREACH(values, i, properties) { + 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 - SLV2Values types = slv2_port_get_value(plug, id, supports_pred); - SLV2_FOREACH(values, i, types) { - SLV2Value type = slv2_values_get(types, i); - if (slv2_value_is_uri(type)) { - port->add_property(uris.atom_supports, Raul::URI(slv2_value_as_uri(type))); + LilvValues types = lilv_port_get_value(plug, id, supports_pred); + LILV_FOREACH(values, i, types) { + 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))); } } - SLV2Values contexts = slv2_port_get_value(plug, id, context_pred); - SLV2_FOREACH(values, i, contexts) { - SLV2Value c = slv2_values_get(contexts, i); - const char* context = slv2_value_as_string(c); + LilvValues contexts = lilv_port_get_value(plug, id, context_pred); + LILV_FOREACH(values, i, contexts) { + 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) { warn << _lv2_plugin->uri() @@ -325,7 +325,7 @@ LV2Node::instantiate(BufferFactory& bufs) port->set_context(Context::MESSAGE); } else { warn << _lv2_plugin->uri() << " port " << i << " has unknown context " - << slv2_value_as_string(c) + << lilv_value_as_string(c) << endl; } } @@ -343,10 +343,10 @@ LV2Node::instantiate(BufferFactory& bufs) delete[] min_values; delete[] max_values; delete[] def_values; - slv2_value_free(context_pred); - slv2_value_free(default_pred); - slv2_value_free(min_size_pred); - slv2_value_free(port_property_pred); + lilv_value_free(context_pred); + lilv_value_free(default_pred); + lilv_value_free(min_size_pred); + lilv_value_free(port_property_pred); return ret; } @@ -357,7 +357,7 @@ LV2Node::activate(BufferFactory& bufs) NodeImpl::activate(bufs); for (uint32_t i = 0; i < _polyphony; ++i) - slv2_instance_activate(instance(i)); + lilv_instance_activate(instance(i)); } void @@ -366,7 +366,7 @@ LV2Node::deactivate() NodeImpl::deactivate(); for (uint32_t i = 0; i < _polyphony; ++i) - slv2_instance_deactivate(instance(i)); + lilv_instance_deactivate(instance(i)); } void @@ -391,7 +391,7 @@ LV2Node::process(ProcessContext& context) NodeImpl::pre_process(context); for (uint32_t i = 0; i < _polyphony; ++i) - slv2_instance_run(instance(i), context.nframes()); + lilv_instance_run(instance(i), context.nframes()); NodeImpl::post_process(context); } @@ -401,7 +401,7 @@ LV2Node::set_port_buffer(uint32_t voice, uint32_t port_num, IntrusivePtr<Buffer> buf, SampleCount offset) { NodeImpl::set_port_buffer(voice, port_num, buf, offset); - slv2_instance_connect_port(instance(voice), port_num, + lilv_instance_connect_port(instance(voice), port_num, buf ? buf->port_data(_ports->at(port_num)->buffer_type(), offset) : NULL); } diff --git a/src/server/LV2Node.hpp b/src/server/LV2Node.hpp index 4702d24d..29a9d717 100644 --- a/src/server/LV2Node.hpp +++ b/src/server/LV2Node.hpp @@ -19,7 +19,7 @@ #define INGEN_ENGINE_LV2NODE_HPP #include <string> -#include "slv2/slv2.h" +#include "lilv/lilv.h" #include "raul/IntrusivePtr.hpp" #include "lv2/lv2plug.in/ns/ext/contexts/contexts.h" #include "types.hpp" @@ -62,7 +62,7 @@ public: IntrusivePtr<Buffer> buf, SampleCount offset); protected: - inline SLV2Instance instance(uint32_t voice) { return (SLV2Instance)(*_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 703a8616..75476fa4 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -38,7 +38,7 @@ namespace Server { LV2Plugin::LV2Plugin(SharedPtr<LV2Info> lv2_info, const std::string& uri) : PluginImpl(*lv2_info->world().uris().get(), Plugin::LV2, uri) - , _slv2_plugin(NULL) + , _lilv_plugin(NULL) , _lv2_info(lv2_info) { set_property(_uris.rdf_type, _uris.lv2_Plugin); @@ -86,9 +86,9 @@ LV2Plugin::instantiate(BufferFactory& bufs, } void -LV2Plugin::slv2_plugin(SLV2Plugin p) +LV2Plugin::lilv_plugin(LilvPlugin p) { - _slv2_plugin = p; + _lilv_plugin = p; } const std::string& @@ -96,9 +96,9 @@ LV2Plugin::library_path() const { static const std::string empty_string; if (_library_path.empty()) { - SLV2Value v = slv2_plugin_get_library_uri(_slv2_plugin); + LilvValue v = lilv_plugin_get_library_uri(_lilv_plugin); if (v) { - _library_path = slv2_uri_to_path(slv2_value_as_uri(v)); + _library_path = lilv_uri_to_path(lilv_value_as_uri(v)); } else { Raul::warn << uri() << " has no library path" << std::endl; return empty_string; diff --git a/src/server/LV2Plugin.hpp b/src/server/LV2Plugin.hpp index e4360398..127300cf 100644 --- a/src/server/LV2Plugin.hpp +++ b/src/server/LV2Plugin.hpp @@ -20,8 +20,8 @@ #include "ingen-config.h" -#ifndef HAVE_SLV2 -#error "This file requires SLV2, but HAVE_SLV2 is not defined. Please report." +#ifndef HAVE_LILV +#error "This file requires Lilv, but HAVE_LILV is not defined. Please report." #endif #include <cstdlib> @@ -30,7 +30,7 @@ #include <glibmm/module.h> #include <boost/utility.hpp> -#include "slv2/slv2.h" +#include "lilv/lilv.h" #include "raul/SharedPtr.hpp" #include "PluginImpl.hpp" @@ -61,11 +61,11 @@ public: const std::string& library_path() const; - SLV2Plugin slv2_plugin() const { return _slv2_plugin; } - void slv2_plugin(SLV2Plugin p); + LilvPlugin lilv_plugin() const { return _lilv_plugin; } + void lilv_plugin(LilvPlugin p); private: - SLV2Plugin _slv2_plugin; + LilvPlugin _lilv_plugin; SharedPtr<LV2Info> _lv2_info; }; diff --git a/src/server/NodeFactory.cpp b/src/server/NodeFactory.cpp index 8b336ad2..90e1a84e 100644 --- a/src/server/NodeFactory.cpp +++ b/src/server/NodeFactory.cpp @@ -35,8 +35,8 @@ #include "NodeFactory.hpp" #include "PatchImpl.hpp" #include "ThreadManager.hpp" -#ifdef HAVE_SLV2 -#include "slv2/slv2.h" +#ifdef HAVE_LILV +#include "lilv/lilv.h" #include "LV2Plugin.hpp" #include "LV2Node.hpp" #endif @@ -52,7 +52,7 @@ using namespace Internals; NodeFactory::NodeFactory(Ingen::Shared::World* world) : _world(world) , _has_loaded(false) -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV , _lv2_info(new LV2Info(world)) #endif { @@ -96,7 +96,7 @@ NodeFactory::load_plugins() load_internal_plugins(); -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV load_lv2_plugins(); #endif @@ -121,28 +121,28 @@ NodeFactory::load_internal_plugins() _plugins.insert(make_pair(trigger_plug->uri(), trigger_plug)); } -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV /** Loads information about all LV2 plugins into internal plugin database. */ void NodeFactory::load_lv2_plugins() { - SLV2Plugins plugins = slv2_world_get_all_plugins(_world->slv2_world()); + LilvPlugins plugins = lilv_world_get_all_plugins(_world->lilv_world()); - SLV2_FOREACH(plugins, i, plugins) { - SLV2Plugin lv2_plug = slv2_plugins_get(plugins, i); + LILV_FOREACH(plugins, i, plugins) { + LilvPlugin lv2_plug = lilv_plugins_get(plugins, i); - const string uri(slv2_value_as_uri(slv2_plugin_get_uri(lv2_plug))); + const string uri(lilv_value_as_uri(lilv_plugin_get_uri(lv2_plug))); assert(_plugins.find(uri) == _plugins.end()); LV2Plugin* const plugin = new LV2Plugin(_lv2_info, uri); - plugin->slv2_plugin(lv2_plug); + plugin->lilv_plugin(lv2_plug); _plugins.insert(make_pair(uri, plugin)); } } -#endif // HAVE_SLV2 +#endif // HAVE_LILV } // namespace Server } // namespace Ingen diff --git a/src/server/NodeFactory.hpp b/src/server/NodeFactory.hpp index f4e4ea41..d81639cc 100644 --- a/src/server/NodeFactory.hpp +++ b/src/server/NodeFactory.hpp @@ -34,7 +34,7 @@ namespace Server { class NodeImpl; class PatchImpl; class PluginImpl; -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV class LV2Info; #endif @@ -56,7 +56,7 @@ public: PluginImpl* plugin(const Raul::URI& uri); private: -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV void load_lv2_plugins(); #endif @@ -65,7 +65,7 @@ private: Plugins _plugins; Ingen::Shared::World* _world; bool _has_loaded; -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV SharedPtr<LV2Info> _lv2_info; #endif }; diff --git a/src/server/wscript b/src/server/wscript index b4d3be3b..daf7820e 100644 --- a/src/server/wscript +++ b/src/server/wscript @@ -59,7 +59,7 @@ def build(bld): internals/Trigger.cpp ''' - if bld.is_defined('HAVE_SLV2'): + if bld.is_defined('HAVE_LILV'): core_source += ' LV2Info.cpp LV2Plugin.cpp LV2Node.cpp ' obj = bld(features = 'cxx cxxshlib') @@ -70,7 +70,7 @@ def build(bld): obj.target = 'ingen_server' obj.install_path = '${LIBDIR}' obj.use = 'libingen_shared' - core_libs = 'GLIBMM GTHREAD LV2CORE SLV2 RAUL SORD' + core_libs = 'GLIBMM GTHREAD LV2CORE LILV RAUL SORD' autowaf.use_lib(bld, obj, core_libs) if bld.is_defined('HAVE_SOUP'): diff --git a/src/shared/World.cpp b/src/shared/World.cpp index 4c06a8f6..235bda91 100644 --- a/src/shared/World.cpp +++ b/src/shared/World.cpp @@ -20,8 +20,8 @@ #include <glibmm/module.h> #include <glibmm/miscutils.h> #include <glibmm/fileutils.h> -#ifdef HAVE_SLV2 -#include "slv2/slv2.h" +#ifdef HAVE_LILV +#include "lilv/lilv.h" #endif #include "raul/log.hpp" #include "sord/sordmm.hpp" @@ -104,17 +104,17 @@ public: , lv2_features(NULL) , rdf_world(new Sord::World()) , uris(new Shared::LV2URIMap()) -#ifdef HAVE_SLV2 - , slv2_world(slv2_world_new()) +#ifdef HAVE_LILV + , lilv_world(lilv_world_new()) #else - , slv2_world(NULL) + , lilv_world(NULL) #endif { -#ifdef HAVE_SLV2 +#ifdef HAVE_LILV lv2_features = new Ingen::Shared::LV2Features(); lv2_features->add_feature(LV2_URI_MAP_URI, uris); lv2_features->add_feature(LV2_URI_UNMAP_URI, uris->unmap_feature()); - slv2_world_load_all(slv2_world); + lilv_world_load_all(lilv_world); #endif // Set up RDF namespaces @@ -142,9 +142,9 @@ public: interface_factories.clear(); script_runners.clear(); -#ifdef HAVE_SLV2 - slv2_world_free(slv2_world); - slv2_world = NULL; +#ifdef HAVE_LILV + lilv_world_free(lilv_world); + lilv_world = NULL; #endif delete rdf_world; @@ -177,7 +177,7 @@ public: SharedPtr<Serialisation::Serialiser> serialiser; SharedPtr<Serialisation::Parser> parser; SharedPtr<Store> store; - SLV2World slv2_world; + LilvWorld lilv_world; std::string jack_uuid; }; @@ -209,8 +209,8 @@ SharedPtr<Store> World::store() { return _impl->store Raul::Configuration* World::conf() { return _impl->conf; } LV2Features* World::lv2_features() { return _impl->lv2_features; } -#ifdef HAVE_SLV2 -SLV2World World::slv2_world() { return _impl->slv2_world; } +#ifdef HAVE_LILV +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 a0603bf0..44e2478e 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 _SLV2World* SLV2World; +typedef struct _LilvWorld* LilvWorld; namespace Sord { class World; } @@ -49,7 +49,7 @@ class Store; /** The "world" all Ingen modules may share. * * All loaded components of Ingen, as well as things requiring shared access - * and/or locking (e.g. Sord, SLV2). + * and/or locking (e.g. Sord, Lilv). * * Ingen modules are shared libraries which modify the World when loaded * using World::load, e.g. loading the "ingen_serialisation" module will @@ -99,7 +99,7 @@ public: virtual LV2Features* lv2_features(); - virtual SLV2World slv2_world(); + virtual LilvWorld lilv_world(); virtual void set_jack_uuid(const std::string& uuid); virtual std::string jack_uuid(); diff --git a/src/shared/wscript b/src/shared/wscript index 763be120..3bff61bb 100644 --- a/src/shared/wscript +++ b/src/shared/wscript @@ -30,4 +30,4 @@ def build(bld): obj.vnum = '0.0.0' obj.install_path = '${LIBDIR}' obj.linkflags = '-ldl' - autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE SLV2 RAUL SORD LIBLO') + autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE LILV RAUL SORD LIBLO') |