From 4ab75a9a51789b22b24b9cd482de9b2a55d6c271 Mon Sep 17 00:00:00 2001 From: tassaron Date: Sun, 8 May 2022 00:48:50 -0400 Subject: Add sensitivity option to classic visualizer Allows to decide how balanced the up/down smoothing is. The default (0) is the same as before; increasing sensitivity makes the up/down values closer to each other (less smooth, more sensitive) --- src/components/original.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/components/original.py') diff --git a/src/components/original.py b/src/components/original.py index 80228fe..289e982 100644 --- a/src/components/original.py +++ b/src/components/original.py @@ -38,6 +38,7 @@ class Component(Component): 'layout': self.page.comboBox_visLayout, 'scale': self.page.spinBox_scale, 'y': self.page.spinBox_y, + 'smooth': self.page.spinBox_smooth, }, colorWidgets={ 'visColor': self.page.pushButton_visColor, }, relativeWidgets=[ @@ -53,8 +54,8 @@ class Component(Component): def preFrameRender(self, **kwargs): super().preFrameRender(**kwargs) - self.smoothConstantDown = 0.08 - self.smoothConstantUp = 0.8 + self.smoothConstantDown = 0.08 + 0 if not self.smooth else self.smooth / 15 + self.smoothConstantUp = 0.8 - 0 if not self.smooth else self.smooth / 15 self.lastSpectrum = None self.spectrumArray = {} -- cgit v1.2.3