diff options
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 43 |
2 files changed, 35 insertions, 10 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index bdd535f39b..8dc3ea1b75 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -468,7 +468,6 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, bool _solo_safe; DataType _default_type; FedBy _fed_by; - FedBy _direct_fed_by; virtual ChanCount input_streams () const; @@ -500,7 +499,6 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, private: int _set_state_2X (const XMLNode&, int); void set_processor_state_2X (XMLNodeList const &, int); - bool sub_feeds (FedBy const &, boost::shared_ptr<Route>, bool* via_send_only = 0); static uint32_t order_key_cnt; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index a897f5a813..a7fb05ec15 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2673,7 +2673,7 @@ Route::clear_fed_by () } bool -Route::sub_feeds (Fedby const & fed_by, boost::shared_ptr<Route> other, bool* via_sends_only) +Route::feeds (boost::shared_ptr<Route> other, bool* via_sends_only) { const FedBy& fed_by (other->fed_by()); @@ -2694,15 +2694,42 @@ Route::sub_feeds (Fedby const & fed_by, boost::shared_ptr<Route> other, bool* vi } bool -Route::feeds (boost::shared_ptr<Route> other, bool* via_sends_only) +Route::direct_feeds (boost::shared_ptr<Route> other, bool* only_send) { - return sub_feeds (other->fed_by (), other, via_sends_only); -} + DEBUG_TRACE (DEBUG::Graph, string_compose ("Feeds? %1\n", _name)); -bool -Route::direct_feeds (boost::shared_ptr<Route> other, bool* via_sends_only) -{ - return sub_feeds (other->direct_fed_by (), other, via_sends_only); + if (_output->connected_to (other->input())) { + DEBUG_TRACE (DEBUG::Graph, string_compose ("\tdirect FEEDS %2\n", other->name())); + if (only_send) { + *only_send = false; + } + + return true; + } + + + for (ProcessorList::iterator r = _processors.begin(); r != _processors.end(); ++r) { + + boost::shared_ptr<IOProcessor> iop; + + if ((iop = boost::dynamic_pointer_cast<IOProcessor>(*r)) != 0) { + if (iop->feeds (other)) { + DEBUG_TRACE (DEBUG::Graph, string_compose ("\tIOP %1 does feed %2\n", iop->name(), other->name())); + if (only_send) { + *only_send = true; + } + return true; + } else { + DEBUG_TRACE (DEBUG::Graph, string_compose ("\tIOP %1 does NOT feed %2\n", iop->name(), other->name())); + } + } else { + DEBUG_TRACE (DEBUG::Graph, string_compose ("\tPROC %1 is not an IOP\n", (*r)->name())); + } + + } + + DEBUG_TRACE (DEBUG::Graph, string_compose ("\tdoes NOT feed %1\n", other->name())); + return false; } /** Called from the (non-realtime) butler thread when the transport is stopped */ |