and now with "d"
[ardour.git] / libs / ardour / plugin_insert.cc
index eaeb6d89af306e2a281d102898cce97f1197b139..7fb799d4923e22cbf24c0f606b744702d0ddf588 100644 (file)
@@ -57,7 +57,7 @@
 #include "ardour/session.h"
 #include "ardour/types.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -1346,7 +1346,7 @@ PluginInsert::no_sc_input_map () const
                for (ChanMapping::Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
                        uint32_t ins = natural_input_streams().get(tm->first) - _cached_sidechain_pins.get(tm->first);
                        for (ChanMapping::TypeMapping::const_iterator i = tm->second.begin(); i != tm->second.end(); ++i) {
-                               if (i->second < ins) {
+                               if (i->first < ins) {
                                        rv.set (tm->first, i->first + pc * ins, i->second);
                                }
                        }
@@ -2862,7 +2862,14 @@ PluginInsert::get_impulse_analysis_plugin()
                // during init() -- most notably block_size..
                // not great.
                ret = plugin_factory(_plugins[0]);
-               ret->configure_io (internal_input_streams (), internal_output_streams ());
+               ChanCount out (internal_output_streams ());
+               if (ret->get_info ()->reconfigurable_io ()) {
+                       // populate get_info ()->n_inputs and ->n_outputs
+                       ChanCount useins;
+                       ret->can_support_io_configuration (internal_input_streams (), out, &useins);
+                       assert (out == internal_output_streams ());
+               }
+               ret->configure_io (internal_input_streams (), out);
                _impulseAnalysisPlugin = ret;
        } else {
                ret = _impulseAnalysisPlugin.lock();
@@ -2959,10 +2966,9 @@ PluginInsert::latency_changed ()
 {
        // this is called in RT context, LatencyChanged is emitted after run()
        _latency_changed = true;
-#if 0 // TODO check possible deadlock in RT-context
        // XXX This also needs a proper API not an owner() hack.
-       static_cast<Route*>(owner ())->processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
-#endif
+       assert (owner ());
+       static_cast<Route*>(owner ())->processor_latency_changed (); /* EMIT SIGNAL */
 }
 
 void