diff options
-rw-r--r-- | include/ingen/EngineInterface.hpp | 1 | ||||
-rw-r--r-- | src/client/HTTPEngineSender.cpp | 6 | ||||
-rw-r--r-- | src/client/HTTPEngineSender.hpp | 1 | ||||
-rw-r--r-- | src/client/OSCEngineSender.cpp | 5 | ||||
-rw-r--r-- | src/client/OSCEngineSender.hpp | 1 | ||||
-rw-r--r-- | src/engine/HTTPEngineReceiver.cpp | 2 | ||||
-rw-r--r-- | src/engine/NodeFactory.cpp | 10 | ||||
-rw-r--r-- | src/engine/NodeFactory.hpp | 2 | ||||
-rw-r--r-- | src/engine/OSCEngineReceiver.cpp | 14 | ||||
-rw-r--r-- | src/engine/OSCEngineReceiver.hpp | 1 | ||||
-rw-r--r-- | src/engine/QueuedEngineInterface.cpp | 5 | ||||
-rw-r--r-- | src/engine/QueuedEngineInterface.hpp | 1 | ||||
-rw-r--r-- | src/engine/events.hpp | 1 | ||||
-rw-r--r-- | src/engine/events/LoadPlugins.cpp | 53 | ||||
-rw-r--r-- | src/engine/events/LoadPlugins.hpp | 46 | ||||
-rw-r--r-- | src/engine/ingen_lv2.cpp | 4 | ||||
-rw-r--r-- | src/engine/wscript | 1 | ||||
-rw-r--r-- | src/gui/ConnectWindow.cpp | 2 | ||||
-rw-r--r-- | src/ingen/main.cpp | 4 |
19 files changed, 16 insertions, 144 deletions
diff --git a/include/ingen/EngineInterface.hpp b/include/ingen/EngineInterface.hpp index 2146251f..5cb05286 100644 --- a/include/ingen/EngineInterface.hpp +++ b/include/ingen/EngineInterface.hpp @@ -47,7 +47,6 @@ public: virtual void unregister_client(const Raul::URI& uri) = 0; // Engine commands - virtual void load_plugins() = 0; virtual void activate() = 0; virtual void deactivate() = 0; virtual void quit() = 0; diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp index 144bf37b..31e1238c 100644 --- a/src/client/HTTPEngineSender.cpp +++ b/src/client/HTTPEngineSender.cpp @@ -79,12 +79,6 @@ HTTPEngineSender::unregister_client(const URI& uri) } // Engine commands -void -HTTPEngineSender::load_plugins() -{ - SoupMessage* msg = soup_message_new("GET", (_engine_url.str() + "/plugins").c_str()); - HTTPClientReceiver::send(msg); -} void HTTPEngineSender::activate() diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp index e12815b1..19742498 100644 --- a/src/client/HTTPEngineSender.hpp +++ b/src/client/HTTPEngineSender.hpp @@ -76,7 +76,6 @@ public: void unregister_client(const Raul::URI& uri); // Engine commands - void load_plugins(); void activate(); void deactivate(); void quit(); diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp index 724035e5..d2125e08 100644 --- a/src/client/OSCEngineSender.cpp +++ b/src/client/OSCEngineSender.cpp @@ -97,11 +97,6 @@ OSCEngineSender::unregister_client(const URI& uri) } // Engine commands -void -OSCEngineSender::load_plugins() -{ - send("/load_plugins", "i", next_id(), LO_ARGS_END); -} void OSCEngineSender::activate() diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp index 8c50592c..bc05a393 100644 --- a/src/client/OSCEngineSender.hpp +++ b/src/client/OSCEngineSender.hpp @@ -68,7 +68,6 @@ public: void unregister_client(const Raul::URI& uri); // Engine commands - void load_plugins(); void activate(); void deactivate(); void quit(); diff --git a/src/engine/HTTPEngineReceiver.cpp b/src/engine/HTTPEngineReceiver.cpp index 22de974e..9ee54319 100644 --- a/src/engine/HTTPEngineReceiver.cpp +++ b/src/engine/HTTPEngineReceiver.cpp @@ -134,7 +134,7 @@ HTTPEngineReceiver::message_callback(SoupServer* server, } else if (msg->method == SOUP_METHOD_GET && path.substr(0, 8) == "/plugins") { // FIXME: kludge - me->load_plugins(); + me->get("ingen:plugins"); me->_receive_thread->whip(); serialiser->start_to_string("/", base_uri); diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp index 21b8257c..20ad9fc2 100644 --- a/src/engine/NodeFactory.cpp +++ b/src/engine/NodeFactory.cpp @@ -66,6 +66,16 @@ NodeFactory::~NodeFactory() _plugins.clear(); } +const NodeFactory::Plugins& +NodeFactory::plugins() +{ + if (!_has_loaded) { + // TODO: Plugin list refreshing + load_plugins(); + } + return _plugins; +} + PluginImpl* NodeFactory::plugin(const Raul::URI& uri) { diff --git a/src/engine/NodeFactory.hpp b/src/engine/NodeFactory.hpp index 3057319c..3c906663 100644 --- a/src/engine/NodeFactory.hpp +++ b/src/engine/NodeFactory.hpp @@ -51,7 +51,7 @@ public: void load_plugins(); typedef std::map<Raul::URI, PluginImpl*> Plugins; - const Plugins& plugins() const { return _plugins; } + const Plugins& plugins(); PluginImpl* plugin(const Raul::URI& uri); diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index baa6d5e1..a957d863 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -97,7 +97,6 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t lo_server_add_method(_server, "/quit", "i", quit_cb, this); lo_server_add_method(_server, "/register_client", "i", register_client_cb, this); lo_server_add_method(_server, "/unregister_client", "i", unregister_client_cb, this); - lo_server_add_method(_server, "/load_plugins", "i", load_plugins_cb, this); lo_server_add_method(_server, "/activate", "i", engine_activate_cb, this); lo_server_add_method(_server, "/deactivate", "i", engine_deactivate_cb, this); lo_server_add_method(_server, "/put", NULL, put_cb, this); @@ -340,19 +339,6 @@ OSCEngineReceiver::_unregister_client_cb(const char* path, const char* types, lo } /** \page engine_osc_namespace - * <h2>/load_plugins</h2> - * \arg \b response-id (integer) - * - * Locate all available plugins, making them available for use. - */ -int -OSCEngineReceiver::_load_plugins_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - load_plugins(); - return 0; -} - -/** \page engine_osc_namespace * <h2>/activate</h2> * \arg \b response-id (integer) * diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index e059a843..a94ca396 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -97,7 +97,6 @@ private: LO_HANDLER(ping_slow); LO_HANDLER(register_client); LO_HANDLER(unregister_client); - LO_HANDLER(load_plugins); LO_HANDLER(engine_activate); LO_HANDLER(engine_deactivate); LO_HANDLER(get); diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp index 345602fa..ba48b5c5 100644 --- a/src/engine/QueuedEngineInterface.cpp +++ b/src/engine/QueuedEngineInterface.cpp @@ -92,11 +92,6 @@ QueuedEngineInterface::unregister_client(const URI& uri) } // Engine commands -void -QueuedEngineInterface::load_plugins() -{ - push_queued(new Events::LoadPlugins(_engine, _request, now())); -} void QueuedEngineInterface::activate() diff --git a/src/engine/QueuedEngineInterface.hpp b/src/engine/QueuedEngineInterface.hpp index cb4e2c26..e4338dbc 100644 --- a/src/engine/QueuedEngineInterface.hpp +++ b/src/engine/QueuedEngineInterface.hpp @@ -61,7 +61,6 @@ public: virtual void unregister_client(const Raul::URI& uri); // Engine commands - virtual void load_plugins(); virtual void activate(); virtual void deactivate(); virtual void quit(); diff --git a/src/engine/events.hpp b/src/engine/events.hpp index 6382baae..7ddcfe52 100644 --- a/src/engine/events.hpp +++ b/src/engine/events.hpp @@ -29,7 +29,6 @@ #include "events/Disconnect.hpp" #include "events/DisconnectAll.hpp" #include "events/Get.hpp" -#include "events/LoadPlugins.hpp" #include "events/Move.hpp" #include "events/Ping.hpp" #include "events/RegisterClient.hpp" diff --git a/src/engine/events/LoadPlugins.cpp b/src/engine/events/LoadPlugins.cpp deleted file mode 100644 index 975165bf..00000000 --- a/src/engine/events/LoadPlugins.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard <http://drobilla.net> - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "LoadPlugins.hpp" -#include "Request.hpp" -#include "Engine.hpp" -#include "NodeFactory.hpp" -#include "ClientBroadcaster.hpp" - -namespace Ingen { -namespace Engine { -namespace Events { - -LoadPlugins::LoadPlugins(Engine& engine, SharedPtr<Request> request, SampleCount timestamp) - : QueuedEvent(engine, request, timestamp, bool(request)) -{ -} - -void -LoadPlugins::pre_process() -{ - _engine.node_factory()->load_plugins(); - - QueuedEvent::pre_process(); -} - -void -LoadPlugins::post_process() -{ - if (_request) - _request->unblock(); - - _request->respond_ok(); -} - -} // namespace Engine -} // namespace Ingen -} // namespace Events - diff --git a/src/engine/events/LoadPlugins.hpp b/src/engine/events/LoadPlugins.hpp deleted file mode 100644 index 47646e92..00000000 --- a/src/engine/events/LoadPlugins.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard <http://drobilla.net> - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_EVENTS_LOADPLUGINS_HPP -#define INGEN_EVENTS_LOADPLUGINS_HPP - -#include "QueuedEvent.hpp" - -namespace Ingen { -namespace Engine { -namespace Events { - -/** Loads all plugins into the internal plugin database (in NodeFactory). - * - * \ingroup engine - */ -class LoadPlugins : public QueuedEvent -{ -public: - LoadPlugins(Engine& engine, - SharedPtr<Request> request, - SampleCount timestamp); - - void pre_process(); - void post_process(); -}; - -} // namespace Engine -} // namespace Ingen -} // namespace Events - -#endif // INGEN_EVENTS_LOADPLUGINS_HPP diff --git a/src/engine/ingen_lv2.cpp b/src/engine/ingen_lv2.cpp index 44ebc52b..0c943a7a 100644 --- a/src/engine/ingen_lv2.cpp +++ b/src/engine/ingen_lv2.cpp @@ -290,8 +290,8 @@ ingen_instantiate(const LV2_Descriptor* descriptor, engine->post_processor()->set_end_time(UINT_MAX); - // FIXME: don't load all plugins, only necessary ones - plugin->world->engine()->load_plugins(); + // TODO: Load only necessary plugins + plugin->world->engine()->get("ingen:plugins"); interface->process(*engine->post_processor(), context, false); engine->post_processor()->process(); diff --git a/src/engine/wscript b/src/engine/wscript index 987779fd..2321da69 100644 --- a/src/engine/wscript +++ b/src/engine/wscript @@ -43,7 +43,6 @@ def build(bld): events/Disconnect.cpp events/DisconnectAll.cpp events/Get.cpp - events/LoadPlugins.cpp events/Move.cpp events/RegisterClient.cpp events/RequestMetadata.cpp diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 684b8f30..aaa060ab 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -439,7 +439,7 @@ ConnectWindow::gtk_callback() if (root) { set_connected_to(App::instance().engine()); App::instance().window_factory()->present_patch(root); - App::instance().engine()->load_plugins(); + App::instance().engine()->get("ingen:plugins"); if (_widgets_loaded) _progress_label->set_text(string("Loading plugins...")); ++_connect_stage; diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 1f610810..9c8bba3b 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -188,9 +188,7 @@ main(int argc, char** argv) : Glib::build_filename(Glib::get_current_dir(), uri)); } - engine_interface->load_plugins(); - if (conf.option("gui").get_bool()) - engine_interface->get("ingen:plugins"); + engine_interface->get("ingen:plugins"); world->parser()->parse_file( world, engine_interface.get(), uri, parent, symbol); } |