diff options
author | Robin Gareus <robin@gareus.org> | 2016-05-04 17:52:17 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-05-04 17:52:17 +0200 |
commit | 8882ef79d3b4a536daa00e3a20e2c50e0c49bbe8 (patch) | |
tree | b7f672a5da15c80379dc3f7886654a414278a9a6 /libs | |
parent | 106851b33a52b122cdded8fa2dd03c47bac955a9 (diff) |
use existing API to find the instrument
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/route.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 0e01134986..7cfcffdb37 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -5297,11 +5297,9 @@ boost::shared_ptr<Processor> Route::the_instrument_unlocked () const { for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { - if (boost::dynamic_pointer_cast<PluginInsert>(*i)) { - if ((*i)->input_streams().n_midi() > 0 && - (*i)->output_streams().n_audio() > 0) { - return (*i); - } + boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert>(*i); + if (pi && pi->plugin ()->get_info ()->is_instrument ()) { + return (*i); } } return boost::shared_ptr<Processor>(); |