diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 67d5735496..fe2689ffa7 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -90,6 +90,7 @@ #include "ardour/route.h" #include "ardour/route_graph.h" #include "ardour/transport_api.h" +#include "ardour/triggerbox.h" class XMLTree; class XMLNode; @@ -1195,6 +1196,8 @@ public: /* Controllables */ + boost::shared_ptr trigger_by_id (PBD::ID) const; + boost::shared_ptr processor_by_id (PBD::ID) const; boost::shared_ptr controllable_by_id (const PBD::ID&); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 3b595e9455..d9bd579e65 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4125,6 +4125,23 @@ Session::stripable_by_id (PBD::ID id) const return boost::shared_ptr(); } +boost::shared_ptr +Session::trigger_by_id (PBD::ID id) const +{ + boost::shared_ptr r = routes.reader (); + for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { + boost::shared_ptr box = (*i)->triggerbox(); + if (box) { + TriggerPtr trigger = box->trigger_by_id(id); + if (trigger) { + return trigger; + } + } + } + + return boost::shared_ptr (); +} + boost::shared_ptr Session::processor_by_id (PBD::ID id) const {