diff options
author | David Robillard <d@drobilla.net> | 2009-05-11 21:51:47 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-11 21:51:47 +0000 |
commit | faf4db950721d5425bc8078d0fa6606e7064e69a (patch) | |
tree | cdd72f4910b5a59ea6097fadda768f31d7e6cf8c /src/engine | |
parent | cb5287d0379287c461a0ac5b950161244a7fa53b (diff) | |
download | ingen-faf4db950721d5425bc8078d0fa6606e7064e69a.tar.gz ingen-faf4db950721d5425bc8078d0fa6606e7064e69a.tar.bz2 ingen-faf4db950721d5425bc8078d0fa6606e7064e69a.zip |
Don't cause slv2 to load plugin data until a plugin is loaded or menu requested (faster startup).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1977 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/ClientBroadcaster.cpp | 2 | ||||
-rw-r--r-- | src/engine/HTTPClientSender.cpp | 3 | ||||
-rw-r--r-- | src/engine/HTTPClientSender.hpp | 3 | ||||
-rw-r--r-- | src/engine/LV2Node.cpp | 2 | ||||
-rw-r--r-- | src/engine/LV2Plugin.cpp | 24 | ||||
-rw-r--r-- | src/engine/LV2Plugin.hpp | 5 | ||||
-rw-r--r-- | src/engine/NodeFactory.cpp | 2 | ||||
-rw-r--r-- | src/engine/OSCClientSender.cpp | 4 | ||||
-rw-r--r-- | src/engine/OSCClientSender.hpp | 3 | ||||
-rw-r--r-- | src/engine/PluginImpl.hpp | 10 | ||||
-rw-r--r-- | src/engine/events/RequestPluginEvent.cpp | 2 |
11 files changed, 24 insertions, 36 deletions
diff --git a/src/engine/ClientBroadcaster.cpp b/src/engine/ClientBroadcaster.cpp index a13550a7..ee76eb53 100644 --- a/src/engine/ClientBroadcaster.cpp +++ b/src/engine/ClientBroadcaster.cpp @@ -115,7 +115,7 @@ ClientBroadcaster::send_plugins_to(ClientInterface* client, const NodeFactory::P for (NodeFactory::Plugins::const_iterator i = plugins.begin(); i != plugins.end(); ++i) { const PluginImpl* const plugin = i->second; - client->new_plugin(plugin->uri(), plugin->type_uri(), plugin->symbol(), plugin->name()); + client->new_plugin(plugin->uri(), plugin->type_uri(), plugin->symbol()); } client->transfer_end(); diff --git a/src/engine/HTTPClientSender.cpp b/src/engine/HTTPClientSender.cpp index 87da009d..f9329ebd 100644 --- a/src/engine/HTTPClientSender.cpp +++ b/src/engine/HTTPClientSender.cpp @@ -183,8 +183,7 @@ HTTPClientSender::new_object(const Shared::GraphObject* object) void HTTPClientSender::new_plugin(const std::string& uri, const std::string& type_uri, - const std::string& symbol, - const std::string& name) + const std::string& symbol) { /*lo_message m = lo_message_new(); lo_message_add_string(m, uri.c_str()); diff --git a/src/engine/HTTPClientSender.hpp b/src/engine/HTTPClientSender.hpp index 5eab2d2a..9a1ce10c 100644 --- a/src/engine/HTTPClientSender.hpp +++ b/src/engine/HTTPClientSender.hpp @@ -76,8 +76,7 @@ public: virtual void new_plugin(const std::string& uri, const std::string& type_uri, - const std::string& symbol, - const std::string& name); + const std::string& symbol); virtual void new_patch(const std::string& path, uint32_t poly); diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp index a72ebc21..a9246b3a 100644 --- a/src/engine/LV2Node.cpp +++ b/src/engine/LV2Node.cpp @@ -238,7 +238,7 @@ LV2Node::instantiate() if (!strcmp("http://lv2plug.in/ns/dev/contexts#MessageContext", context)) { cout << "MESSAGE CONTEXT!" << endl; if (!_message_funcs) { - cerr << "Plugin " << _lv2_plugin->name() + cerr << "Plugin " << _lv2_plugin->uri() << " has a message port, but no context extension data." << endl; } port->set_context(Context::MESSAGE); diff --git a/src/engine/LV2Plugin.cpp b/src/engine/LV2Plugin.cpp index cb35e495..8efd5da2 100644 --- a/src/engine/LV2Plugin.cpp +++ b/src/engine/LV2Plugin.cpp @@ -48,16 +48,6 @@ LV2Plugin::symbol() const } -const string -LV2Plugin::name() const -{ - if (_name) - return slv2_value_as_string(_name); - else - return "(no name)"; -} - - NodeImpl* LV2Plugin::instantiate(const string& name, bool polyphonic, @@ -85,9 +75,17 @@ void LV2Plugin::slv2_plugin(SLV2Plugin p) { _slv2_plugin = p; - if (_name) - slv2_value_free(_name); - _name = slv2_plugin_get_name(_slv2_plugin); +} + + +const std::string& +LV2Plugin::library_path() const +{ + if (_library_path == "") + _library_path = slv2_uri_to_path(slv2_value_as_uri( + slv2_plugin_get_library_uri(_slv2_plugin))); + + return _library_path; } diff --git a/src/engine/LV2Plugin.hpp b/src/engine/LV2Plugin.hpp index ca8daeea..0d67834e 100644 --- a/src/engine/LV2Plugin.hpp +++ b/src/engine/LV2Plugin.hpp @@ -52,7 +52,6 @@ class LV2Plugin : public PluginImpl public: LV2Plugin(SharedPtr<LV2Info> lv2_info, const string& uri) : PluginImpl(Plugin::LV2, uri) - , _name(NULL) , _slv2_plugin(NULL) , _lv2_info(lv2_info) {} @@ -63,15 +62,15 @@ public: Engine& engine); const string symbol() const; - const string name() const; SharedPtr<LV2Info> lv2_info() const { return _lv2_info; } + + const std::string& library_path() const; SLV2Plugin slv2_plugin() const { return _slv2_plugin; } void slv2_plugin(SLV2Plugin p); private: - SLV2Value _name; SLV2Plugin _slv2_plugin; SharedPtr<LV2Info> _lv2_info; }; diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp index dd59f41a..9ec58d80 100644 --- a/src/engine/NodeFactory.cpp +++ b/src/engine/NodeFactory.cpp @@ -180,8 +180,6 @@ NodeFactory::load_lv2_plugins() LV2Plugin* const plugin = new LV2Plugin(_lv2_info, uri); plugin->slv2_plugin(lv2_plug); - plugin->library_path(slv2_uri_to_path(slv2_value_as_uri( - slv2_plugin_get_library_uri(lv2_plug)))); _plugins.insert(make_pair(uri, plugin)); } diff --git a/src/engine/OSCClientSender.cpp b/src/engine/OSCClientSender.cpp index db1d342e..2e058ed5 100644 --- a/src/engine/OSCClientSender.cpp +++ b/src/engine/OSCClientSender.cpp @@ -298,14 +298,12 @@ OSCClientSender::activity(const std::string& path) void OSCClientSender::new_plugin(const std::string& uri, const std::string& type_uri, - const std::string& symbol, - const std::string& name) + const std::string& symbol) { lo_message m = lo_message_new(); lo_message_add_string(m, uri.c_str()); lo_message_add_string(m, type_uri.c_str()); lo_message_add_string(m, symbol.c_str()); - lo_message_add_string(m, name.c_str()); send_message("/ingen/plugin", m); } diff --git a/src/engine/OSCClientSender.hpp b/src/engine/OSCClientSender.hpp index 1d1c47c5..6b8cc1bf 100644 --- a/src/engine/OSCClientSender.hpp +++ b/src/engine/OSCClientSender.hpp @@ -73,8 +73,7 @@ public: virtual void new_plugin(const std::string& uri, const std::string& type_uri, - const std::string& symbol, - const std::string& name); + const std::string& symbol); virtual bool new_object(const Shared::GraphObject* object); diff --git a/src/engine/PluginImpl.hpp b/src/engine/PluginImpl.hpp index 17a3d116..e900d34c 100644 --- a/src/engine/PluginImpl.hpp +++ b/src/engine/PluginImpl.hpp @@ -59,10 +59,8 @@ public: Engine& engine) = 0; virtual const string symbol() const = 0; - virtual const string name() const = 0; - const std::string& library_path() const { return _library_path; } - void library_path(const std::string& s) { _library_path = s;} + virtual const std::string& library_path() const { return _library_path; } void load(); void unload(); @@ -73,9 +71,9 @@ public: void module(Glib::Module* module) { _module = module; } protected: - Plugin::Type _type; - string _library_path; - Glib::Module* _module; + Plugin::Type _type; + mutable string _library_path; + Glib::Module* _module; }; diff --git a/src/engine/events/RequestPluginEvent.cpp b/src/engine/events/RequestPluginEvent.cpp index 36358df7..3acdceed 100644 --- a/src/engine/events/RequestPluginEvent.cpp +++ b/src/engine/events/RequestPluginEvent.cpp @@ -67,7 +67,7 @@ RequestPluginEvent::post_process() _responder->respond_ok(); assert(_plugin->uri() == _uri); - _responder->client()->new_plugin(_uri, _plugin->type_uri(), _plugin->symbol(), _plugin->name()); + _responder->client()->new_plugin(_uri, _plugin->type_uri(), _plugin->symbol()); } else { _responder->respond_error("Unable to find client to send plugin."); |