|
From: Tapio V. <aa...@us...> - 2011-10-11 20:01:57
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Oct 4 23:44:44 2011 +0300
Progressbar measures the least progressed PitchVis.
---
notegraphwidget.cc | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index db7f303..7ca533e 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -158,14 +158,14 @@ void NoteGraphWidget::timerEvent(QTimerEvent* event)
m_playbackPos += m_playbackInterval.restart();
updateMusicPos(m_playbackPos);
- // FIXME: Only considers first pitchvis
} else if (event->timerId() == m_analyzeTimer && m_pitch[0]) {
// PitchVis stuff
- double progress, duration;
- {
- QMutexLocker locker(&m_pitch[0]->mutex);
- progress = m_pitch[0]->getProgress();
- duration = m_pitch[0]->getDuration();
+ double progress = 1.0, duration;
+ for (int i = 0; i < MaxPitchVis; ++i) {
+ if (!m_pitch[i]) continue;
+ QMutexLocker locker(&m_pitch[i]->mutex);
+ progress = std::min(progress, m_pitch[i]->getProgress());
+ if (i == 0) duration = m_pitch[i]->getDuration();
}
emit analyzeProgress(1000 * progress, 1000); // Update progress bar
m_duration = std::max(m_duration, duration);
|