Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnalyzerThread: Pass AnalyzerTrack correctly again #11873

Merged
merged 2 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/analyzer/analyzerthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void AnalyzerThread::doRun() {
for (auto&& analyzer : m_analyzers) {
// Make sure not to short-circuit initialize(...)
if (analyzer.initialize(
m_currentTrack->getTrack(),
*m_currentTrack,
audioSource->getSignalInfo().getSampleRate(),
audioSource->frameLength())) {
processTrack = true;
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/analyzertrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AnalyzerTrack {
std::optional<bool> useFixedTempo;
};

AnalyzerTrack(TrackPointer track, Options options = Options());
explicit AnalyzerTrack(TrackPointer track, Options options = Options());

/// Fetches the (not-null) track to be analyzed.
const TrackPointer& getTrack() const;
Expand Down
3 changes: 2 additions & 1 deletion src/test/analyserwaveformtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <QtDebug>
#include <vector>

#include "analyzer/analyzertrack.h"
#include "analyzer/analyzerwaveform.h"
#include "library/dao/analysisdao.h"
#include "test/mixxxtest.h"
Expand Down Expand Up @@ -100,7 +101,7 @@ class AnalyzerWaveformTest : public MixxxTest {

// Basic test to make sure we don't alter the input buffer and don't step out of bounds.
TEST_F(AnalyzerWaveformTest, canary) {
m_aw.initialize(m_pTrack,
m_aw.initialize(AnalyzerTrack(m_pTrack),
m_pTrack->getSampleRate(),
kBigBufSize / kChannelCount);
m_aw.processSamples(&m_canaryBigBuf[kCanarySize], kBigBufSize);
Expand Down
3 changes: 2 additions & 1 deletion src/test/analyzersilence_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <vector>

#include "analyzer/analyzertrack.h"
#include "engine/engine.h"
#include "test/mixxxtest.h"
#include "track/track.h"
Expand Down Expand Up @@ -37,7 +38,7 @@ class AnalyzerSilenceTest : public MixxxTest {
}

void analyzeTrack() {
analyzerSilence.initialize(pTrack,
analyzerSilence.initialize(AnalyzerTrack(pTrack),
pTrack->getSampleRate(),
kTrackLengthFrames);
analyzerSilence.processSamples(pTrackSampleData.data(), nTrackSampleDataLength);
Expand Down