From c21d6f5ea7c6d33e2ded44b823d2dbb5b9384d78 Mon Sep 17 00:00:00 2001 From: DH4 Date: Wed, 31 May 2017 02:15:09 -0500 Subject: New rendering engine partially implemented. Also added a live preview during rendering. FIXME: spectrum is out of sync / rendering too quickly. --- components/original.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'components') 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() -- cgit v1.2.3