2020-01-23 05:39:56 +00:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Edit
|
|
|
|
{
|
|
|
|
public interface IBeatSnapProvider
|
|
|
|
{
|
|
|
|
/// <summary>
|
2022-12-02 08:47:29 +00:00
|
|
|
/// Snaps a duration to the closest beat of a timing point applicable at the reference time, factoring in the current <see cref="BeatDivisor"/>.
|
2020-01-23 05:39:56 +00:00
|
|
|
/// </summary>
|
2020-01-28 03:48:24 +00:00
|
|
|
/// <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);
|
2020-01-23 05:39:56 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2022-12-02 08:47:29 +00:00
|
|
|
/// Get the most appropriate beat length at a given time, pre-divided by <see cref="BeatDivisor"/>.
|
2020-01-23 05:39:56 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="referenceTime">A reference time used for lookup.</param>
|
2022-12-02 08:47:29 +00:00
|
|
|
/// <returns>The most appropriate beat length, divided by <see cref="BeatDivisor"/>.</returns>
|
2020-01-23 06:31:56 +00:00
|
|
|
double GetBeatLengthAtTime(double referenceTime);
|
2020-01-23 05:39:56 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns the current beat divisor.
|
|
|
|
/// </summary>
|
|
|
|
int BeatDivisor { get; }
|
|
|
|
}
|
|
|
|
}
|