mirror of
https://github.com/ppy/osu.git
synced 2024-12-26 04:32:55 +08:00
31 lines
898 B
C#
31 lines
898 B
C#
// 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.
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Bindables;
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
using osu.Game.Graphics;
|
|
|
|
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|
{
|
|
public class TimingPointPiece : TopPointPiece
|
|
{
|
|
private readonly BindableNumber<double> beatLength;
|
|
|
|
public TimingPointPiece(TimingControlPoint point)
|
|
: base(point)
|
|
{
|
|
beatLength = point.BeatLengthBindable.GetBoundCopy();
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OsuColour colours)
|
|
{
|
|
beatLength.BindValueChanged(beatLength =>
|
|
{
|
|
Label.Text = $"{60000 / beatLength.NewValue:n1} BPM";
|
|
}, true);
|
|
}
|
|
}
|
|
}
|