From 678139141fe306dd721c799b23af56111eaae37f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 26 Feb 2010 06:01:18 +0000 Subject: Remove request_plugins from EngineInterface (and RequestPlugins event from engine), replacing with get of magic URI "ingen:plugins". git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2504 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/HTTPEngineSender.cpp | 8 ----- src/client/HTTPEngineSender.hpp | 1 - src/client/OSCEngineSender.cpp | 7 ---- src/client/OSCEngineSender.hpp | 1 - src/common/interface/EngineInterface.hpp | 2 -- src/engine/OSCEngineReceiver.cpp | 17 --------- src/engine/OSCEngineReceiver.hpp | 2 -- src/engine/QueuedEngineInterface.cpp | 7 ---- src/engine/QueuedEngineInterface.hpp | 1 - src/engine/events.hpp | 1 - src/engine/events/Get.cpp | 20 +++++------ src/engine/events/Get.hpp | 9 ++--- src/engine/events/RequestPlugins.cpp | 59 -------------------------------- src/engine/events/RequestPlugins.hpp | 51 --------------------------- src/engine/wscript | 1 - src/gui/ConnectWindow.cpp | 2 +- src/ingen/main.cpp | 2 +- 17 files changed, 16 insertions(+), 175 deletions(-) delete mode 100644 src/engine/events/RequestPlugins.cpp delete mode 100644 src/engine/events/RequestPlugins.hpp (limited to 'src') diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp index 65631067..dbe89b14 100644 --- a/src/client/HTTPEngineSender.cpp +++ b/src/client/HTTPEngineSender.cpp @@ -224,14 +224,6 @@ HTTPEngineSender::request_property(const URI& object_path, const URI& key) } -void -HTTPEngineSender::request_plugins() -{ - SoupMessage* msg = soup_message_new("GET", (_engine_url.str() + "/plugins").c_str()); - HTTPClientReceiver::send(msg); -} - - } // namespace Client } // namespace Ingen diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp index 7d3c4e39..944079de 100644 --- a/src/client/HTTPEngineSender.hpp +++ b/src/client/HTTPEngineSender.hpp @@ -109,7 +109,6 @@ public: void ping(); void get(const Raul::URI& uri); void request_property(const Raul::URI& path, const Raul::URI& key); - void request_plugins(); protected: SoupSession* _session; diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp index 6d3132df..0bdf467f 100644 --- a/src/client/OSCEngineSender.cpp +++ b/src/client/OSCEngineSender.cpp @@ -261,13 +261,6 @@ OSCEngineSender::request_property(const URI& object_path, const URI& key) } -void -OSCEngineSender::request_plugins() -{ - send("/request_plugins", "i", next_id(), LO_ARGS_END); -} - - } // namespace Client } // namespace Ingen diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp index 2383b88a..26e80fb2 100644 --- a/src/client/OSCEngineSender.hpp +++ b/src/client/OSCEngineSender.hpp @@ -106,7 +106,6 @@ public: void ping(); void get(const Raul::URI& uri); void request_property(const Raul::URI& path, const Raul::URI& key); - void request_plugins(); protected: const Raul::URI _engine_url; diff --git a/src/common/interface/EngineInterface.hpp b/src/common/interface/EngineInterface.hpp index 4b706c01..f334cf20 100644 --- a/src/common/interface/EngineInterface.hpp +++ b/src/common/interface/EngineInterface.hpp @@ -66,8 +66,6 @@ public: virtual void request_property(const Raul::URI& uri, const Raul::URI& key) = 0; - - virtual void request_plugins() = 0; }; diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index 4f834719..7d3adc5f 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -112,8 +112,6 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t // Queries lo_server_add_method(_server, "/request_property", "iss", request_property_cb, this); lo_server_add_method(_server, "/get", "is", get_cb, this); - lo_server_add_method(_server, "/request_plugins", "i", request_plugins_cb, this); - lo_server_add_method(_server, "/request_all_objects", "i", request_all_objects_cb, this); lo_server_add_method(_server, NULL, NULL, unknown_cb, NULL); @@ -633,21 +631,6 @@ OSCEngineReceiver::_request_property_cb(const char* path, const char* types, lo_ } -/** \page engine_osc_namespace - *

/request_plugins

- * \arg \b response-id (integer) - * - * Request the engine send a list of all known plugins. - */ -int -OSCEngineReceiver::_request_plugins_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - request_plugins(); - return 0; -} - - - // Static Callbacks // diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index 168d411a..9cbcd0c4 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -112,8 +112,6 @@ private: LO_HANDLER(set_property); LO_HANDLER(property_set); LO_HANDLER(request_property); - LO_HANDLER(request_plugins); - LO_HANDLER(request_all_objects); lo_server _server; }; diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp index 4276e5d7..d07bfe10 100644 --- a/src/engine/QueuedEngineInterface.cpp +++ b/src/engine/QueuedEngineInterface.cpp @@ -264,11 +264,4 @@ QueuedEngineInterface::request_property(const URI& uri, const URI& key) } -void -QueuedEngineInterface::request_plugins() -{ - push_queued(new Events::RequestPlugins(_engine, _request, now())); -} - - } // namespace Ingen diff --git a/src/engine/QueuedEngineInterface.hpp b/src/engine/QueuedEngineInterface.hpp index 617458ab..1a015a95 100644 --- a/src/engine/QueuedEngineInterface.hpp +++ b/src/engine/QueuedEngineInterface.hpp @@ -102,7 +102,6 @@ public: virtual void ping(); virtual void get(const Raul::URI& uri); virtual void request_property(const Raul::URI& object_path, const Raul::URI& key); - virtual void request_plugins(); protected: virtual void disable_responses(); diff --git a/src/engine/events.hpp b/src/engine/events.hpp index 58d6f63e..09c5d14c 100644 --- a/src/engine/events.hpp +++ b/src/engine/events.hpp @@ -36,7 +36,6 @@ #include "events/Ping.hpp" #include "events/RegisterClient.hpp" #include "events/RequestMetadata.hpp" -#include "events/RequestPlugins.hpp" #include "events/SetMetadata.hpp" #include "events/SetPortValue.hpp" #include "events/UnregisterClient.hpp" diff --git a/src/engine/events/Get.cpp b/src/engine/events/Get.cpp index 05aa2f90..5031d794 100644 --- a/src/engine/events/Get.cpp +++ b/src/engine/events/Get.cpp @@ -49,27 +49,25 @@ Get::Get( void Get::pre_process() { - if (Path::is_valid(_uri.str())) + if (_uri == "ingen:plugins") { + _plugins = _engine.node_factory()->plugins(); + } else if (Path::is_valid(_uri.str())) { _object = _engine.engine_store()->find_object(Path(_uri.str())); - else + } else { _plugin = _engine.node_factory()->plugin(_uri); + } QueuedEvent::pre_process(); } -void -Get::execute(ProcessContext& context) -{ - QueuedEvent::execute(context); - assert(_time >= context.start() && _time <= context.end()); -} - - void Get::post_process() { - if (!_object && !_plugin) { + if (_uri == "ingen:plugins") { + _request->respond_ok(); + _engine.broadcaster()->send_plugins_to(_request->client(), _plugins); + } else if (!_object && !_plugin) { _request->respond_error("Unable to find object requested."); } else if (_request->client()) { _request->respond_ok(); diff --git a/src/engine/events/Get.hpp b/src/engine/events/Get.hpp index 2abae3a4..3592cd27 100644 --- a/src/engine/events/Get.hpp +++ b/src/engine/events/Get.hpp @@ -19,6 +19,7 @@ #define INGEN_EVENTS_GET_HPP #include "QueuedEvent.hpp" +#include "NodeFactory.hpp" #include "types.hpp" namespace Ingen { @@ -43,13 +44,13 @@ public: const Raul::URI& uri); void pre_process(); - void execute(ProcessContext& context); void post_process(); private: - const Raul::URI _uri; - GraphObjectImpl* _object; - const PluginImpl* _plugin; + const Raul::URI _uri; + GraphObjectImpl* _object; + const PluginImpl* _plugin; + NodeFactory::Plugins _plugins; }; diff --git a/src/engine/events/RequestPlugins.cpp b/src/engine/events/RequestPlugins.cpp deleted file mode 100644 index 89507a23..00000000 --- a/src/engine/events/RequestPlugins.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 Dave Robillard - * - * 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 "RequestPlugins.hpp" -#include "Request.hpp" -#include "Engine.hpp" -#include "ClientBroadcaster.hpp" -#include "NodeFactory.hpp" - -namespace Ingen { -namespace Events { - - -RequestPlugins::RequestPlugins(Engine& engine, SharedPtr request, SampleCount timestamp) - : QueuedEvent(engine, request, timestamp) -{ -} - - -void -RequestPlugins::pre_process() -{ - // Take a copy to send in the post processing thread (to avoid problems - // because std::map isn't thread safe) - _plugins = _engine.node_factory()->plugins(); - - QueuedEvent::pre_process(); -} - - -void -RequestPlugins::post_process() -{ - if (_request->client()) { - _engine.broadcaster()->send_plugins_to(_request->client(), _plugins); - _request->respond_ok(); - } else { - _request->respond_error("Unable to find client to send plugins"); - } -} - - -} // namespace Ingen -} // namespace Events - diff --git a/src/engine/events/RequestPlugins.hpp b/src/engine/events/RequestPlugins.hpp deleted file mode 100644 index 094edf51..00000000 --- a/src/engine/events/RequestPlugins.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007-2009 Dave Robillard - * - * 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_REQUESTPLUGINS_HPP -#define INGEN_EVENTS_REQUESTPLUGINS_HPP - -#include "QueuedEvent.hpp" -#include "NodeFactory.hpp" - -namespace Ingen { - -class Request; - -namespace Events { - - -/** A request from a client to send notification of all objects (ie refresh). - * - * \ingroup engine - */ -class RequestPlugins : public QueuedEvent -{ -public: - RequestPlugins(Engine& engine, SharedPtr request, SampleCount timestamp); - - void pre_process(); - void post_process(); - -private: - NodeFactory::Plugins _plugins; -}; - - -} // namespace Ingen -} // namespace Events - -#endif // INGEN_EVENTS_REQUESTPLUGINS_HPP diff --git a/src/engine/wscript b/src/engine/wscript index 28777708..f3beb364 100644 --- a/src/engine/wscript +++ b/src/engine/wscript @@ -48,7 +48,6 @@ def build(bld): events/Note.cpp events/RegisterClient.cpp events/RequestMetadata.cpp - events/RequestPlugins.cpp events/SendBinding.cpp events/SendPortActivity.cpp events/SendPortValue.cpp diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 0d8c8e76..aae826e4 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -462,7 +462,7 @@ ConnectWindow::gtk_callback() } } } else if (_connect_stage == 4) { - App::instance().engine()->request_plugins(); + App::instance().engine()->get("ingen:plugins"); hide(); if (_widgets_loaded) _progress_label->set_text("Connected to engine"); diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index cc652810..c8d0c944 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -218,7 +218,7 @@ main(int argc, char** argv) engine_interface->load_plugins(); if (conf.option("gui").get_bool()) - engine_interface->request_plugins(); + engine_interface->get("ingen:plugins"); world->parser->parse_document( world, engine_interface.get(), uri, data_path, parent, symbol); -- cgit v1.2.1