add new API to Route to get name of "well-known" nth-send
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 29 Jan 2016 04:02:11 +0000 (23:02 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 29 Jan 2016 04:05:28 +0000 (23:05 -0500)
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
libs/ardour/route.cc

index 864ae911e50683bffaf60c85e27f93bec23f27ff..edad4fd26622709a79f07f16eae28b5d4c83b74a 100644 (file)
@@ -562,6 +562,10 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
          */
         boost::shared_ptr<AutomationControl> send_level_controllable (uint32_t n) const;
         boost::shared_ptr<AutomationControl> 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 ();
 
index 9f29dbad758d5b995deb0f182c433b5ec8f3c0e6..6effb27fc47b237680839a8fd2e791a4ef4b61eb 100644 (file)
@@ -5551,3 +5551,23 @@ Route::send_enable_controllable (uint32_t n) const
        return boost::shared_ptr<AutomationControl>();
 #endif
 }
+
+string
+Route::send_name (uint32_t n) const
+{
+#ifdef MIXBUS
+       if (n >= 8) {
+               return string();
+       }
+       boost::shared_ptr<Route> r = _session.get_mixbus (n);
+       assert (r);
+       return r->name();
+#else
+       boost::shared_ptr<Processor> p = nth_send (n);
+       if (p) {
+               return p->name();
+       } else {
+               return string();
+       }
+#endif
+}