mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 12:13:20 +08:00
Apply current track rate to calculated BPM
This commit is contained in:
parent
943e904c71
commit
d99d37c0a6
@ -18,6 +18,7 @@ using osu.Framework.Graphics.UserInterface;
|
|||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -41,6 +42,9 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private Bindable<ControlPointGroup>? selectedGroup { get; set; }
|
private Bindable<ControlPointGroup>? selectedGroup { get; set; }
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private IBeatSyncProvider? beatSyncSource { get; set; }
|
||||||
|
|
||||||
private Circle hoverLayer = null!;
|
private Circle hoverLayer = null!;
|
||||||
|
|
||||||
private CircularContainer innerCircle = null!;
|
private CircularContainer innerCircle = null!;
|
||||||
@ -299,7 +303,10 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double bpm = Math.Round(60000 / ((tapTimings.Last() - tapTimings.Skip(initial_taps_to_ignore).First()) / (tapTimings.Count - initial_taps_to_ignore - 1)));
|
double averageBeatLength = (tapTimings.Last() - tapTimings.Skip(initial_taps_to_ignore).First()) / (tapTimings.Count - initial_taps_to_ignore - 1);
|
||||||
|
double clockRate = beatSyncSource?.Clock?.Rate ?? 1;
|
||||||
|
|
||||||
|
double bpm = Math.Round(60000 / averageBeatLength / clockRate);
|
||||||
|
|
||||||
bpmText.Text = $"{bpm} BPM";
|
bpmText.Text = $"{bpm} BPM";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user