diff options
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/client/Makefile.am | 4 | ||||
-rw-r--r-- | src/libs/client/PluginModel.h | 9 | ||||
-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 |
5 files changed, 18 insertions, 10 deletions
diff --git a/src/libs/client/Makefile.am b/src/libs/client/Makefile.am index e7296268..89dff982 100644 --- a/src/libs/client/Makefile.am +++ b/src/libs/client/Makefile.am @@ -2,9 +2,9 @@ if BUILD_CLIENT_LIB noinst_LTLIBRARIES = libingenclient.la -libingenclient_la_CXXFLAGS = @RAUL_CFLAGS@ @LXML2_CFLAGS@ @RASQAL_CFLAGS@ @RAPTOR_CFLAGS@ @LSIGCPP_CFLAGS@ @GLIBMM_CFLAGS@ -I$(top_srcdir)/src/common -DPKGDATADIR=\"$(pkgdatadir)\" +libingenclient_la_CXXFLAGS = @RAUL_CFLAGS@ @SLV2_CFLAGS@ @LXML2_CFLAGS@ @RASQAL_CFLAGS@ @RAPTOR_CFLAGS@ @LSIGCPP_CFLAGS@ @GLIBMM_CFLAGS@ -I$(top_srcdir)/src/common -DPKGDATADIR=\"$(pkgdatadir)\" -libingenclient_la_LIBADD = @RAUL_LIBS@ @LXML2_LIBS@ @LOSC_LIBS@ @RASQAL_LIBS@ @RAPTOR_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ +libingenclient_la_LIBADD = @RAUL_LIBS@ @SLV2_LIBS@ @LXML2_LIBS@ @LOSC_LIBS@ @RASQAL_LIBS@ @RAPTOR_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ libingenclient_la_SOURCES = \ OSCEngineSender.h \ diff --git a/src/libs/client/PluginModel.h b/src/libs/client/PluginModel.h index d6ffb2cc..f1c83377 100644 --- a/src/libs/client/PluginModel.h +++ b/src/libs/client/PluginModel.h @@ -46,10 +46,13 @@ public: { set_type_from_uri(type_uri); #ifdef HAVE_SLV2 + static SLV2World world = NULL; static SLV2Plugins plugins = NULL; - if (!plugins) { - plugins = slv2_plugins_new(); - slv2_plugins_load_all(plugins); + + if (!world) { + world = slv2_world_new(); + slv2_world_load_all(world); + plugins = slv2_world_get_all_plugins(world); } _slv2_plugin = slv2_plugins_get_by_uri(plugins, uri.c_str()); 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 |