aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortassaron2022-05-08 00:48:50 -0400
committertassaron2022-05-08 00:48:50 -0400
commit4ab75a9a51789b22b24b9cd482de9b2a55d6c271 (patch)
tree6a513f522e37c270ecdd95d1fca00ae5890774bf /src
parentf35571743e7422088cf0f631d16d192c63f145e0 (diff)
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)
Diffstat (limited to 'src')
-rw-r--r--src/components/original.py5
-rw-r--r--src/components/original.ui85
2 files changed, 51 insertions, 39 deletions
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 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@@ -58,70 +58,61 @@
</spacer>
</item>
<item>
- <widget class="QLabel" name="label">
+ <widget class="QLabel" name="label_visColor">
<property name="text">
- <string>Scale</string>
+ <string>Color</string>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="spinBox_scale">
- <property name="buttonSymbols">
- <enum>QAbstractSpinBox::PlusMinus</enum>
+ <widget class="QPushButton" name="pushButton_visColor">
+ <property name="maximumSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
</property>
- <property name="minimum">
- <number>1</number>
+ <property name="text">
+ <string/>
</property>
- <property name="value">
- <number>20</number>
+ <property name="MaximumSize" stdset="0">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
</property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer">
+ <widget class="QLineEdit" name="lineEdit_visColor"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
<property name="sizeHint" stdset="0">
<size>
- <width>5</width>
+ <width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
- <widget class="QLabel" name="label_visColor">
+ <widget class="QLabel" name="label_3">
<property name="text">
- <string>Color</string>
+ <string>Sensitivity</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_visColor">
- <property name="maximumSize">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="MaximumSize" stdset="0">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
+ <widget class="QSpinBox" name="spinBox_smooth">
+ <property name="maximum">
+ <number>5</number>
</property>
</widget>
</item>
- <item>
- <widget class="QLineEdit" name="lineEdit_visColor"/>
- </item>
</layout>
</item>
<item>
@@ -156,7 +147,7 @@
</widget>
</item>
<item>
- <spacer name="horizontalSpacer_2">
+ <spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -165,12 +156,32 @@
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>5</width>
+ <width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Scale</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinBox_scale">
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::PlusMinus</enum>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>20</number>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>