summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-04-19 00:30:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-04-19 00:30:55 +0000
commit0eee85f43b2435277c7cccda8e5145761bcb98a8 (patch)
tree6f1ddb53eb2c91511c4d60e9582d4631ea441dd2 /libs/ardour/route.cc
parent66398a7e1633ed67bbbc25f9cf65e7ef5551aa4b (diff)
add a simple method to return "the instrument" associated with a Route. see the comments about the semantics of this, which do not preclude 0..N "instruments" in a single route
git-svn-id: svn://localhost/ardour2/branches/3.0@12027 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 6e36a133e9..3f68e266eb 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -4054,3 +4054,15 @@ Route::has_external_redirects () const
return false;
}
+boost::shared_ptr<Processor>
+Route::the_instrument () const
+{
+ Glib::RWLock::WriterLock lm (_processor_lock);
+ for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ if ((*i)->input_streams().n_midi() > 0 &&
+ (*i)->output_streams().n_audio() > 0) {
+ return (*i);
+ }
+ }
+ return boost::shared_ptr<Processor>();
+}