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

quantisation fix + cue fix + git-clang-format #38

Merged
merged 3 commits into from
Nov 10, 2019
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
6 changes: 3 additions & 3 deletions src/analyzer/analyzersilence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ void AnalyzerSilence::storeResults(TrackPointer pTrack) {
bool upgradingWithMainCueAtDefault = (mainCue == 0.0 && pIntroCue == nullptr);
if (mainCue == Cue::kNoPosition || upgradingWithMainCueAtDefault) {
pTrack->setCuePoint(CuePosition(firstSound));
// NOTE: the actual default for this ConfigValue is set in DlgPrefDeck.
} else if (m_pConfig->getValue(ConfigKey("[Controls]", "SetIntroStartAtMainCue"), false)
&& pIntroCue == nullptr) {
// NOTE: the actual default for this ConfigValue is set in DlgPrefDeck.
} else if (m_pConfig->getValue(ConfigKey("[Controls]", "SetIntroStartAtMainCue"), false) &&
pIntroCue == nullptr) {
introStart = mainCue;
}

Expand Down
1 change: 0 additions & 1 deletion src/analyzer/analyzersilence.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class AnalyzerSilence : public Analyzer {
explicit AnalyzerSilence(UserSettingsPointer pConfig);
~AnalyzerSilence() override = default;


bool initialize(TrackPointer pTrack, int sampleRate, int totalSamples) override;
bool processSamples(const CSAMPLE* pIn, const int iLen) override;
void storeResults(TrackPointer pTrack) override;
Expand Down
6 changes: 2 additions & 4 deletions src/engine/cachingreader/cachingreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ const SINT kNumberOfCachedChunksInMemory = 80;

} // anonymous namespace


CachingReader::CachingReader(QString group,
UserSettingsPointer config)
UserSettingsPointer config)
: m_pConfig(config),
// Limit the number of in-flight requests to the worker. This should
// prevent to overload the worker when it is not able to fetch those
Expand All @@ -63,7 +62,6 @@ CachingReader::CachingReader(QString group,
m_lruCachingReaderChunk(nullptr),
m_sampleBuffer(CachingReaderChunk::kSamples * kNumberOfCachedChunksInMemory),
m_worker(group, &m_chunkReadRequestFIFO, &m_readerStatusUpdateFIFO) {

m_allocatedCachingReaderChunks.reserve(kNumberOfCachedChunksInMemory);
// Divide up the allocated raw memory buffer into total_chunks
// chunks. Initialize each chunk to hold nothing and add it to the free
Expand Down Expand Up @@ -265,7 +263,7 @@ void CachingReader::process() {
// TRACK_LOADED without a chunk in between, assert this here.
DEBUG_ASSERT(m_state.load() == STATE_TRACK_LOADING ||
(m_state.load() == STATE_TRACK_LOADED &&
!m_mruCachingReaderChunk && !m_lruCachingReaderChunk));
!m_mruCachingReaderChunk && !m_lruCachingReaderChunk));
// now purge also the recently used chunk list from the old track.
if (m_mruCachingReaderChunk || m_lruCachingReaderChunk) {
DEBUG_ASSERT(m_state.load() == STATE_TRACK_LOADING);
Expand Down
6 changes: 3 additions & 3 deletions src/engine/cachingreader/cachingreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#define ENGINE_CACHINGREADER_H

#include <QAtomicInt>
#include <QList>
#include <QVector>
#include <QLinkedList>
#include <QHash>
#include <QLinkedList>
#include <QList>
#include <QVarLengthArray>
#include <QVector>

#include "util/types.h"
#include "preferences/usersettings.h"
Expand Down
21 changes: 9 additions & 12 deletions src/engine/cachingreader/cachingreaderworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ ReaderStatusUpdate CachingReaderWorker::processReadRequest(
chunkFrameIndexRange <= m_pAudioSource->frameIndexRange());
if (chunkFrameIndexRange.empty()) {
ReaderStatusUpdate result;
result.init(CHUNK_READ_INVALID, pChunk,
m_pAudioSource ? m_pAudioSource->frameIndexRange() : mixxx::IndexRange());
result.init(CHUNK_READ_INVALID, pChunk, m_pAudioSource ? m_pAudioSource->frameIndexRange() : mixxx::IndexRange());
return result;
}

Expand Down Expand Up @@ -71,8 +70,7 @@ ReaderStatusUpdate CachingReaderWorker::processReadRequest(
}

ReaderStatusUpdate result;
result.init(status, pChunk,
m_pAudioSource ? m_pAudioSource->frameIndexRange() : mixxx::IndexRange());
result.init(status, pChunk, m_pAudioSource ? m_pAudioSource->frameIndexRange() : mixxx::IndexRange());
return result;
}

Expand Down Expand Up @@ -139,14 +137,13 @@ void CachingReaderWorker::loadTrack(const TrackPointer& pTrack) {
QString filename = pTrack->getLocation();
if (filename.isEmpty() || !pTrack->checkFileExists()) {
kLogger.warning()
<< m_group
<< "File not found"
<< filename;
<< m_group
<< "File not found"
<< filename;
const auto update = ReaderStatusUpdate::trackUnloaded();
m_pReaderStatusFIFO->writeBlocking(&update, 1);
emit trackLoadFailed(
pTrack, QString("The file '%1' could not be found.")
.arg(QDir::toNativeSeparators(filename)));
pTrack, QString("The file '%1' could not be found.").arg(QDir::toNativeSeparators(filename)));
return;
}

Expand All @@ -161,7 +158,7 @@ void CachingReaderWorker::loadTrack(const TrackPointer& pTrack) {
const auto update = ReaderStatusUpdate::trackUnloaded();
m_pReaderStatusFIFO->writeBlocking(&update, 1);
emit trackLoadFailed(
pTrack, QString("The file '%1' could not be loaded").arg(filename));
pTrack, QString("The file '%1' could not be loaded").arg(filename));
return;
}

Expand All @@ -177,7 +174,7 @@ void CachingReaderWorker::loadTrack(const TrackPointer& pTrack) {
const auto update = ReaderStatusUpdate::trackUnloaded();
m_pReaderStatusFIFO->writeBlocking(&update, 1);
emit trackLoadFailed(
pTrack, QString("The file '%1' is empty and could not be loaded").arg(filename));
pTrack, QString("The file '%1' is empty and could not be loaded").arg(filename));
return;
}

Expand All @@ -190,7 +187,7 @@ void CachingReaderWorker::loadTrack(const TrackPointer& pTrack) {

const auto update =
ReaderStatusUpdate::trackLoaded(
m_pAudioSource->frameIndexRange());
m_pAudioSource->frameIndexRange());
m_pReaderStatusFIFO->writeBlocking(&update, 1);

// Emit that the track is loaded.
Expand Down
8 changes: 5 additions & 3 deletions src/engine/controls/bpmcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ constexpr SINT kSamplesPerFrame = 2;
}

BpmControl::BpmControl(QString group,
UserSettingsPointer pConfig)
UserSettingsPointer pConfig)
: EngineControl(group, pConfig),
m_tapFilter(this, kBpmTapFilterLength, kBpmTapMaxInterval),
m_dSyncInstantaneousBpm(0.0),
Expand Down Expand Up @@ -96,8 +96,10 @@ BpmControl::BpmControl(QString group,
// bpm_up_small / bpm_down_small steps by kBpmRangeSmallStep
m_pEngineBpm = new ControlLinPotmeter(
ConfigKey(group, "bpm"),
kBpmRangeMin, kBpmRangeMax,
kBpmRangeStep, kBpmRangeSmallStep,
kBpmRangeMin,
kBpmRangeMax,
kBpmRangeStep,
kBpmRangeSmallStep,
true);
connect(m_pEngineBpm, &ControlObject::valueChanged,
this, &BpmControl::slotUpdateRateSlider,
Expand Down
Loading