28 const auto barDuration = timeSignature.GetBarDuration();
29 const auto multiplier = 1 / barDuration;
40 const auto quarterDuration = timeSignature.GetQuarterDuration();
44 const auto fracDuration = quarterDuration * 4.0 / divisor;
45 const auto multiplier = 1.0 / fracDuration;
57 const auto quarterDuration = 60.0 / timeSignature.GetTempo();
58 const auto tripletDivisor = 3 * (divisor / 2);
59 const auto fracDuration = quarterDuration * 4.0 / tripletDivisor;
60 const auto multiplier = 1.0 / fracDuration;
70 "beats", {
XO(
"Beats"),
true },
82 "triplets", {
XO(
"Triplets"),
true },
std::unique_ptr< SnapRegistryItem > TimeInvariantSnapFunction(const Identifier &functionId, const TranslatableString &label, MultiplierFunctor functor)
constexpr auto SnapFunctionGroup
constexpr auto SnapFunctionItems
std::function< double(const AudacityProject &)> MultiplierFunctor
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static ProjectTimeSignature & Get(AudacityProject &project)
Generates classes whose instances register items at construction.
SnapRegistryItemRegistrator beats
MultiplierFunctor SnapToTriplets(int divisor)
MultiplierFunctor SnapToBeat(int divisor)
double SnapToBar(const AudacityProject &project)