From 4a5b81a8384e1fcbe120a71d7841922f2748c05a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 28 Jan 2016 23:02:11 -0500 Subject: add new API to Route to get name of "well-known" nth-send Route::nth_send() has the wrong semantics in Mixbus for this purpose. Probably need to revisit this at some point --- libs/ardour/ardour/route.h | 4 ++++ libs/ardour/route.cc | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 864ae911e5..edad4fd266 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -562,6 +562,10 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou */ boost::shared_ptr send_level_controllable (uint32_t n) const; boost::shared_ptr send_enable_controllable (uint32_t n) const; + /* for the same value of @param n, this returns the name of the send + * associated with the pair of controllables returned by the above two methods. + */ + std::string send_name (uint32_t n) const; void protect_automation (); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 9f29dbad75..6effb27fc4 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -5551,3 +5551,23 @@ Route::send_enable_controllable (uint32_t n) const return boost::shared_ptr(); #endif } + +string +Route::send_name (uint32_t n) const +{ +#ifdef MIXBUS + if (n >= 8) { + return string(); + } + boost::shared_ptr r = _session.get_mixbus (n); + assert (r); + return r->name(); +#else + boost::shared_ptr p = nth_send (n); + if (p) { + return p->name(); + } else { + return string(); + } +#endif +} -- cgit v1.2.3