You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
project-kyoku/include/core/bpmsection.h

44 lines
826 B
C++

#pragma once
#include "core/time.h"
namespace kku
{
/// BPMSection
///
/// Data to setup and distinguish
/// a section on beatmap timeline
struct BPMSection
{
/// Amount of beats
/// per minute in the section
unsigned int bpm = 120; // Hi, osu
/// Denominator in fraction of major
/// beats. Like, 1/2, 1/3. etc...
unsigned int fraction = 2;
/// Timestamp respresenting when
/// the section becomes active
microsec offset_start = 0;
/// Interval between beats
microsec interval = 0;
};
/// BPMSectionComparator
///
/// Predicate to define
/// BPMSection sorting rule:
/// by timestamp of start
struct BPMSectionComparator
{
bool operator()(const BPMSection& lhs, const BPMSection& rhs) const noexcept
{
return lhs.offset_start < rhs.offset_start;
}
};
}