aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorDH42017-05-31 02:15:09 -0500
committerDH42017-05-31 02:15:09 -0500
commitc21d6f5ea7c6d33e2ded44b823d2dbb5b9384d78 (patch)
treeaf722193bdb24e144cc198879e6601139a1f2ba2 /components
parent7240f25deb21db365f39d00c50eb07d41dc4c797 (diff)
New rendering engine partially implemented. Also added a live preview during rendering. FIXME: spectrum is out of sync / rendering too quickly.
Diffstat (limited to 'components')
-rw-r--r--components/original.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/components/original.py b/components/original.py
index 47e53b8..46e7182 100644
--- a/components/original.py
+++ b/components/original.py
@@ -49,13 +49,17 @@ class Component(__base__.Component):
self.smoothConstantDown = 0.08
self.smoothConstantUp = 0.8
self.lastSpectrum = None
-
+ self.spectrumArray = {}
+
+ for i in range(0, len(self.completeAudioArray), self.sampleSize):
+ spectrum = transformData(i, self.completeAudioArray, self.sampleSize,
+ self.smoothConstantDown, self.smoothConstantUp, self.lastSpectrum)
+ self.spectrumArray[i] = spectrum
+
def frameRender(self, moduleNo, frameNo):
- self.lastSpectrum = transformData(frameNo, self.completeAudioArray, self.sampleSize,
- self.smoothConstantDown, self.smoothConstantUp, self.lastSpectrum)
width = int(self.worker.core.settings.value('outputWidth'))
height = int(self.worker.core.settings.value('outputHeight'))
- return drawBars(width, height, self.lastSpectrum, self.visColor, self.layout)
+ return drawBars(width, height, self.spectrumArray[frameNo], self.visColor, self.layout)
def pickColor(self):
RGBstring, btnStyle = super().pickColor()