summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-26 06:01:18 +0000
committerDavid Robillard <d@drobilla.net>2010-02-26 06:01:18 +0000
commit678139141fe306dd721c799b23af56111eaae37f (patch)
treecf53b8f4b5dcff71ca3e4230c62646ad50783ce2 /src/engine
parentfe61806905a86e7513df64d59ec8b4d31f184a33 (diff)
downloadingen-678139141fe306dd721c799b23af56111eaae37f.tar.gz
ingen-678139141fe306dd721c799b23af56111eaae37f.tar.bz2
ingen-678139141fe306dd721c799b23af56111eaae37f.zip
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
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/OSCEngineReceiver.cpp17
-rw-r--r--src/engine/OSCEngineReceiver.hpp2
-rw-r--r--src/engine/QueuedEngineInterface.cpp7
-rw-r--r--src/engine/QueuedEngineInterface.hpp1
-rw-r--r--src/engine/events.hpp1
-rw-r--r--src/engine/events/Get.cpp20
-rw-r--r--src/engine/events/Get.hpp9
-rw-r--r--src/engine/events/RequestPlugins.cpp59
-rw-r--r--src/engine/events/RequestPlugins.hpp51
-rw-r--r--src/engine/wscript1
10 files changed, 14 insertions, 154 deletions
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
- * <h2>/request_plugins</h2>
- * \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 <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 "RequestPlugins.hpp"
-#include "Request.hpp"
-#include "Engine.hpp"
-#include "ClientBroadcaster.hpp"
-#include "NodeFactory.hpp"
-
-namespace Ingen {
-namespace Events {
-
-
-RequestPlugins::RequestPlugins(Engine& engine, SharedPtr<Request> 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 <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_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> 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