mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 18:42:56 +08:00
TestCase reset.
This commit is contained in:
parent
b671a33911
commit
0da78c19a2
@ -22,6 +22,8 @@ namespace osu.Desktop.Tests
|
|||||||
IFrameBasedClock ourClock;
|
IFrameBasedClock ourClock;
|
||||||
protected override IFrameBasedClock Clock => ourClock;
|
protected override IFrameBasedClock Clock => ourClock;
|
||||||
|
|
||||||
|
protected MusicController mc;
|
||||||
|
|
||||||
public override void Load(BaseGame game)
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load(game);
|
base.Load(game);
|
||||||
@ -32,7 +34,8 @@ namespace osu.Desktop.Tests
|
|||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
ourClock.ProcessFrame();
|
ourClock.ProcessFrame();
|
||||||
MusicController mc = new MusicController
|
mc?.CurrentTrack?.Stop();
|
||||||
|
mc = new MusicController
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre
|
Anchor = Anchor.Centre
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Overlays
|
|||||||
private OsuGameBase osuGame;
|
private OsuGameBase osuGame;
|
||||||
private List<BeatmapSetInfo> playList;
|
private List<BeatmapSetInfo> playList;
|
||||||
private BeatmapSetInfo currentPlay;
|
private BeatmapSetInfo currentPlay;
|
||||||
private AudioTrack currentTrack;
|
public AudioTrack CurrentTrack { get; set; }//TODO:gets exterally
|
||||||
public override void Load(BaseGame game)
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load(game);
|
base.Load(game);
|
||||||
@ -83,15 +83,15 @@ namespace osu.Game.Overlays
|
|||||||
Position = new Vector2(0, 30),
|
Position = new Vector2(0, 30),
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
if (currentTrack == null) return;
|
if (CurrentTrack == null) return;
|
||||||
if (currentTrack.IsRunning)
|
if (CurrentTrack.IsRunning)
|
||||||
{
|
{
|
||||||
currentTrack.Stop();
|
CurrentTrack.Stop();
|
||||||
playButton.Icon = FontAwesome.play_circle_o;
|
playButton.Icon = FontAwesome.play_circle_o;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentTrack.Start();
|
CurrentTrack.Start();
|
||||||
playButton.Icon = FontAwesome.pause;
|
playButton.Icon = FontAwesome.pause;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -179,9 +179,9 @@ namespace osu.Game.Overlays
|
|||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
if (currentTrack == null) return;
|
if (CurrentTrack == null) return;
|
||||||
progress.Width = (float)(currentTrack.CurrentTime / currentTrack.Length);
|
progress.Width = (float)(CurrentTrack.CurrentTime / CurrentTrack.Length);
|
||||||
if (currentTrack.HasCompleted) next();
|
if (CurrentTrack.HasCompleted) next();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prev()
|
private void prev()
|
||||||
@ -208,9 +208,9 @@ namespace osu.Game.Overlays
|
|||||||
title.Text = metadata.TitleUnicode ?? metadata.Title;
|
title.Text = metadata.TitleUnicode ?? metadata.Title;
|
||||||
artist.Text = metadata.ArtistUnicode ?? metadata.Artist;
|
artist.Text = metadata.ArtistUnicode ?? metadata.Artist;
|
||||||
ArchiveReader reader = osuGame.Beatmaps.GetReader(currentPlay);
|
ArchiveReader reader = osuGame.Beatmaps.GetReader(currentPlay);
|
||||||
currentTrack?.Stop();
|
CurrentTrack?.Stop();
|
||||||
currentTrack = new AudioTrackBass(reader.ReadFile(metadata.AudioFile));
|
CurrentTrack = new AudioTrackBass(reader.ReadFile(metadata.AudioFile));
|
||||||
currentTrack.Start();
|
CurrentTrack.Start();
|
||||||
Sprite newBackground = getScaledSprite(TextureLoader.FromStream(reader.ReadFile(metadata.BackgroundFile)));
|
Sprite newBackground = getScaledSprite(TextureLoader.FromStream(reader.ReadFile(metadata.BackgroundFile)));
|
||||||
Add(newBackground);
|
Add(newBackground);
|
||||||
if (isNext == true)
|
if (isNext == true)
|
||||||
|
Loading…
Reference in New Issue
Block a user