add processor lookup by PBD::ID via session
authorRobin Gareus <robin@gareus.org>
Sat, 20 Feb 2016 19:22:40 +0000 (20:22 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 20 Feb 2016 19:26:18 +0000 (20:26 +0100)
In preparation for Lua bindings this completes the basic set of
Session object lookup: route, source, controllable, region, processor

libs/ardour/ardour/session.h
libs/ardour/session.cc

index e28ff8e9661a720082ce8e03f857a8f6313a7d70..a3e352985442fa9379e149167012836afe09a2d4 100644 (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&);
 
index 75547b534897c5d077544c727ac3775daedb5fee..725d94c3cc13ec2be7fb887ed8bd15d91b007787 100644 (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)
 {