diff options
author | David Robillard <d@drobilla.net> | 2007-04-21 07:18:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-04-21 07:18:40 +0000 |
commit | bd315305771e98eba1d81672a47ce4fe7bcc95cc (patch) | |
tree | d8bdf2a4737fe53bf2c37a4bd6fa262b79b0c348 /src/libs/client/PluginModel.h | |
parent | 7b2eaa5d9a71ce17dc1407f27bbe325c26cfc128 (diff) | |
download | ingen-bd315305771e98eba1d81672a47ce4fe7bcc95cc.tar.gz ingen-bd315305771e98eba1d81672a47ce4fe7bcc95cc.tar.bz2 ingen-bd315305771e98eba1d81672a47ce4fe7bcc95cc.zip |
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
Diffstat (limited to 'src/libs/client/PluginModel.h')
-rw-r--r-- | src/libs/client/PluginModel.h | 18 |
1 files changed, 11 insertions, 7 deletions
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 <string> #include <iostream> #include "raul/Path.h" +#include "raul/SharedPtr.h" #ifdef HAVE_SLV2 #include <slv2/slv2.h> #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<PatchModel> 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 }; |