aboutsummaryrefslogtreecommitdiff
path: root/src/components/original.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/original.py')
-rw-r--r--src/components/original.py42
1 files changed, 10 insertions, 32 deletions
diff --git a/src/components/original.py b/src/components/original.py
index 3d1a574..f886374 100644
--- a/src/components/original.py
+++ b/src/components/original.py
@@ -8,7 +8,6 @@ from copy import copy
from component import Component
from toolkit.frame import BlankFrame
-from toolkit import rgbFromString, pickColor
class Component(Component):
@@ -18,8 +17,10 @@ class Component(Component):
def names(*args):
return ['Original Audio Visualization']
+ def properties(self):
+ return ['pcm']
+
def widget(self, *args):
- self.visColor = (255, 255, 255)
self.scale = 20
self.y = 0
super().widget(*args)
@@ -30,34 +31,18 @@ class Component(Component):
self.page.comboBox_visLayout.addItem("Top")
self.page.comboBox_visLayout.setCurrentIndex(0)
- self.page.lineEdit_visColor.setText('%s,%s,%s' % self.visColor)
- self.page.pushButton_visColor.clicked.connect(lambda: self.pickColor())
- btnStyle = "QPushButton { background-color : %s; outline: none; }" \
- % QColor(*self.visColor).name()
- self.page.pushButton_visColor.setStyleSheet(btnStyle)
+ self.page.lineEdit_visColor.setText('255,255,255')
self.trackWidgets({
+ 'visColor': self.page.lineEdit_visColor,
'layout': self.page.comboBox_visLayout,
'scale': self.page.spinBox_scale,
'y': self.page.spinBox_y,
- })
-
- def update(self):
- self.visColor = rgbFromString(self.page.lineEdit_visColor.text())
- super().update()
-
- def loadPreset(self, pr, *args):
- super().loadPreset(pr, *args)
-
- self.page.lineEdit_visColor.setText('%s,%s,%s' % pr['visColor'])
- btnStyle = "QPushButton { background-color : %s; outline: none; }" \
- % QColor(*pr['visColor']).name()
- self.page.pushButton_visColor.setStyleSheet(btnStyle)
-
- def savePreset(self):
- saveValueStore = super().savePreset()
- saveValueStore['visColor'] = self.visColor
- return saveValueStore
+ }, colorWidgets={
+ 'visColor': self.page.pushButton_visColor,
+ }, relativeWidgets=[
+ 'y',
+ ])
def previewRender(self):
spectrum = numpy.fromfunction(
@@ -96,13 +81,6 @@ class Component(Component):
self.spectrumArray[arrayNo],
self.visColor, self.layout)
- def pickColor(self):
- RGBstring, btnStyle = pickColor()
- if not RGBstring:
- return
- self.page.lineEdit_visColor.setText(RGBstring)
- self.page.pushButton_visColor.setStyleSheet(btnStyle)
-
def transformData(
self, i, completeAudioArray, sampleSize,
smoothConstantDown, smoothConstantUp, lastSpectrum):