merge with master and fix 4 conflicts by hand
[ardour.git] / libs / ardour / plugin_insert.cc
index ae018fb2a3c53544c5e20034e4b13455b87d16ef..5279a3696216e3ac216ed11e57d8adb5a6b80168 100644 (file)
@@ -352,6 +352,9 @@ PluginInsert::connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t of
                }
        }
 
+       bufs.set_count(ChanCount::max(bufs.count(), in_streams));
+       bufs.set_count(ChanCount::max(bufs.count(), out_streams));
+
        /* Note that we've already required that plugins
           be able to handle in-place processing.
        */
@@ -452,13 +455,13 @@ PluginInsert::silence (framecnt_t nframes)
 }
 
 void
-PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_frame*/, pframes_t nframes, bool)
+PluginInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t /*end_frame*/, pframes_t nframes, bool)
 {
        if (_pending_active) {
                /* run as normal if we are active or moving from inactive to active */
 
-               if (_session.transport_rolling()) {
-                       automation_run (bufs, nframes);
+               if (_session.transport_rolling() || _session.bounce_processing()) {
+                       automation_run (bufs, start_frame, nframes);
                } else {
                        connect_and_run (bufs, nframes, 0, false);
                }
@@ -535,10 +538,10 @@ PluginInsert::get_parameter (Evoral::Parameter param)
 }
 
 void
-PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes)
+PluginInsert::automation_run (BufferSet& bufs, framepos_t start, pframes_t nframes)
 {
        Evoral::ControlEvent next_event (0, 0.0f);
-       framepos_t now = _session.transport_frame ();
+       framepos_t now = start;
        framepos_t end = now + nframes;
        framecnt_t offset = 0;
 
@@ -973,6 +976,22 @@ PluginInsert::set_state(const XMLNode& node, int version)
 
        boost::shared_ptr<Plugin> plugin = find_plugin (_session, prop->value(), type);
 
+       /* treat linux and windows VST plugins equivalent if they have the same uniqueID
+        * allow to move sessions windows <> linux */
+#ifdef LXVST_SUPPORT
+       if (plugin == 0 && type == ARDOUR::Windows_VST) {
+               type = ARDOUR::LXVST;
+               plugin = find_plugin (_session, prop->value(), type);
+       }
+#endif
+
+#ifdef WINDOWS_VST_SUPPORT
+       if (plugin == 0 && type == ARDOUR::LXVST) {
+               type = ARDOUR::Windows_VST;
+               plugin = find_plugin (_session, prop->value(), type);
+       }
+#endif
+
        if (plugin == 0) {
                error << string_compose(
                        _("Found a reference to a plugin (\"%1\") that is unknown.\n"