1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

More cleanups

This commit is contained in:
smoogipoo 2020-08-12 00:48:38 +09:00
parent 031d29ac34
commit 070d71ec27
9 changed files with 12 additions and 15 deletions

View File

@ -175,11 +175,11 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
private void createDrawableRuleset()
{
AddUntilStep("wait for beatmap to be loaded", () => MusicController.TrackLoaded);
AddUntilStep("wait for beatmap to be loaded", () => MusicController.CurrentTrack.TrackLoaded);
AddStep("create drawable ruleset", () =>
{
MusicController.Play(true);
MusicController.CurrentTrack.Start();
SetContents(() =>
{

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 });
MusicController.Play(true);
MusicController.CurrentTrack.Start();
});
AddStep("Load playfield", () => SetContents(() => new TaikoPlayfield(new ControlPointInfo())

View File

@ -29,6 +29,6 @@ namespace osu.Game.Tests.Skins
public void TestRetrieveOggSample() => AddAssert("sample is non-null", () => Beatmap.Value.Skin.GetSample(new SampleInfo("sample")) != null);
[Test]
public void TestRetrieveOggTrack() => AddAssert("track is non-null", () => MusicController.CurrentTrack.IsDummyDevice == false);
public void TestRetrieveOggTrack() => AddAssert("track is non-null", () => !MusicController.CurrentTrack.IsDummyDevice);
}
}

View File

@ -19,8 +19,8 @@ namespace osu.Game.Tests.Visual.Gameplay
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
MusicController.Play(true);
MusicController.SeekTo(Beatmap.Value.Beatmap.HitObjects.First().StartTime - 1000);
MusicController.CurrentTrack.Start();
MusicController.CurrentTrack.Seek(Beatmap.Value.Beatmap.HitObjects.First().StartTime - 1000);
Add(new ModNightcore<HitObject>.NightcoreBeatContainer());

View File

@ -236,7 +236,7 @@ namespace osu.Game.Overlays
var track = musicController.CurrentTrack;
if (track.IsDummyDevice == false)
if (!track.IsDummyDevice)
{
progressBar.EndTime = track.Length;
progressBar.CurrentTime = track.CurrentTime;

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
@ -64,8 +63,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
waveform.Waveform = b.NewValue.Waveform;
track = musicController.CurrentTrack;
Debug.Assert(track != null);
if (track.Length > 0)
{
MaxZoom = getZoomLevelForVisibleMilliseconds(500);

View File

@ -82,7 +82,7 @@ namespace osu.Game.Screens.Edit
beatDivisor.BindValueChanged(divisor => Beatmap.Value.BeatmapInfo.BeatDivisor = divisor.NewValue);
// Todo: should probably be done at a DrawableRuleset level to share logic with Player.
clock = new EditorClock(Beatmap.Value, musicController.CurrentTrack.Length, beatDivisor) { IsCoupled = false };
clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false };
clock.ChangeSource(musicController.CurrentTrack);
dependencies.CacheAs(clock);
@ -348,7 +348,7 @@ namespace osu.Game.Screens.Edit
private void resetTrack(bool seekToStart = false)
{
musicController.Stop();
musicController.CurrentTrack.Stop();
if (seekToStart)
{

View File

@ -25,8 +25,8 @@ namespace osu.Game.Screens.Edit
private readonly DecoupleableInterpolatingFramedClock underlyingClock;
public EditorClock(WorkingBeatmap beatmap, double trackLength, BindableBeatDivisor beatDivisor)
: this(beatmap.Beatmap.ControlPointInfo, trackLength, beatDivisor)
public EditorClock(WorkingBeatmap beatmap, BindableBeatDivisor beatDivisor)
: this(beatmap.Beatmap.ControlPointInfo, beatmap.GetTrack().Length, beatDivisor)
{
}

View File

@ -115,7 +115,7 @@ namespace osu.Game.Screens.Menu
if (setInfo != null)
{
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
UsingThemedIntro = initialBeatmap.GetTrack().IsDummyDevice == false;
UsingThemedIntro = !initialBeatmap.GetTrack().IsDummyDevice;
}
return UsingThemedIntro;