2020-10-01 17:07:39 +08: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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2020-10-01 17:07:39 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|
|
|
{
|
2021-04-14 19:54:29 +08:00
|
|
|
public partial class TimingPointPiece : TopPointPiece
|
2020-10-01 17:07:39 +08:00
|
|
|
{
|
|
|
|
private readonly BindableNumber<double> beatLength;
|
|
|
|
|
|
|
|
public TimingPointPiece(TimingControlPoint point)
|
2021-04-14 19:54:29 +08:00
|
|
|
: base(point)
|
2020-10-01 17:07:39 +08:00
|
|
|
{
|
|
|
|
beatLength = point.BeatLengthBindable.GetBoundCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2022-01-15 08:06:39 +08:00
|
|
|
private void load()
|
2020-10-01 17:07:39 +08:00
|
|
|
{
|
|
|
|
beatLength.BindValueChanged(beatLength =>
|
|
|
|
{
|
2021-04-14 19:54:29 +08:00
|
|
|
Label.Text = $"{60000 / beatLength.NewValue:n1} BPM";
|
2020-10-01 17:07:39 +08:00
|
|
|
}, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|