diff options
author | Robin Gareus <robin@gareus.org> | 2016-02-20 20:22:40 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-20 20:26:18 +0100 |
commit | ff427be0fac07e8983e32822a541f8172800444f (patch) | |
tree | 9ba134acf7a63bbfca3bf74d283b594156cb20b6 /libs | |
parent | f0d40fb34a8975972fad9b196808c667fe323a8d (diff) |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 15 |
2 files changed, 17 insertions, 0 deletions
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> processor_by_id (PBD::ID) const; + boost::shared_ptr<PBD::Controllable> controllable_by_id (const PBD::ID&); boost::shared_ptr<PBD::Controllable> 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> ((Route*) 0); } +boost::shared_ptr<Processor> +Session::processor_by_id (PBD::ID id) const +{ + boost::shared_ptr<RouteList> r = routes.reader (); + + for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { + boost::shared_ptr<Processor> p = (*i)->Route::processor_by_id (id); + if (p) { + return p; + } + } + + return boost::shared_ptr<Processor> (); +} + boost::shared_ptr<Track> Session::track_by_diskstream_id (PBD::ID id) { |