diff options
Diffstat (limited to 'src/libs/engine')
-rw-r--r-- | src/libs/engine/LV2Node.cpp | 2 | ||||
-rw-r--r-- | src/libs/engine/NodeFactory.cpp | 8 | ||||
-rw-r--r-- | src/libs/engine/NodeFactory.h | 5 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index 459d3c78..f45af62c 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -82,7 +82,7 @@ LV2Node::instantiate() Port* port = NULL; for (size_t j=0; j < num_ports; ++j) { - SLV2PortID id = slv2_port_by_index(j); + SLV2Port id = slv2_plugin_get_port_by_index(_lv2_plugin, j); // LV2 shortnames are guaranteed to be unique, valid C identifiers port_name = (char*)slv2_port_get_symbol(_lv2_plugin, id); diff --git a/src/libs/engine/NodeFactory.cpp b/src/libs/engine/NodeFactory.cpp index dd8d029d..1214cc20 100644 --- a/src/libs/engine/NodeFactory.cpp +++ b/src/libs/engine/NodeFactory.cpp @@ -59,7 +59,8 @@ NodeFactory::NodeFactory() : _has_loaded(false) { #ifdef HAVE_SLV2 - slv2_init(); + _world = slv2_world_new(); + slv2_world_load_all(_world); #endif // Add builtin plugin types to _internal_plugins list @@ -95,7 +96,7 @@ NodeFactory::~NodeFactory() delete (*i); } #ifdef HAVE_SLV2 - slv2_finish(); + slv2_world_free(_world); #endif } @@ -266,8 +267,7 @@ NodeFactory::load_internal_plugin(const string& uri, void NodeFactory::load_lv2_plugins() { - SLV2Plugins plugins = slv2_plugins_new(); - slv2_plugins_load_all(plugins); + SLV2Plugins plugins = slv2_world_get_all_plugins(_world); //cerr << "[NodeFactory] Found " << slv2_plugins_get_length(plugins) << " LV2 plugins." << endl; diff --git a/src/libs/engine/NodeFactory.h b/src/libs/engine/NodeFactory.h index e7812d6a..fcd4179e 100644 --- a/src/libs/engine/NodeFactory.h +++ b/src/libs/engine/NodeFactory.h @@ -25,6 +25,9 @@ #include <string> #include <ladspa.h> #include <pthread.h> +#ifdef HAVE_SLV2 +#include <slv2/slv2.h> +#endif using std::string; using std::list; @@ -69,6 +72,8 @@ private: #ifdef HAVE_SLV2 void load_lv2_plugins(); Node* load_lv2_plugin(const string& plugin_uri, const string& name, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size); + + SLV2World _world; #endif #ifdef HAVE_DSSI |