}
}
+ 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.
*/
}
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);
}
} else {
- if (has_no_audio_inputs()) {
+ uint32_t in = input_streams ().n_audio ();
+ uint32_t out = output_streams().n_audio ();
+
+ if (has_no_audio_inputs() || in == 0) {
/* silence all (audio) outputs. Should really declick
* at the transitions of "active"
*/
- uint32_t out = output_streams().n_audio ();
-
for (uint32_t n = 0; n < out; ++n) {
bufs.get_audio (n).silence (nframes);
}
- bufs.count().set_audio (out);
-
- } else {
-
- /* does this need to be done with MIDI? it appears not */
+ } else if (out > in) {
- uint32_t in = input_streams ().n_audio ();
- uint32_t out = output_streams().n_audio ();
+ /* not active, but something has make up for any channel count increase */
- if (out > in) {
-
- /* not active, but something has make up for any channel count increase */
-
- // TODO: option round-robin (n % in) or silence additional buffers ??
- for (uint32_t n = in; n < out; ++n) {
- bufs.get_audio(n).read_from(bufs.get_audio(in - 1), nframes);
- }
+ // TODO: option round-robin (n % in) or silence additional buffers ??
+ // for now , simply replicate last buffer
+ for (uint32_t n = in; n < out; ++n) {
+ bufs.get_audio(n).read_from(bufs.get_audio(in - 1), nframes);
}
-
- bufs.count().set_audio (out);
}
+
+ bufs.count().set_audio (out);
}
_active = _pending_active;
}
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;
PluginInsert::Match
PluginInsert::private_can_support_io_configuration (ChanCount const & inx, ChanCount& out)
{
+ if (_plugins.empty()) {
+ return Match();
+ }
+
PluginInfoPtr info = _plugins.front()->get_info();
ChanCount in; in += inx;
midi_bypass.reset();
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"