basic volume meter and testcase

This commit is contained in:
jorolf
2018-02-28 16:14:52 +01:00
parent 3db75cd2fc
commit 46dfb761c5
5 changed files with 283 additions and 0 deletions

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Overlays.Volume;
namespace osu.Game.Tests.Visual
{
public class TestCaseVolumeControl : TestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(VolumeMeter), typeof(MuteButton) };
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)
{
VolumeMeter meter;
Add(meter = new VolumeMeter("MASTER", 125, colours.PinkDarker));
Add(new MuteButton
{
Margin = new MarginPadding { Top = 200 }
});
meter.Bindable.BindTo(audio.Volume);
}
}
}

View File

@ -162,6 +162,7 @@
<Compile Include="Visual\TestCaseUserPanel.cs" />
<Compile Include="Visual\TestCaseUserProfile.cs" />
<Compile Include="Visual\TestCaseUserRanks.cs" />
<Compile Include="Visual\TestCaseVolumeControl.cs" />
<Compile Include="Visual\TestCaseWaveform.cs" />
</ItemGroup>
<ItemGroup>