use existing API to find the instrument
authorRobin Gareus <robin@gareus.org>
Wed, 4 May 2016 15:52:17 +0000 (17:52 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 4 May 2016 15:52:17 +0000 (17:52 +0200)
libs/ardour/route.cc

index 0e0113498689c7c6230f1d213f7d587054d8befa..7cfcffdb37c338500fa2932ef9a478ca564f8ea1 100644 (file)
@@ -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>();