2019-01-24 08:43:03 +00: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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Audio;
|
|
|
|
|
using osu.Framework.Graphics;
|
2021-07-15 03:50:34 +00:00
|
|
|
|
using osu.Framework.Localisation;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Configuration;
|
2021-08-11 09:10:08 +00:00
|
|
|
|
using osu.Game.Localisation;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Settings.Sections.Audio
|
|
|
|
|
{
|
|
|
|
|
public class VolumeSettings : SettingsSubsection
|
|
|
|
|
{
|
2021-08-11 09:10:08 +00:00
|
|
|
|
protected override LocalisableString Header => AudioSettingsStrings.VolumeHeader;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(AudioManager audio, OsuConfigManager config)
|
|
|
|
|
{
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2020-01-28 10:04:00 +00:00
|
|
|
|
new SettingsSlider<double>
|
|
|
|
|
{
|
2021-08-11 09:10:08 +00:00
|
|
|
|
LabelText = AudioSettingsStrings.MasterVolume,
|
2020-10-06 08:18:41 +00:00
|
|
|
|
Current = audio.Volume,
|
2020-01-28 10:04:00 +00:00
|
|
|
|
KeyboardStep = 0.01f,
|
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
|
|
|
|
new SettingsSlider<double>
|
|
|
|
|
{
|
2021-08-11 09:10:08 +00:00
|
|
|
|
LabelText = AudioSettingsStrings.MasterVolumeInactive,
|
2020-10-06 08:18:41 +00:00
|
|
|
|
Current = config.GetBindable<double>(OsuSetting.VolumeInactive),
|
2020-01-28 10:04:00 +00:00
|
|
|
|
KeyboardStep = 0.01f,
|
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
|
|
|
|
new SettingsSlider<double>
|
|
|
|
|
{
|
2021-08-11 09:10:08 +00:00
|
|
|
|
LabelText = AudioSettingsStrings.EffectVolume,
|
2020-10-06 08:18:41 +00:00
|
|
|
|
Current = audio.VolumeSample,
|
2020-01-28 10:04:00 +00:00
|
|
|
|
KeyboardStep = 0.01f,
|
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
|
|
|
|
new SettingsSlider<double>
|
|
|
|
|
{
|
2021-08-11 09:10:08 +00:00
|
|
|
|
LabelText = AudioSettingsStrings.MusicVolume,
|
2020-10-06 08:18:41 +00:00
|
|
|
|
Current = audio.VolumeTrack,
|
2020-01-28 10:04:00 +00:00
|
|
|
|
KeyboardStep = 0.01f,
|
|
|
|
|
DisplayAsPercentage = true
|
|
|
|
|
},
|
2018-04-13 09:19:50 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|