|
From: Tapio V. <aa...@us...> - 2011-01-27 17:28:12
|
Module: editor
Branch: master
Commit: da2e1f3bba92791e39d09912ca419bf1984962f2
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jan 27 19:27:36 2011 +0200
Fix progress bar.
---
pitchvis.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pitchvis.cc b/pitchvis.cc
index 5100d0f..4c9378a 100644
--- a/pitchvis.cc
+++ b/pitchvis.cc
@@ -34,9 +34,10 @@ void PitchVis::run()
FFmpeg mpeg(fileName.toStdString(), rate);
setWidth(pixScale * mpeg.duration() * rate / step); // Estimation
curX = 0;
- for (std::vector<float> data(step*2); mpeg.audioQueue(&*data.begin(), &*data.end(), curX * step * 2); ++curX) {
+ int i = 0;
+ for (std::vector<float> data(step*2); mpeg.audioQueue(&*data.begin(), &*data.end(), i * step * 2); ++i, curX += pixScale) {
// Mix stereo into mono
- for (unsigned i = 0; i < step; ++i) data[i] = 0.5 * (data[2*i] + data[2*i + 1]);
+ for (unsigned j = 0; j < step; ++j) data[j] = 0.5 * (data[2*j] + data[2*j + 1]);
// Process
analyzer.input(&data[0], &data[step]);
analyzer.process();
|