From 021a52cc7562aa1c577519c6564ecf55619dba05 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 6 Apr 2016 02:01:17 +0200 Subject: [PATCH] Route API to query all outputs (incl sends) and graph-feeds --- libs/ardour/ardour/route.h | 3 +++ libs/ardour/route.cc | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 3cd225aa33..5cda2f0d59 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -91,6 +91,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou boost::shared_ptr input() const { return _input; } boost::shared_ptr output() const { return _output; } IOVector all_inputs () const; + IOVector all_outputs () const; ChanCount n_inputs() const { return _input->n_ports(); } ChanCount n_outputs() const { return _output->n_ports(); } @@ -371,6 +372,8 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou */ bool direct_feeds_according_to_graph (boost::shared_ptr, bool* via_send_only = 0); + bool feeds_according_to_graph (boost::shared_ptr); + struct FeedRecord { boost::weak_ptr r; bool sends_only; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 01ab80f9dc..ed23c0e23f 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3628,6 +3628,21 @@ Route::all_inputs () const return ios; } +IOVector +Route::all_outputs () const +{ + IOVector ios; + // _output is included via Delivery + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); + for (ProcessorList::const_iterator r = _processors.begin(); r != _processors.end(); ++r) { + boost::shared_ptr iop = boost::dynamic_pointer_cast(*r); + if (iop != 0 && iop->output()) { + ios.push_back (iop->output()); + } + } + return ios; +} + bool Route::direct_feeds_according_to_reality (boost::shared_ptr other, bool* via_send_only) { @@ -3679,6 +3694,12 @@ Route::direct_feeds_according_to_graph (boost::shared_ptr other, bool* vi return _session._current_route_graph.has (shared_from_this (), other, via_send_only); } +bool +Route::feeds_according_to_graph (boost::shared_ptr other) +{ + return _session._current_route_graph.feeds (shared_from_this (), other); +} + /** Called from the (non-realtime) butler thread when the transport is stopped */ void Route::nonrealtime_handle_transport_stopped (bool /*abort_ignored*/, bool /*did_locate*/, bool can_flush_processors) -- 2.30.2