1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 23:42:55 +08:00
osu-lazer/osu.Game/Rulesets/Edit/IBeatSnapProvider.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
1.2 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2022-06-17 15:37:17 +08:00
#nullable disable
namespace osu.Game.Rulesets.Edit
{
public interface IBeatSnapProvider
{
/// <summary>
/// Snaps a duration to the closest beat of a timing point applicable at the reference time.
/// </summary>
/// <param name="time">The time to snap.</param>
/// <param name="referenceTime">An optional reference point to use for timing point lookup.</param>
/// <returns>A value that represents <paramref name="time"/> snapped to the closest beat of the timing point.</returns>
double SnapTime(double time, double? referenceTime = null);
/// <summary>
/// Get the most appropriate beat length at a given time.
/// </summary>
/// <param name="referenceTime">A reference time used for lookup.</param>
/// <returns>The most appropriate beat length.</returns>
2020-01-23 14:31:56 +08:00
double GetBeatLengthAtTime(double referenceTime);
/// <summary>
/// Returns the current beat divisor.
/// </summary>
int BeatDivisor { get; }
}
}