From 883f2e9f31914912f4c5e19bc9e463fe3663a638 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 7 Apr 2007 06:35:36 +0000 Subject: Visual tweaks. Loading range for LV2 plugins (client side). git-svn-id: http://svn.drobilla.net/lad/ingen@413 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/NodeModel.h | 2 +- src/libs/client/PluginModel.h | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'src/libs') diff --git a/src/libs/client/NodeModel.h b/src/libs/client/NodeModel.h index 934261d8..2dd96f35 100644 --- a/src/libs/client/NodeModel.h +++ b/src/libs/client/NodeModel.h @@ -52,7 +52,7 @@ public: const map >& get_programs() const { return _banks; } const string& plugin_uri() const { return _plugin_uri; } - SharedPtr plugin() const { return _plugin; } + SharedPtr plugin() const { return _plugin; } int num_ports() const { return _ports.size(); } const PortModelList& ports() const { return _ports; } virtual bool polyphonic() const { return _polyphonic; } diff --git a/src/libs/client/PluginModel.h b/src/libs/client/PluginModel.h index b9f784ed..4c769fdb 100644 --- a/src/libs/client/PluginModel.h +++ b/src/libs/client/PluginModel.h @@ -18,9 +18,13 @@ #ifndef PLUGINMODEL_H #define PLUGINMODEL_H +#include "../../config.h" #include #include #include "raul/Path.h" +#ifdef HAVE_SLV2 +#include +#endif using std::string; using std::cerr; using std::endl; namespace Ingen { @@ -37,10 +41,19 @@ public: enum Type { LV2, LADSPA, DSSI, Internal, Patch }; PluginModel(const string& uri, const string& type_uri, const string& name) - : _uri(uri), - _name(name) + : _uri(uri) + , _name(name) { set_type_from_uri(type_uri); +#ifdef HAVE_SLV2 + static SLV2Plugins plugins = NULL; + if (!plugins) { + plugins = slv2_plugins_new(); + slv2_plugins_load_all(plugins); + } + + _slv2_plugin = slv2_plugins_get_by_uri(plugins, uri.c_str()); +#endif } Type type() const { return _type; } @@ -87,10 +100,18 @@ public: string default_node_name() { return Raul::Path::nameify(_name); } +#ifdef HAVE_SLV2 + SLV2Plugin slv2_plugin() { return _slv2_plugin; } +#endif + private: Type _type; string _uri; string _name; + +#ifdef HAVE_SLV2 + SLV2Plugin _slv2_plugin; +#endif }; -- cgit v1.2.1