diff options
author | Uwe Klotz <uwe_klotz@web.de> | 2017-06-20 23:53:19 +0200 |
---|---|---|
committer | Uwe Klotz <uwe_klotz@web.de> | 2017-06-20 23:54:30 +0200 |
commit | 337533855f09237b8a1e3551b32baa4a87a317b4 (patch) | |
tree | d84c6c237c4f6e4ede992c0ad4044de364e40eee /src/analyzer/analyzerwaveform.cpp | |
parent | c0b7a50815706df9a1d382a4464d902044816bae (diff) |
Fix saving of waveform analysis in database
The initialization of the AnalysisDao with the thread-local database
connection was missing. The restricted design of the analyzer API
required to move the AnalysisDao from AnalyzeWaveform to AnalyzerQueue.
Diffstat (limited to 'src/analyzer/analyzerwaveform.cpp')
-rw-r--r-- | src/analyzer/analyzerwaveform.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/analyzer/analyzerwaveform.cpp b/src/analyzer/analyzerwaveform.cpp index 19fb2a8663..eb90ba1627 100644 --- a/src/analyzer/analyzerwaveform.cpp +++ b/src/analyzer/analyzerwaveform.cpp @@ -16,14 +16,15 @@ mixxx::Logger kLogger("AnalyzerWaveform"); } // anonymous AnalyzerWaveform::AnalyzerWaveform( - const UserSettingsPointer& pConfig) : - m_analysisDao(pConfig), + AnalysisDao* pAnalysisDao) : + m_pAnalysisDao(pAnalysisDao), m_skipProcessing(false), m_waveformData(nullptr), m_waveformSummaryData(nullptr), m_stride(0, 0), m_currentStride(0), m_currentSummaryStride(0) { + DEBUG_ASSERT(m_pAnalysisDao); // mandatory m_filter[0] = 0; m_filter[1] = 0; m_filter[2] = 0; @@ -102,7 +103,7 @@ bool AnalyzerWaveform::isDisabledOrLoadStoredSuccess(TrackPointer tio) const { if (trackId.isValid() && (missingWaveform || missingWavesummary)) { QList<AnalysisDao::AnalysisInfo> analyses = - m_analysisDao.getAnalysesForTrack(trackId); + m_pAnalysisDao->getAnalysesForTrack(trackId); QListIterator<AnalysisDao::AnalysisInfo> it(analyses); while (it.hasNext()) { @@ -117,7 +118,7 @@ bool AnalyzerWaveform::isDisabledOrLoadStoredSuccess(TrackPointer tio) const { missingWaveform = false; } else if (vc != WaveformFactory::VC_KEEP) { // remove all other Analysis except that one we should keep - m_analysisDao.deleteAnalysis(analysis.analysisId); + m_pAnalysisDao->deleteAnalysis(analysis.analysisId); } } if (analysis.type == AnalysisDao::TYPE_WAVESUMMARY) { vc = WaveformFactory::waveformSummaryVersionToVersionClass(analysis.version); @@ -127,7 +128,7 @@ bool AnalyzerWaveform::isDisabledOrLoadStoredSuccess(TrackPointer tio) const { missingWavesummary = false; } else if (vc != WaveformFactory::VC_KEEP) { // remove all other Analysis except that one we should keep - m_analysisDao.deleteAnalysis(analysis.analysisId); + m_pAnalysisDao->deleteAnalysis(analysis.analysisId); } } } @@ -309,7 +310,7 @@ void AnalyzerWaveform::finalize(TrackPointer tio) { // waveforms (i.e. if the config setting was disabled in a previous scan) // and then it is not called. The other analyzers have signals which control // the update of their data. - m_analysisDao.saveTrackAnalyses(*tio); + m_pAnalysisDao->saveTrackAnalyses(*tio); kLogger.debug() << "Waveform generation for track" << tio->getId() << "done" << m_timer.elapsed().debugSecondsWithUnit(); |