diff options
author | David Robillard <d@drobilla.net> | 2017-03-09 08:33:21 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-03-09 08:33:21 +0100 |
commit | 83d366452af8e93f0722658d730528d699f21e2b (patch) | |
tree | db66b0653d57ca2e2939a1352b3d45aeada4689e /src/server/events | |
parent | e360392489fe62dbae1f0c28b7f5fb839851f5f6 (diff) | |
download | ingen-83d366452af8e93f0722658d730528d699f21e2b.tar.gz ingen-83d366452af8e93f0722658d730528d699f21e2b.tar.bz2 ingen-83d366452af8e93f0722658d730528d699f21e2b.zip |
Preliminary port groups workgroups
Diffstat (limited to 'src/server/events')
-rw-r--r-- | src/server/events/Delta.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 9f4c1da2..fb8b4c20 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -32,6 +32,7 @@ #include "Delta.hpp" #include "Engine.hpp" #include "GraphImpl.hpp" +#include "GroupImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" #include "PortType.hpp" @@ -190,8 +191,8 @@ Delta::pre_process(PreProcessContext& ctx) if (is_graph_object && !_object) { Raul::Path path(uri_to_path(_subject)); - bool is_graph = false, is_block = false, is_port = false, is_output = false; - Ingen::Resource::type(uris, _properties, is_graph, is_block, is_port, is_output); + bool is_graph = false, is_block = false, is_port = false, is_output = false, is_group = false; + Ingen::Resource::type(uris, _properties, is_graph, is_block, is_port, is_output, is_group); if (is_graph) { _create_event = new CreateGraph( @@ -203,14 +204,22 @@ Delta::pre_process(PreProcessContext& ctx) _create_event = new CreatePort( _engine, _request_client, _request_id, _time, path, _properties); + } else if (is_group) { + NodeImpl* const parent = dynamic_cast<NodeImpl*>( + _engine.store()->get(path.parent())); + if (!parent) { + return Event::pre_process_done(Status::PARENT_NOT_FOUND, path.parent()); + } + _object = new GroupImpl(uris, parent, Raul::Symbol(path.symbol())); } + if (_create_event) { if (_create_event->pre_process(ctx)) { _object = _engine.store()->get(path); // Get object for setting } else { return Event::pre_process_done(Status::CREATION_FAILED, _subject); } - } else { + } else if (!is_group) { return Event::pre_process_done(Status::BAD_OBJECT_TYPE, _subject); } } |