X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fplugin_insert.cc;h=13ac7b375a96510426e15074e32d850b98c5f5d2;hb=944c32346b3c6bb87fccb22f159bdd9297bae50d;hp=10368bfb428bf6a1b3efc3a235e22cf7c3d7a89c;hpb=3020b224fa2d6e1b6b8a576e8e8e211e0585f2a2;p=ardour.git diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 10368bfb42..13ac7b375a 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -464,39 +464,31 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end } } 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 */ - - uint32_t in = input_streams ().n_audio (); - uint32_t out = output_streams().n_audio (); + } else if (out > in) { - if (out > in) { + /* not active, but something has make up for any channel count increase */ - /* 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; @@ -719,6 +711,10 @@ PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) 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(); @@ -977,6 +973,22 @@ PluginInsert::set_state(const XMLNode& node, int version) boost::shared_ptr 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"