=== modified file 'mixxx/src/analyserqueue.cpp' --- mixxx/src/analyserqueue.cpp 2012-12-13 23:22:57 +0000 +++ mixxx/src/analyserqueue.cpp 2013-01-16 22:12:25 +0000 @@ -22,7 +22,7 @@ #include -#define FINALISE_PERCENT 0 // in 0.1%, +#define FINALISE_PERCENT 100 // in 0.1%, // 0 for no progress during finalize // 100 for 10% step after finalise === modified file 'mixxx/src/widget/woverview.cpp' --- mixxx/src/widget/woverview.cpp 2013-01-16 21:03:36 +0000 +++ mixxx/src/widget/woverview.cpp 2013-01-16 22:07:04 +0000 @@ -43,7 +43,7 @@ m_iPos(0), m_a(1.0), m_b(0.0), - m_analyserProgress(-1), + m_analyserProgress(0), m_trackLoaded(false), m_diffGain(0) { @@ -161,9 +161,11 @@ if (!m_pCurrentTrack) { return; } - m_analyserProgress = progress; + const int analyserProgress = width() * progress / 1000; + bool updateNeeded = drawNextPixmapPart(); // progress 0 .. 1000 - if (drawNextPixmapPart()) { + if (updateNeeded || (m_analyserProgress != analyserProgress)) { + m_analyserProgress = analyserProgress; update(); } } @@ -182,6 +184,7 @@ m_pWaveformSourceImage = NULL; } + m_analyserProgress = 0; m_actualCompletion = 0; m_waveformPeak = -1.0; m_pixmapDone = false; @@ -189,7 +192,6 @@ if (pTrack) { m_pCurrentTrack = pTrack; - m_analyserProgress = pTrack->getAnalyserProgress(); m_pWaveform = pTrack->getWaveformSummary(); connect(pTrack.data(), SIGNAL(waveformSummaryUpdated()), @@ -197,9 +199,8 @@ connect(pTrack.data(), SIGNAL(analyserProgress(int)), this, SLOT(slotAnalyserProgress(int))); - drawNextPixmapPart(); + slotAnalyserProgress(pTrack->getAnalyserProgress()); } - update(); } void WOverview::slotTrackLoaded(TrackPointer pTrack) { @@ -265,17 +266,9 @@ m_pWaveformSourceImage->fill(QColor(0,0,0,0).value()); } - const int analyserCompletion = (int)((float)(dataSize/2) * m_analyserProgress / 1000) * 2; const int waveformCompletion = m_pWaveform->getCompletion(); // always multiple of 2 - // test if there is some new to draw (at least of pixel width) - int completionIncrement; - if (analyserCompletion < waveformCompletion) { - // over all analyzer progress is slower than the pure waveform analysis - completionIncrement = analyserCompletion - m_actualCompletion; - } else { - completionIncrement = waveformCompletion - m_actualCompletion; - } + const int completionIncrement = waveformCompletion - m_actualCompletion; int visiblePixelIncrement = completionIncrement * width() / dataSize; if (completionIncrement < 2 || visiblePixelIncrement == 0) { @@ -461,6 +454,12 @@ } painter.drawImage(rect(), m_waveformImageScaled); + + // Paint analyzer Progress + if (m_analyserProgress < width()) { + painter.setPen(QPen(m_signalColors.getAxesColor(), 3)); + painter.drawLine(m_analyserProgress, height()/2, width(), height()/2); + } } }