-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Beats: Move identical method implementations from BeatGrid/BeatMap #4234
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,13 +45,10 @@ class BeatMap final : public Beats { | |
// Beat calculations | ||
//////////////////////////////////////////////////////////////////////////// | ||
|
||
audio::FramePos findNextBeat(audio::FramePos position) const override; | ||
audio::FramePos findPrevBeat(audio::FramePos position) const override; | ||
bool findPrevNextBeats(audio::FramePos position, | ||
audio::FramePos* prevBeatPosition, | ||
audio::FramePos* nextBeatPosition, | ||
bool snapToNearBeats) const override; | ||
audio::FramePos findClosestBeat(audio::FramePos position) const override; | ||
audio::FramePos findNthBeat(audio::FramePos position, int n) const override; | ||
std::unique_ptr<BeatIterator> findBeats(audio::FramePos startPosition, | ||
audio::FramePos endPosition) const override; | ||
|
@@ -82,7 +79,7 @@ class BeatMap final : public Beats { | |
BeatMap(const BeatMap& other); | ||
|
||
// For internal use only. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, adding such a comment to a private method is confusing. Unrelated, but let's clean this up now. |
||
bool isValid() const; | ||
bool isValid() const override; | ||
|
||
const QString m_subVersion; | ||
const audio::SampleRate m_sampleRate; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,12 +75,12 @@ class Beats { | |
/// Starting from frame position `position`, return the frame position of | ||
/// the next beat in the track, or an invalid position if none exists. If | ||
/// `position` refers to the location of a beat, `position` is returned. | ||
virtual audio::FramePos findNextBeat(audio::FramePos position) const = 0; | ||
audio::FramePos findNextBeat(audio::FramePos position) const; | ||
|
||
/// Starting from frame position `position`, return the frame position of | ||
/// the previous beat in the track, or an invalid position if none exists. | ||
/// If `position` refers to the location of beat, `position` is returned. | ||
virtual audio::FramePos findPrevBeat(audio::FramePos position) const = 0; | ||
audio::FramePos findPrevBeat(audio::FramePos position) const; | ||
|
||
/// Starting from frame position `position`, fill the frame position of the | ||
/// previous beat and next beat. Either can be invalid if none exists. If | ||
|
@@ -100,7 +100,7 @@ class Beats { | |
|
||
/// Starting from frame position `position`, return the frame position of | ||
/// the closest beat in the track, or an invalid position if none exists. | ||
virtual audio::FramePos findClosestBeat(audio::FramePos position) const = 0; | ||
audio::FramePos findClosestBeat(audio::FramePos position) const; | ||
|
||
/// Find the Nth beat from frame position `position`. Works with both | ||
/// positive and negative values of n. Calling findNthBeat with `n=0` is | ||
|
@@ -155,6 +155,10 @@ class Beats { | |
|
||
/// Adjust the beats so the global average BPM matches `bpm`. | ||
virtual BeatsPointer setBpm(mixxx::Bpm bpm) = 0; | ||
|
||
protected: | ||
/// For internal use only. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment can be removed. That is clear from the method being protected. |
||
virtual bool isValid() const = 0; | ||
}; | ||
|
||
} // namespace mixxx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why write this comment instead of just doing it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Be-ing I guess you got confused by the diff? This code and comments have been deleted because they became obsolete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that. I am just lamenting that this wasn't already done 10 years ago.