2019-10-28 11:42:17 +08:00
|
|
|
// 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.
|
|
|
|
|
2019-10-27 14:19:36 +08:00
|
|
|
using osu.Framework.Allocation;
|
2019-10-28 15:21:31 +08:00
|
|
|
using osu.Framework.Graphics;
|
2019-10-27 14:19:36 +08:00
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
2019-10-28 15:21:31 +08:00
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
|
|
|
using osu.Game.Overlays.Settings;
|
2019-10-27 14:19:36 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Timing
|
|
|
|
{
|
|
|
|
internal class SampleSection : Section<SampleControlPoint>
|
|
|
|
{
|
2019-10-28 15:21:31 +08:00
|
|
|
private LabelledTextBox bank;
|
|
|
|
private SettingsSlider<int> volume;
|
2019-10-27 14:19:36 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2019-10-28 15:21:31 +08:00
|
|
|
Flow.AddRange(new Drawable[]
|
2019-10-27 14:19:36 +08:00
|
|
|
{
|
2019-10-28 15:21:31 +08:00
|
|
|
bank = new LabelledTextBox
|
|
|
|
{
|
|
|
|
Label = "Bank Name",
|
|
|
|
},
|
|
|
|
volume = new SettingsSlider<int>
|
|
|
|
{
|
|
|
|
Bindable = new SampleControlPoint().SampleVolumeBindable,
|
|
|
|
LabelText = "Volume",
|
|
|
|
}
|
2019-10-27 14:19:36 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override SampleControlPoint CreatePoint()
|
|
|
|
{
|
|
|
|
var reference = Beatmap.Value.Beatmap.ControlPointInfo.SamplePointAt(SelectedGroup.Value.Time);
|
|
|
|
|
|
|
|
return new SampleControlPoint
|
|
|
|
{
|
|
|
|
SampleBank = reference.SampleBank,
|
|
|
|
SampleVolume = reference.SampleVolume,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
{
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
ControlPoint.BindValueChanged(point =>
|
|
|
|
{
|
2019-10-28 15:21:31 +08:00
|
|
|
if (point.NewValue != null)
|
|
|
|
{
|
|
|
|
bank.Current = point.NewValue.SampleBankBindable;
|
|
|
|
volume.Bindable = point.NewValue.SampleVolumeBindable;
|
|
|
|
}
|
2019-10-27 14:19:36 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2019-10-28 11:31:38 +08:00
|
|
|
}
|