From ff427be0fac07e8983e32822a541f8172800444f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 20 Feb 2016 20:22:40 +0100 Subject: [PATCH] add processor lookup by PBD::ID via session In preparation for Lua bindings this completes the basic set of Session object lookup: route, source, controllable, region, processor --- libs/ardour/ardour/session.h | 2 ++ libs/ardour/session.cc | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index e28ff8e966..a3e3529854 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -916,6 +916,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* Controllables */ + boost::shared_ptr processor_by_id (PBD::ID) const; + boost::shared_ptr controllable_by_id (const PBD::ID&); boost::shared_ptr controllable_by_descriptor (const PBD::ControllableDescriptor&); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 75547b5348..725d94c3cc 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4016,6 +4016,21 @@ Session::route_by_id (PBD::ID id) return boost::shared_ptr ((Route*) 0); } +boost::shared_ptr +Session::processor_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 p = (*i)->Route::processor_by_id (id); + if (p) { + return p; + } + } + + return boost::shared_ptr (); +} + boost::shared_ptr Session::track_by_diskstream_id (PBD::ID id) {