Skip to content

Commit

Permalink
AnalyzerBeats: fix analyzer not using max/min BPM values
Browse files Browse the repository at this point in the history
I think this was a regression when removing VAMP plugins in
PR mixxxdj#926. The AllowBpmAboveRange setting is not exposed in the
preferences window and I never recall it being shown to the user,
nor anyone asking for it, so remove it.
  • Loading branch information
Be-ing committed Apr 21, 2020
1 parent 2e5c4ea commit 0c9ff53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
20 changes: 4 additions & 16 deletions src/analyzer/analyzerbeats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ bool AnalyzerBeats::initialize(TrackPointer tio, int sampleRate, int totalSample
return false;
}

if (m_bpmSettings.getAllowBpmAboveRange()) {
m_iMinBpm = 0;
m_iMaxBpm = 9999;
} else {
m_iMinBpm = m_bpmSettings.getBpmRangeStart();
m_iMaxBpm = m_bpmSettings.getBpmRangeEnd();
}
m_iMinBpm = m_bpmSettings.getBpmRangeStart();
m_iMaxBpm = m_bpmSettings.getBpmRangeEnd();

m_bPreferencesFixedTempo = m_bpmSettings.getFixedTempoAssumption();
m_bPreferencesOffsetCorrection = m_bpmSettings.getFixedTempoOffsetCorrection();
Expand Down Expand Up @@ -131,15 +126,8 @@ bool AnalyzerBeats::initialize(TrackPointer tio, int sampleRate, int totalSample
}

bool AnalyzerBeats::shouldAnalyze(TrackPointer tio) const {
int iMinBpm;
int iMaxBpm;
if (m_bpmSettings.getAllowBpmAboveRange()) {
iMinBpm = 0;
iMaxBpm = 9999;
} else {
iMinBpm = m_bpmSettings.getBpmRangeStart();
iMaxBpm = m_bpmSettings.getBpmRangeEnd();
}
int iMinBpm = m_bpmSettings.getBpmRangeStart();
int iMaxBpm = m_bpmSettings.getBpmRangeEnd();

bool bpmLock = tio->isBpmLocked();
if (bpmLock) {
Expand Down
4 changes: 0 additions & 4 deletions src/preferences/beatdetectionsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#define BPM_RANGE_START "BPMRangeStart"
#define BPM_RANGE_END "BPMRangeEnd"
#define BPM_ABOVE_RANGE_ENABLED "BPMAboveRangeEnabled"

class BeatDetectionSettings {
public:
Expand All @@ -30,9 +29,6 @@ class BeatDetectionSettings {
DEFINE_PREFERENCE_HELPERS(BpmDetectionEnabled, bool,
BPM_CONFIG_KEY, BPM_DETECTION_ENABLED, true);

DEFINE_PREFERENCE_HELPERS(AllowBpmAboveRange, bool,
BPM_CONFIG_KEY, BPM_ABOVE_RANGE_ENABLED, true);

DEFINE_PREFERENCE_HELPERS(BpmRangeStart, int, BPM_CONFIG_KEY, BPM_RANGE_START, 70);

DEFINE_PREFERENCE_HELPERS(BpmRangeEnd, int, BPM_CONFIG_KEY, BPM_RANGE_END, 140);
Expand Down

0 comments on commit 0c9ff53

Please sign in to comment.