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 +-- src/components/original.ui | 85 ++++++++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 39 deletions(-) (limited to 'src/components') 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 = {} diff --git a/src/components/original.ui b/src/components/original.ui index a4d5119..5df2f96 100644 --- a/src/components/original.ui +++ b/src/components/original.ui @@ -47,7 +47,7 @@ Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::MinimumExpanding @@ -58,70 +58,61 @@ - + - Scale + Color - - - QAbstractSpinBox::PlusMinus + + + + 32 + 32 + - - 1 + + - - 20 + + + 32 + 32 + - + + + + Qt::Horizontal - - QSizePolicy::Fixed - - 5 + 40 20 - + - Color + Sensitivity - - - - 32 - 32 - - - - - - - - 32 - 32 - + + + 5 - - - @@ -156,7 +147,7 @@ - + Qt::Horizontal @@ -165,12 +156,32 @@ - 5 + 40 20 + + + + Scale + + + + + + + QAbstractSpinBox::PlusMinus + + + 1 + + + 20 + + + -- cgit v1.2.3