13
0

make instruments/generators do the right thing when bypassed

git-svn-id: svn://localhost/ardour2/branches/3.0@9498 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-05-12 00:16:16 +00:00
parent 3ae786bb06
commit e22f93407b

View File

@ -413,21 +413,38 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end
} else {
/* FIXME: type, audio only */
if (is_generator()) {
uint32_t in = _plugins[0]->get_info()->n_inputs.n_audio();
uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
/* silence all (audio) outputs. Should really declick
* at the transitions of "active"
*/
if (out > in) {
uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
/* not active, but something has make up for any channel count increase */
for (uint32_t n = out - in; n < out; ++n) {
memcpy (bufs.get_audio(n).data(), bufs.get_audio(in - 1).data(), sizeof (Sample) * nframes);
for (uint32_t n = 0; n < out; ++n) {
bufs.get_audio (n).silence (nframes);
}
}
bufs.count().set_audio(out);
bufs.count().set_audio (out);
} else {
/* does this need to be done with MIDI? it appears not */
uint32_t in = _plugins[0]->get_info()->n_inputs.n_audio();
uint32_t out = _plugins[0]->get_info()->n_outputs.n_audio();
if (out > in) {
/* not active, but something has make up for any channel count increase */
for (uint32_t n = out - in; n < out; ++n) {
memcpy (bufs.get_audio(n).data(), bufs.get_audio(in - 1).data(), sizeof (Sample) * nframes);
}
}
bufs.count().set_audio (out);
}
}
_active = _pending_active;