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
This commit is contained in:
Robin Gareus 2016-02-20 20:22:40 +01:00
parent f0d40fb34a
commit ff427be0fa
2 changed files with 17 additions and 0 deletions

View File

@ -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&);

View File

@ -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)
{