summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-04-03 20:24:14 +0200
committerRobin Gareus <robin@gareus.org>2016-04-03 22:45:23 +0200
commitdaa10a6a38638da3b9c5e6de615367e44ccf4e4c (patch)
treeaa45975c5a9d7503167c29d0c366553464d68b00 /libs/ardour/route.cc
parent650f2802a0ac634dbcfa33172bf3bf51aa571845 (diff)
Fix graph ordering incl. Inserts, Returns and SideChains
When building the process graph. Ardour usess Route::direct_feeds_according_to_reality() This function only tests if the current route (or any ioprocessors) is feeding another route's *input*. Inserts, Return and now Sidechains are ignored as destinations on the destination route are not taken into account. This is now resolved by adding an IOVector, a collection of all inputs of the destination route.
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc44
1 files changed, 41 insertions, 3 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 44c0028926..959b546def 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -3601,12 +3601,43 @@ Route::feeds (boost::shared_ptr<Route> other, bool* via_sends_only)
return false;
}
+IOVector
+Route::all_inputs () const
+{
+ /* TODO, if this works as expected,
+ * cache the IOVector and maintain it via
+ * input_change_handler(), sidechain_change_handler() etc
+ */
+ IOVector ios;
+ ios.push_back (_input);
+
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
+ for (ProcessorList::const_iterator r = _processors.begin(); r != _processors.end(); ++r) {
+
+ boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor>(*r);
+ boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert>(*r);
+ if (pi != 0) {
+ assert (iop == 0);
+ iop = pi->sidechain();
+ }
+
+ if (iop != 0 && iop->input()) {
+ ios.push_back (iop->input());
+ }
+ }
+ return ios;
+}
+
bool
Route::direct_feeds_according_to_reality (boost::shared_ptr<Route> other, bool* via_send_only)
{
DEBUG_TRACE (DEBUG::Graph, string_compose ("Feeds? %1\n", _name));
-
- if (_output->connected_to (other->input())) {
+#if 0
+ if (_output->connected_to (other->input()))
+#else
+ if (other->all_inputs().fed_by (_output))
+#endif
+ {
DEBUG_TRACE (DEBUG::Graph, string_compose ("\tdirect FEEDS %2\n", other->name()));
if (via_send_only) {
*via_send_only = false;
@@ -3616,6 +3647,7 @@ Route::direct_feeds_according_to_reality (boost::shared_ptr<Route> other, bool*
}
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock); // XXX
for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) {
boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor>(*r);
@@ -3626,7 +3658,13 @@ Route::direct_feeds_according_to_reality (boost::shared_ptr<Route> other, bool*
}
if (iop != 0) {
- if (iop->feeds (other)) {
+#if 0
+ if (iop->feeds (other))
+#else
+ boost::shared_ptr<const IO> iop_out = iop->output();
+ if (iop_out && other->all_inputs().fed_by (iop_out))
+#endif
+ {
DEBUG_TRACE (DEBUG::Graph, string_compose ("\tIOP %1 does feed %2\n", iop->name(), other->name()));
if (via_send_only) {
*via_send_only = true;