1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 21:42:57 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseWaveform.cs

75 lines
2.4 KiB
C#
Raw Normal View History

// 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.
2018-04-13 17:19:50 +08:00
using NUnit.Framework;
2018-11-20 15:51:59 +08:00
using osuTK;
using osuTK.Graphics;
2018-04-13 17:19:50 +08:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
2018-04-13 17:19:50 +08:00
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseWaveform : OsuTestCase
{
[BackgroundDependencyLoader]
private void load()
2018-04-13 17:19:50 +08:00
{
Beatmap.Value = new WaveformTestBeatmap();
2018-04-13 17:19:50 +08:00
FillFlowContainer flow;
Child = flow = new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 10),
};
for (int i = 1; i <= 16; i *= 2)
{
var newDisplay = new WaveformGraph
2018-04-13 17:19:50 +08:00
{
RelativeSizeAxes = Axes.Both,
Resolution = 1f / i,
Waveform = Beatmap.Value.Waveform,
2018-04-13 17:19:50 +08:00
};
flow.Add(new Container
{
RelativeSizeAxes = Axes.X,
Height = 100,
Children = new Drawable[]
{
newDisplay,
new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.75f
},
new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = $"Resolution: {1f / i:0.00}"
}
}
}
}
});
}
}
}
}