// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Edit { public interface IDistanceSnapProvider : IPositionSnapProvider { /// /// The spacing multiplier applied to beat snap distances. /// /// IBindable DistanceSpacingMultiplier { get; } /// /// Retrieves the distance between two points within a timing point that are one beat length apart. /// /// An object to be used as a reference point for this operation. /// The distance between two points residing in the timing point that are one beat length apart. float GetBeatSnapDistanceAt(HitObject referenceObject); /// /// Converts a duration to a distance. /// /// An object to be used as a reference point for this operation. /// The duration to convert. /// A value that represents as a distance in the timing point. float DurationToDistance(HitObject referenceObject, double duration); /// /// Converts a distance to a duration. /// /// An object to be used as a reference point for this operation. /// The distance to convert. /// A value that represents as a duration in the timing point. double DistanceToDuration(HitObject referenceObject, float distance); /// /// Converts a distance to a snapped duration. /// /// An object to be used as a reference point for this operation. /// The distance to convert. /// A value that represents as a duration snapped to the closest beat of the timing point. double GetSnappedDurationFromDistance(HitObject referenceObject, float distance); /// /// Converts an unsnapped distance to a snapped distance. /// The returned distance will always be floored (as to never exceed the provided . /// /// An object to be used as a reference point for this operation. /// The distance to convert. /// A value that represents snapped to the closest beat of the timing point. float GetSnappedDistanceFromDistance(HitObject referenceObject, float distance); } }