summaryrefslogtreecommitdiffstats
path: root/src/engine/events/RequestObjectEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-28 16:41:02 +0000
committerDavid Robillard <d@drobilla.net>2009-05-28 16:41:02 +0000
commitf2135439b806e9c375f2e8588be23ea53c69832c (patch)
tree1fb4eb82a282c22e81cf812c8e6abaece1ef947f /src/engine/events/RequestObjectEvent.cpp
parent80d3456eca9f8d8123b2045e3d20a9b0f02e9b3e (diff)
downloadingen-f2135439b806e9c375f2e8588be23ea53c69832c.tar.gz
ingen-f2135439b806e9c375f2e8588be23ea53c69832c.tar.bz2
ingen-f2135439b806e9c375f2e8588be23ea53c69832c.zip
Merge request_object and request_plugin.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2028 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events/RequestObjectEvent.cpp')
-rw-r--r--src/engine/events/RequestObjectEvent.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/engine/events/RequestObjectEvent.cpp b/src/engine/events/RequestObjectEvent.cpp
index dac76f2b..c17e4983 100644
--- a/src/engine/events/RequestObjectEvent.cpp
+++ b/src/engine/events/RequestObjectEvent.cpp
@@ -32,10 +32,15 @@ using namespace Raul;
namespace Ingen {
-RequestObjectEvent::RequestObjectEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Path& path)
+RequestObjectEvent::RequestObjectEvent(
+ Engine& engine,
+ SharedPtr<Responder> responder,
+ SampleCount timestamp,
+ const URI& uri)
: QueuedEvent(engine, responder, timestamp)
- , _path(path)
+ , _uri(uri)
, _object(NULL)
+ , _plugin(NULL)
{
}
@@ -43,7 +48,10 @@ RequestObjectEvent::RequestObjectEvent(Engine& engine, SharedPtr<Responder> resp
void
RequestObjectEvent::pre_process()
{
- _object = _engine.engine_store()->find_object(_path);
+ if (Path::is_valid(_uri.str()))
+ _object = _engine.engine_store()->find_object(Path(_uri.str()));
+ else
+ _plugin = _engine.node_factory()->plugin(_uri);
QueuedEvent::pre_process();
}
@@ -60,10 +68,14 @@ RequestObjectEvent::execute(ProcessContext& context)
void
RequestObjectEvent::post_process()
{
- if (!_object) {
+ if (!_object && !_plugin) {
_responder->respond_error("Unable to find object requested.");
} else if (_responder->client()) {
- ObjectSender::send_object(_responder->client(), _object, true);
+ _responder->respond_ok();
+ if (_object)
+ _responder->client()->put(_uri, _object->properties());
+ else if (_plugin)
+ _responder->client()->new_plugin(_uri, _plugin->type_uri(), _plugin->symbol());
} else {
_responder->respond_error("Unable to find client to send object.");
}