From 8882ef79d3b4a536daa00e3a20e2c50e0c49bbe8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 4 May 2016 17:52:17 +0200 Subject: use existing API to find the instrument --- libs/ardour/route.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libs/ardour/route.cc') 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 Route::the_instrument_unlocked () const { for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { - if (boost::dynamic_pointer_cast(*i)) { - if ((*i)->input_streams().n_midi() > 0 && - (*i)->output_streams().n_audio() > 0) { - return (*i); - } + boost::shared_ptr pi = boost::dynamic_pointer_cast(*i); + if (pi && pi->plugin ()->get_info ()->is_instrument ()) { + return (*i); } } return boost::shared_ptr(); -- cgit v1.2.3