2018-03-04 02:49:38 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
2018-02-28 23:14:52 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Overlays.Volume;
|
2018-03-04 03:01:39 +08:00
|
|
|
|
using OpenTK.Graphics;
|
2018-02-28 23:14:52 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
|
{
|
2018-03-04 21:03:53 +08:00
|
|
|
|
public class TestCaseVolumePieces : OsuTestCase
|
2018-02-28 23:14:52 +08:00
|
|
|
|
{
|
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(VolumeMeter), typeof(MuteButton) };
|
|
|
|
|
|
2018-03-04 03:20:07 +08:00
|
|
|
|
protected override void LoadComplete()
|
2018-02-28 23:14:52 +08:00
|
|
|
|
{
|
|
|
|
|
VolumeMeter meter;
|
2018-03-04 03:20:07 +08:00
|
|
|
|
MuteButton mute;
|
2018-03-04 21:03:53 +08:00
|
|
|
|
Add(meter = new VolumeMeter("MASTER", 125, Color4.Blue));
|
|
|
|
|
Add(mute = new MuteButton
|
2018-02-28 23:14:52 +08:00
|
|
|
|
{
|
|
|
|
|
Margin = new MarginPadding { Top = 200 }
|
2018-03-04 21:03:53 +08:00
|
|
|
|
});
|
2018-02-28 23:14:52 +08:00
|
|
|
|
|
2018-03-04 03:20:07 +08:00
|
|
|
|
AddSliderStep("master volume", 0, 10, 0, i => meter.Bindable.Value = i * 0.1);
|
|
|
|
|
AddToggleStep("mute", b => mute.Current.Value = b);
|
2018-02-28 23:14:52 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|