1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 08:07:23 +08:00
osu-lazer/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs

55 lines
1.7 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.
2018-04-13 17:19:50 +08:00
using osu.Framework.Bindables;
2018-04-13 17:19:50 +08:00
using osu.Game.Beatmaps.Timing;
namespace osu.Game.Beatmaps.ControlPoints
{
public class TimingControlPoint : ControlPoint
2018-04-13 17:19:50 +08:00
{
/// <summary>
/// The time signature at this control point.
/// </summary>
2019-10-28 15:21:14 +08:00
public readonly Bindable<TimeSignatures> TimeSignatureBindable = new Bindable<TimeSignatures>(TimeSignatures.SimpleQuadruple) { Default = TimeSignatures.SimpleQuadruple };
/// <summary>
/// The time signature at this control point.
/// </summary>
public TimeSignatures TimeSignature
{
get => TimeSignatureBindable.Value;
set => TimeSignatureBindable.Value = value;
}
2018-04-13 17:19:50 +08:00
public const double DEFAULT_BEAT_LENGTH = 1000;
2018-04-13 17:19:50 +08:00
/// <summary>
/// The beat length at this control point.
/// </summary>
public readonly BindableDouble BeatLengthBindable = new BindableDouble(DEFAULT_BEAT_LENGTH)
2018-04-13 17:19:50 +08:00
{
2019-10-28 15:21:14 +08:00
Default = DEFAULT_BEAT_LENGTH,
MinValue = 6,
MaxValue = 60000
};
2018-04-13 17:19:50 +08:00
2019-10-30 17:44:07 +08:00
/// <summary>
/// The beat length at this control point.
/// </summary>
public double BeatLength
{
get => BeatLengthBindable.Value;
set => BeatLengthBindable.Value = value;
2018-04-13 17:19:50 +08:00
}
2019-10-28 11:31:38 +08:00
/// <summary>
/// The BPM at this control point.
/// </summary>
public double BPM => 60000 / BeatLength;
2020-04-17 16:04:09 +08:00
// Timing points are never redundant as they can change the time signature.
2020-04-17 16:06:12 +08:00
public override bool IsRedundant(ControlPoint existing) => false;
2018-04-13 17:19:50 +08:00
}
}