13
0

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
This commit is contained in:
Paul Davis 2016-01-28 23:02:11 -05:00
parent c0a843a905
commit 4a5b81a838
2 changed files with 24 additions and 0 deletions

View 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 ();

View 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
}