From 88bd6307ee43f3c3609d5b2f49d440d285185765 Mon Sep 17 00:00:00 2001 From: ozpv <39195175+ozpv@users.noreply.github.com> Date: Mon, 18 May 2026 15:20:06 -0500 Subject: add window function parameter --- src/audio.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/audio.rs') diff --git a/src/audio.rs b/src/audio.rs index 71be7d3..9e50465 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -93,6 +93,7 @@ impl<'a> PluginAudioProcessor<'a, RetainPluginShared<'a>, RetainPluginMainThread } let prev_window_size = self.params.get_window_size(); + let prev_window_type = self.params.get_window_type().as_bits(); // Receive any param updates from the main thread and/or the GUI. let has_ui_param_updates = self.params.fetch_updates(&self.shared.params); @@ -113,6 +114,13 @@ impl<'a> PluginAudioProcessor<'a, RetainPluginShared<'a>, RetainPluginMainThread } } + // update change in window type if needed + let window_type = self.params.get_window_type(); + if prev_window_type != window_type.as_bits() { + self.fft_left.window_function(&window_type); + self.fft_right.window_function(&window_type); + } + // Now let's process the audio, while splitting the processing in batches between each // sample-accurate event. for event_batch in events.input.batch() { -- cgit v1.2.3