Skip to content

Commit

Permalink
Beats: Remove getMaxBpm() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Jul 6, 2021
1 parent 9145ff8 commit 95a9e1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
8 changes: 3 additions & 5 deletions src/track/beatgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ BeatsPointer BeatGrid::scale(enum BPMScale scale) const {
return BeatsPointer(new BeatGrid(*this));
}

// TODO: Check if we can remove getMaxBpm and replace it with Bpm::hasValue instead
if (bpm.getValue() > getMaxBpm()) {
if (!bpm.hasValue()) {
return BeatsPointer(new BeatGrid(*this));
}

Expand All @@ -345,9 +344,8 @@ BeatsPointer BeatGrid::scale(enum BPMScale scale) const {
}

BeatsPointer BeatGrid::setBpm(mixxx::Bpm bpm) {
// FIXME: Shouldn't we use mixxx::Bpm::hasValue() here?
if (bpm.getValue() > getMaxBpm()) {
bpm.setValue(getMaxBpm());
VERIFY_OR_DEBUG_ASSERT(bpm.hasValue()) {
return nullptr;
}
mixxx::track::io::BeatGrid grid = m_grid;
grid.mutable_bpm()->set_bpm(bpm.getValue());
Expand Down
8 changes: 0 additions & 8 deletions src/track/beats.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#include "util/memory.h"
#include "util/types.h"

namespace {
double kMaxBpm = 500;
}

namespace mixxx {

class Beats;
Expand Down Expand Up @@ -132,10 +128,6 @@ class Beats {
// BPM returns -1.
virtual mixxx::Bpm getBpmAroundPosition(double curSample, int n) const = 0;

virtual double getMaxBpm() const {
return kMaxBpm;
}

virtual audio::SampleRate getSampleRate() const = 0;

////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/track/bpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Bpm final {
public:
static constexpr double kValueUndefined = 0.0;
static constexpr double kValueMin = 0.0; // lower bound (exclusive)
static constexpr double kValueMax = 300.0; // higher bound (inclusive)
static constexpr double kValueMax = 500.0; // higher bound (inclusive)

constexpr Bpm()
: Bpm(kValueUndefined) {
Expand Down

0 comments on commit 95a9e1d

Please sign in to comment.