try not thinning when loading old-school automation lists
[ardour.git] / libs / ardour / route.cc
index 10898cac0e93ac840543d2b5d55b756b3e884315..1948ba14aa63aa265f1f4e1d7cfaf1e403137fc6 100644 (file)
 #include "pbd/convert.h"
 #include "pbd/boost_debug.h"
 
-#include "evoral/Curve.hpp"
-
 #include "ardour/amp.h"
-#include "ardour/audio_port.h"
+#include "ardour/audio_buffer.h"
 #include "ardour/audioengine.h"
 #include "ardour/buffer.h"
 #include "ardour/buffer_set.h"
-#include "ardour/configuration.h"
-#include "ardour/cycle_timer.h"
+#include "ardour/capturing_processor.h"
 #include "ardour/debug.h"
 #include "ardour/delivery.h"
-#include "ardour/dB.h"
-#include "ardour/internal_send.h"
 #include "ardour/internal_return.h"
-#include "ardour/ladspa_plugin.h"
+#include "ardour/internal_send.h"
 #include "ardour/meter.h"
-#include "ardour/mix.h"
 #include "ardour/monitor_processor.h"
 #include "ardour/pannable.h"
-#include "ardour/panner.h"
 #include "ardour/panner_shell.h"
 #include "ardour/plugin_insert.h"
 #include "ardour/port.h"
 #include "ardour/port_insert.h"
 #include "ardour/processor.h"
-#include "ardour/profile.h"
 #include "ardour/route.h"
 #include "ardour/route_group.h"
 #include "ardour/send.h"
 #include "ardour/session.h"
-#include "ardour/timestamps.h"
-#include "ardour/utils.h"
 #include "ardour/unknown_processor.h"
-#include "ardour/capturing_processor.h"
+#include "ardour/utils.h"
 
 #include "i18n.h"
 
@@ -522,10 +512,13 @@ Route::process_output_buffers (BufferSet& bufs,
                /* if it has any inputs, make sure they match */
                if (boost::dynamic_pointer_cast<UnknownProcessor> (*i) == 0 && (*i)->input_streams() != ChanCount::ZERO) {
                        if (bufs.count() != (*i)->input_streams()) {
-                               cerr << _name << " bufs = " << bufs.count()
-                                    << " input for " << (*i)->name() << " = " << (*i)->input_streams()
-                                    << endl;
-                               abort ();
+                               DEBUG_TRACE (
+                                       DEBUG::Processors, string_compose (
+                                               "%1 bufs = %2 input for %3 = %4\n",
+                                               _name, bufs.count(), (*i)->name(), (*i)->input_streams()
+                                               )
+                                       );
+                               continue;
                        }
                }
 #endif
@@ -4051,3 +4044,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>();
+}