FFT analysis: use actual latency

Ardour allows to override a plugin's reported latency. So far this
was not taken into account when plotting the phase/freq response.
This commit is contained in:
Robin Gareus 2019-07-17 16:22:44 +02:00
parent 45f1220aa5
commit acf26b03a6
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -407,9 +407,15 @@ PluginEqGui::run_impulse_analysis ()
}
samplepos_t sample_pos = 0;
samplecnt_t latency = _plugin->signal_latency ();
samplecnt_t latency = _plugin_insert->effective_latency ();
samplecnt_t samples_remain = _buffer_size + latency;
/* Note: https://discourse.ardour.org/t/plugins-ladspa-questions/101292/15
* Capture the complete response from the beginning, and more than "latency" samples,
* Then unwrap the phase-response corresponding to reported latency, leaving the
* magnitude unchanged.
*/
_impulse_fft->reset ();
while (samples_remain > 0) {