From 94d2f7cfc7e573c6fdd7487b1ab207d01e9fdbcf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 25 Oct 2015 05:10:37 +0000 Subject: Create all graphs the same way This ensures that subgraphs always have the standard control ports, so they are valid Ingen graphs on their own.. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5783 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/CreatePort.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/server/events/CreatePort.cpp') diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 4988c480..0f711f4f 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -41,7 +41,6 @@ CreatePort::CreatePort(Engine& engine, int32_t id, SampleCount timestamp, const Raul::Path& path, - bool is_output, const Resource::Properties& properties) : Event(engine, client, id, timestamp) , _path(path) @@ -53,7 +52,6 @@ CreatePort::CreatePort(Engine& engine, , _old_ports_array(NULL) , _engine_port(NULL) , _properties(properties) - , _is_output(is_output) { const Ingen::URIs& uris = _engine.world()->uris(); @@ -71,6 +69,10 @@ CreatePort::CreatePort(Engine& engine, _port_type = PortType::CV; } else if (type == uris.atom_AtomPort) { _port_type = PortType::ATOM; + } else if (type == uris.lv2_InputPort) { + _flow = Flow::INPUT; + } else if (type == uris.lv2_OutputPort) { + _flow = Flow::OUTPUT; } } @@ -88,6 +90,8 @@ CreatePort::pre_process() { if (_port_type == PortType::UNKNOWN) { return Event::pre_process_done(Status::UNKNOWN_TYPE, _path); + } else if (!_flow) { + return Event::pre_process_done(Status::UNKNOWN_TYPE, _path); } else if (_path.is_root()) { return Event::pre_process_done(Status::BAD_URI, _path); } else if (_engine.store()->get(_path)) { @@ -136,12 +140,12 @@ CreatePort::pre_process() _graph->num_ports_non_rt(), polyphonic, _port_type, _buf_type, buf_size, - value, _is_output); + value, _flow == Flow::OUTPUT); _graph_port->properties().insert(_properties.begin(), _properties.end()); _engine.store()->add(_graph_port); - if (_is_output) { + if (_flow == Flow::OUTPUT) { _graph->add_output(*_graph_port); } else { _graph->add_input(*_graph_port); -- cgit v1.2.1