Skip to content

Commit

Permalink
Beats: Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Nov 11, 2021
1 parent af78c34 commit 741c8e3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/track/beats.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace mixxx {
class Beats;
typedef std::shared_ptr<const Beats> BeatsPointer;

/// A beat marker is denotes the border of a tempo section inside a track.
class BeatMarker {
public:
BeatMarker(mixxx::audio::FramePos position, int beatsTillNextMarker)
Expand Down Expand Up @@ -52,9 +53,15 @@ inline bool operator==(const BeatMarker& lhs, const BeatMarker& rhs) {
inline bool operator!=(const BeatMarker& lhs, const BeatMarker& rhs) {
return !(lhs == rhs);
}
/// Beats is the base class for BPM and beat management classes. It provides a
/// specification of all methods a beat-manager class must provide, as well as
/// a capability model for representing optional features.

/// This class represents the beats of a track.
///
/// Internally, it uses the following data structure:
/// - 0 - N beat markers, followed by
/// - exactly one tempo marker ("last marker").
///
/// If the track has a constant tempo, there are 0 beat markers, and the last
/// marker is positioned at the first downbeat and is set to the tracks BPM.
///
/// All instances of this class are supposed to be managed by std::shared_ptr!
class Beats : private std::enable_shared_from_this<Beats> {
Expand Down

0 comments on commit 741c8e3

Please sign in to comment.