=== modified file 'mixxx/src/analyserbeats.cpp' --- mixxx/src/analyserbeats.cpp 2012-05-11 15:31:02 +0000 +++ mixxx/src/analyserbeats.cpp 2012-07-04 20:25:06 +0000 @@ -17,8 +17,6 @@ #include "track/beatutils.h" #include "track/beat_preferences.h" -static bool sDebug = false; - AnalyserBeats::AnalyserBeats(ConfigObject *_config) : m_pConfig(_config), m_pVamp(NULL), === modified file 'mixxx/src/analyserqueue.cpp' --- mixxx/src/analyserqueue.cpp 2012-05-20 20:42:03 +0000 +++ mixxx/src/analyserqueue.cpp 2012-07-04 20:33:24 +0000 @@ -21,16 +21,16 @@ #include -AnalyserQueue::AnalyserQueue() : m_aq(), +AnalyserQueue::AnalyserQueue() : + m_aq(), + m_exit(false), + m_aiCheckPriorities(false), m_tioq(), m_qm(), - m_qwait(), - m_exit(false), - m_aiCheckPriorities(false) { + m_qwait() { } -int AnalyserQueue::numQueuedTracks() -{ +int AnalyserQueue::numQueuedTracks() { m_qm.lock(); int numQueuedTracks = m_tioq.count(); m_qm.unlock(); @@ -224,29 +224,24 @@ } if (processTrack) { - if (! PlayerInfo::Instance().isTrackLoaded(next) && isLoadedTrackWaiting()) { + if (!PlayerInfo::Instance().isTrackLoaded(next) && isLoadedTrackWaiting()) { qDebug() << "Delaying track analysis because track is not loaded -- requeuing"; QListIterator itf(m_aq); while (itf.hasNext()) { itf.next()->cleanup(next); } queueAnalyseTrack(next); - } - else - { + } else { bool completed = doAnalysis(next, pSoundSource); - if (!completed) - { + if (!completed) { //This track was cancelled QListIterator itf(m_aq); while (itf.hasNext()) { itf.next()->cleanup(next); } queueAnalyseTrack(next); - } - else - { + } else { QListIterator itf(m_aq); while (itf.hasNext()) { itf.next()->finalise(next); @@ -257,7 +252,6 @@ qDebug() << "Skipping track analysis because no analyser initialized."; } - delete pSoundSource; emit(trackFinished(next)); @@ -299,7 +293,6 @@ ret->addAnalyser(new TonalAnalyser()); #endif - ret->addAnalyser(new AnalyserWaveform()); ret->addAnalyser(new AnalyserGain(_config)); #ifdef __VAMP__ VampAnalyser::initializePluginPaths(); @@ -309,6 +302,10 @@ ret->addAnalyser(new AnalyserBPM(_config)); #endif + // AnalyserWaveform must be added at last because + // it is used as a progress bar for analysis + ret->addAnalyser(new AnalyserWaveform()); + ret->start(QThread::IdlePriority); return ret; } @@ -316,7 +313,6 @@ AnalyserQueue* AnalyserQueue::createPrepareViewAnalyserQueue(ConfigObject *_config) { AnalyserQueue* ret = new AnalyserQueue(); - ret->addAnalyser(new AnalyserWaveform()); ret->addAnalyser(new AnalyserGain(_config)); #ifdef __VAMP__ VampAnalyser::initializePluginPaths(); @@ -326,6 +322,10 @@ ret->addAnalyser(new AnalyserBPM(_config)); #endif + // AnalyserWaveform must be added at last because + // it is used as a progress bar for analysis + ret->addAnalyser(new AnalyserWaveform()); + ret->start(QThread::IdlePriority); return ret; } === modified file 'mixxx/src/analyserrg.cpp' --- mixxx/src/analyserrg.cpp 2012-05-14 20:47:43 +0000 +++ mixxx/src/analyserrg.cpp 2012-07-04 20:27:34 +0000 @@ -4,6 +4,7 @@ #include "sampleutil.h" #include "trackinfoobject.h" +#include "playerinfo.h" #include "analyserrg.h" #include "../lib/replaygain/replaygain.h" @@ -77,6 +78,12 @@ //qDebug() << "ReplayGain result is" << ReplayGainOutput << "pow:" << fReplayGain_Result; //qDebug()<<"ReplayGain outputs "<< ReplayGainOutput << "db for track "<< tio->getFilename(); tio->setReplayGain(fReplayGain_Result); + const PlayerInfo& info = PlayerInfo::Instance(); + if (info.isTrackLoaded(tio)) { + // Wait until new replay gain is + // set in enginepregain + sleep(1); + } //if(fReplayGain_Result) qDebug() << "ReplayGain Analyser found a ReplayGain value of "<< 20*log10(fReplayGain_Result) << "dB for track " << (tio->getFilename()); m_bStepControl=false; //m_iStartTime = clock() - m_iStartTime; === modified file 'mixxx/src/analyserwaveform.cpp' --- mixxx/src/analyserwaveform.cpp 2012-06-01 02:14:10 +0000 +++ mixxx/src/analyserwaveform.cpp 2012-07-04 20:36:03 +0000 @@ -25,9 +25,6 @@ m_filter[1] = 0; m_filter[2] = 0; - m_currentStride = 0; - m_currentSummaryStride = 0; - static int i = 0; m_database = QSqlDatabase::addDatabase("QSQLITE", "WAVEFORM_ANALYSIS" + QString::number(i++)); if (!m_database.isOpen()) { @@ -167,6 +164,8 @@ } void AnalyserWaveform::resetFilters(TrackPointer tio, int sampleRate) { + Q_UNUSED(tio); + Q_UNUSED(sampleRate); //TODO: (vRince) bind this with *actual* filter values ... // m_filter[Low] = new EngineFilterButterworth8(FILTER_LOWPASS, sampleRate, 200); // m_filter[Mid] = new EngineFilterButterworth8(FILTER_BANDPASS, sampleRate, 200, 2000); @@ -174,7 +173,6 @@ m_filter[Low] = new EngineFilterIIR(bessel_lowpass4, 4); m_filter[Mid] = new EngineFilterIIR(bessel_bandpass, 8); m_filter[High] = new EngineFilterIIR(bessel_highpass4, 4); - } void AnalyserWaveform::destroyFilters() { @@ -344,13 +342,16 @@ } m_waveform->setCompletion(m_currentStride); - m_waveformSummary->setCompletion(m_currentSummaryStride); + // move the summary completion 10% slower + // the last 10% are reported after finalise() + m_waveformSummary->setCompletion(m_currentSummaryStride * 9/10); //qDebug() << "AnalyserWaveform::process - m_waveform->getCompletion()" << m_waveform->getCompletion(); //qDebug() << "AnalyserWaveform::process - m_waveformSummary->getCompletion()" << m_waveformSummary->getCompletion(); } void AnalyserWaveform::cleanup(TrackPointer tio) { + Q_UNUSED(tio); if (m_skipProcessing) { return; }