summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortassaron2022-05-08 00:48:50 -0400
committertassaron2022-05-08 00:48:50 -0400
commit4ab75a9a51789b22b24b9cd482de9b2a55d6c271 (patch)
tree6a513f522e37c270ecdd95d1fca00ae5890774bf
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)
-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):
38 'layout': self.page.comboBox_visLayout, 38 'layout': self.page.comboBox_visLayout,
39 'scale': self.page.spinBox_scale, 39 'scale': self.page.spinBox_scale,
40 'y': self.page.spinBox_y, 40 'y': self.page.spinBox_y,
41 'smooth': self.page.spinBox_smooth,
41 }, colorWidgets={ 42 }, colorWidgets={
42 'visColor': self.page.pushButton_visColor, 43 'visColor': self.page.pushButton_visColor,
43 }, relativeWidgets=[ 44 }, relativeWidgets=[
@@ -53,8 +54,8 @@ class Component(Component):
53 54
54 def preFrameRender(self, **kwargs): 55 def preFrameRender(self, **kwargs):
55 super().preFrameRender(**kwargs) 56 super().preFrameRender(**kwargs)
56 self.smoothConstantDown = 0.08 57 self.smoothConstantDown = 0.08 + 0 if not self.smooth else self.smooth / 15
57 self.smoothConstantUp = 0.8 58 self.smoothConstantUp = 0.8 - 0 if not self.smooth else self.smooth / 15
58 self.lastSpectrum = None 59 self.lastSpectrum = None
59 self.spectrumArray = {} 60 self.spectrumArray = {}
60 61
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 @@
47 <enum>Qt::Horizontal</enum> 47 <enum>Qt::Horizontal</enum>
48 </property> 48 </property>
49 <property name="sizeType"> 49 <property name="sizeType">
50 <enum>QSizePolicy::Fixed</enum> 50 <enum>QSizePolicy::MinimumExpanding</enum>
51 </property> 51 </property>
52 <property name="sizeHint" stdset="0"> 52 <property name="sizeHint" stdset="0">
53 <size> 53 <size>
@@ -58,70 +58,61 @@
58 </spacer> 58 </spacer>
59 </item> 59 </item>
60 <item> 60 <item>
61 <widget class="QLabel" name="label"> 61 <widget class="QLabel" name="label_visColor">
62 <property name="text"> 62 <property name="text">
63 <string>Scale</string> 63 <string>Color</string>
64 </property> 64 </property>
65 </widget> 65 </widget>
66 </item> 66 </item>
67 <item> 67 <item>
68 <widget class="QSpinBox" name="spinBox_scale"> 68 <widget class="QPushButton" name="pushButton_visColor">
69 <property name="buttonSymbols"> 69 <property name="maximumSize">
70 <enum>QAbstractSpinBox::PlusMinus</enum> 70 <size>
71 <width>32</width>
72 <height>32</height>
73 </size>
71 </property> 74 </property>
72 <property name="minimum"> 75 <property name="text">
73 <number>1</number> 76 <string/>
74 </property> 77 </property>
75 <property name="value"> 78 <property name="MaximumSize" stdset="0">
76 <number>20</number> 79 <size>
80 <width>32</width>
81 <height>32</height>
82 </size>
77 </property> 83 </property>
78 </widget> 84 </widget>
79 </item> 85 </item>
80 <item> 86 <item>
81 <spacer name="horizontalSpacer"> 87 <widget class="QLineEdit" name="lineEdit_visColor"/>
88 </item>
89 <item>
90 <spacer name="horizontalSpacer_2">
82 <property name="orientation"> 91 <property name="orientation">
83 <enum>Qt::Horizontal</enum> 92 <enum>Qt::Horizontal</enum>
84 </property> 93 </property>
85 <property name="sizeType">
86 <enum>QSizePolicy::Fixed</enum>
87 </property>
88 <property name="sizeHint" stdset="0"> 94 <property name="sizeHint" stdset="0">
89 <size> 95 <size>
90 <width>5</width> 96 <width>40</width>
91 <height>20</height> 97 <height>20</height>
92 </size> 98 </size>
93 </property> 99 </property>
94 </spacer> 100 </spacer>
95 </item> 101 </item>
96 <item> 102 <item>
97 <widget class="QLabel" name="label_visColor"> 103 <widget class="QLabel" name="label_3">
98 <property name="text"> 104 <property name="text">
99 <string>Color</string> 105 <string>Sensitivity</string>
100 </property> 106 </property>
101 </widget> 107 </widget>
102 </item> 108 </item>
103 <item> 109 <item>
104 <widget class="QPushButton" name="pushButton_visColor"> 110 <widget class="QSpinBox" name="spinBox_smooth">
105 <property name="maximumSize"> 111 <property name="maximum">
106 <size> 112 <number>5</number>
107 <width>32</width>
108 <height>32</height>
109 </size>
110 </property>
111 <property name="text">
112 <string/>
113 </property>
114 <property name="MaximumSize" stdset="0">
115 <size>
116 <width>32</width>
117 <height>32</height>
118 </size>
119 </property> 113 </property>
120 </widget> 114 </widget>
121 </item> 115 </item>
122 <item>
123 <widget class="QLineEdit" name="lineEdit_visColor"/>
124 </item>
125 </layout> 116 </layout>
126 </item> 117 </item>
127 <item> 118 <item>
@@ -156,7 +147,7 @@
156 </widget> 147 </widget>
157 </item> 148 </item>
158 <item> 149 <item>
159 <spacer name="horizontalSpacer_2"> 150 <spacer name="horizontalSpacer_3">
160 <property name="orientation"> 151 <property name="orientation">
161 <enum>Qt::Horizontal</enum> 152 <enum>Qt::Horizontal</enum>
162 </property> 153 </property>
@@ -165,12 +156,32 @@
165 </property> 156 </property>
166 <property name="sizeHint" stdset="0"> 157 <property name="sizeHint" stdset="0">
167 <size> 158 <size>
168 <width>5</width> 159 <width>40</width>
169 <height>20</height> 160 <height>20</height>
170 </size> 161 </size>
171 </property> 162 </property>
172 </spacer> 163 </spacer>
173 </item> 164 </item>
165 <item>
166 <widget class="QLabel" name="label">
167 <property name="text">
168 <string>Scale</string>
169 </property>
170 </widget>
171 </item>
172 <item>
173 <widget class="QSpinBox" name="spinBox_scale">
174 <property name="buttonSymbols">
175 <enum>QAbstractSpinBox::PlusMinus</enum>
176 </property>
177 <property name="minimum">
178 <number>1</number>
179 </property>
180 <property name="value">
181 <number>20</number>
182 </property>
183 </widget>
184 </item>
174 </layout> 185 </layout>
175 </item> 186 </item>
176 <item> 187 <item>