From bd315305771e98eba1d81672a47ce4fe7bcc95cc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 21 Apr 2007 07:18:40 +0000 Subject: Loading plugins via class-based menu heirarchy in patch context menu. git-svn-id: http://svn.drobilla.net/lad/ingen@468 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/PluginModel.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/libs/client/PluginModel.h') diff --git a/src/libs/client/PluginModel.h b/src/libs/client/PluginModel.h index f1c83377..6614a3b6 100644 --- a/src/libs/client/PluginModel.h +++ b/src/libs/client/PluginModel.h @@ -22,6 +22,7 @@ #include #include #include "raul/Path.h" +#include "raul/SharedPtr.h" #ifdef HAVE_SLV2 #include #endif @@ -30,6 +31,8 @@ using std::string; using std::cerr; using std::endl; namespace Ingen { namespace Client { +class PatchModel; + /** Model for a plugin available for loading. * @@ -46,13 +49,12 @@ public: { set_type_from_uri(type_uri); #ifdef HAVE_SLV2 - static SLV2World world = NULL; static SLV2Plugins plugins = NULL; - if (!world) { - world = slv2_world_new(); - slv2_world_load_all(world); - plugins = slv2_world_get_all_plugins(world); + if (!_slv2_world) { + _slv2_world = slv2_world_new(); + slv2_world_load_all(_slv2_world); + plugins = slv2_world_get_all_plugins(_slv2_world); } _slv2_plugin = slv2_plugins_get_by_uri(plugins, uri.c_str()); @@ -101,10 +103,11 @@ public: } } - string default_node_name() { return Raul::Path::nameify(_name); } + string default_node_name(SharedPtr parent); #ifdef HAVE_SLV2 - SLV2Plugin slv2_plugin() { return _slv2_plugin; } + SLV2Plugin slv2_plugin() { return _slv2_plugin; } + static SLV2World slv2_world() { return _slv2_world; } #endif private: @@ -113,6 +116,7 @@ private: string _name; #ifdef HAVE_SLV2 + static SLV2World _slv2_world; SLV2Plugin _slv2_plugin; #endif }; -- cgit v1.2.1