1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 19:52:55 +08:00

Add beat timings to TestCaseBeatSyncedContainer

This commit is contained in:
Thomas Müller 2017-07-10 12:08:15 +03:00
parent d9b362489b
commit 7729760017

View File

@ -58,6 +58,8 @@ namespace osu.Desktop.VisualTests.Tests
private readonly InfoString currentBeat;
private readonly InfoString beatsPerMinute;
private readonly InfoString adjustedBeatLength;
private readonly InfoString timeUntilNextBeat;
private readonly InfoString timeSinceLastBeat;
private readonly Box flashLayer;
@ -95,6 +97,8 @@ namespace osu.Desktop.VisualTests.Tests
currentBeat = new InfoString(@"Current beat"),
beatsPerMinute = new InfoString(@"BPM"),
adjustedBeatLength = new InfoString(@"Adjusted beat length"),
timeUntilNextBeat = new InfoString(@"Time until next beat"),
timeSinceLastBeat = new InfoString(@"Time since last beat"),
}
}
}
@ -131,6 +135,8 @@ namespace osu.Desktop.VisualTests.Tests
currentBeat.Value = 0;
beatsPerMinute.Value = 0;
adjustedBeatLength.Value = 0;
timeUntilNextBeat.Value = 0;
timeSinceLastBeat.Value = 0;
};
}
@ -151,6 +157,13 @@ namespace osu.Desktop.VisualTests.Tests
return (int)Math.Ceiling((getNextTimingPoint(current).Time - current.Time) / current.BeatLength);
}
protected override void Update()
{
base.Update();
timeUntilNextBeat.Value = TimeUntilNextBeat;
timeSinceLastBeat.Value = TimeSinceLastBeat;
}
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
{
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);