From 2a37fbef6832aebfcb22feefa0bb05104eb6f018 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 9 Jun 2013 02:27:16 +0000 Subject: Inherit certain properties from ports connected to patch ports. This is a bit too hard-edged at present, but does the right thing when building a patch from scratch at least. Something needs to be done about removing the properties, but this is hard for outputs since the arcs aren't keyed that way. The main problem here is that Ardour barfs on plugins with MIDI input for audio tracks, so if you *ever* connect the control input to a MIDI anything, it will stick and not work in an Ardour audio track. Maybe it should be just implemented for inputs as a stop gap... git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5136 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/Connect.cpp | 11 +++++++++++ src/server/events/Connect.hpp | 4 ++++ 2 files changed, 15 insertions(+) (limited to 'src/server/events') diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index 4c4a3974..75659452 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -124,6 +124,9 @@ Connect::pre_process() _graph->add_arc(_arc); _head->increment_num_arcs(); + + tail_output->inherit_neighbour(_head, _tail_remove, _tail_add); + _head->inherit_neighbour(tail_output, _head_remove, _head_add); } _buffers = new Raul::Array(_head->poly()); @@ -156,6 +159,14 @@ Connect::post_process() Broadcaster::Transfer t(*_engine.broadcaster()); if (respond() == Status::SUCCESS) { _engine.broadcaster()->connect(_tail_path, _head_path); + if (!_tail_remove.empty() || !_tail_add.empty()) { + _engine.broadcaster()->delta( + Node::path_to_uri(_tail_path), _tail_remove, _tail_add); + } + if (!_tail_remove.empty() || !_tail_add.empty()) { + _engine.broadcaster()->delta( + Node::path_to_uri(_tail_path), _tail_remove, _tail_add); + } } } diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index 4b515087..d5e58a99 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -64,6 +64,10 @@ private: CompiledGraph* _compiled_graph; SPtr _arc; Raul::Array* _buffers; + Resource::Properties _tail_remove; + Resource::Properties _tail_add; + Resource::Properties _head_remove; + Resource::Properties _head_add; }; } // namespace Events -- cgit v1.2.1