diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index 08c25c4f9d..4ff02606e1 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { protected override LocalisableString Header => AudioSettingsStrings.VolumeHeader; - private readonly VolumeScaler volumeInactive = new VolumeScaler(); + private readonly BindableVolume volumeInactive = new BindableVolume(); [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config) @@ -29,34 +29,34 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { LabelText = AudioSettingsStrings.MasterVolume, Current = audio.Volume.Scaled, - KeyboardStep = (float)VolumeScaler.STEP, + KeyboardStep = (float)BindableVolume.STEP, }, new VolumeAdjustSlider { LabelText = AudioSettingsStrings.MasterVolumeInactive, Current = volumeInactive.Scaled, - KeyboardStep = (float)VolumeScaler.STEP, + KeyboardStep = (float)BindableVolume.STEP, PlaySamplesOnAdjust = true, }, new VolumeAdjustSlider { LabelText = AudioSettingsStrings.EffectVolume, Current = audio.VolumeSample.Scaled, - KeyboardStep = (float)VolumeScaler.STEP, + KeyboardStep = (float)BindableVolume.STEP, }, new VolumeAdjustSlider { LabelText = AudioSettingsStrings.MusicVolume, Current = audio.VolumeTrack.Scaled, - KeyboardStep = (float)VolumeScaler.STEP, + KeyboardStep = (float)BindableVolume.STEP, }, }; } private partial class DecibelSliderBar : RoundedSliderBar { - public override LocalisableString TooltipText => (Current.Value <= VolumeScaler.MIN ? "-∞" : Current.Value.ToString("+#0.0;-#0.0;+0.0")) + " dB"; + public override LocalisableString TooltipText => (Current.Value <= BindableVolume.MIN ? "-∞" : Current.Value.ToString("+#0.0;-#0.0;+0.0")) + " dB"; } private partial class VolumeAdjustSlider : SettingsSlider diff --git a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs index a072d20637..c28031194a 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs @@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Toolbar base.LoadComplete(); globalVolume = audio.Volume.Scaled.GetBoundCopy(); - globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)(1 - (v.NewValue / VolumeScaler.MIN)), 200, Easing.OutQuint), true); + globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)(1 - (v.NewValue / BindableVolume.MIN)), 200, Easing.OutQuint), true); } protected override bool OnKeyDown(KeyDownEvent e) diff --git a/osu.Game/Overlays/Volume/VolumeMeter.cs b/osu.Game/Overlays/Volume/VolumeMeter.cs index 30297d8da2..d0cfdff452 100644 --- a/osu.Game/Overlays/Volume/VolumeMeter.cs +++ b/osu.Game/Overlays/Volume/VolumeMeter.cs @@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Volume protected static readonly Vector2 LABEL_SIZE = new Vector2(120, 20); - public BindableDouble Bindable { get; } = new BindableDouble { MinValue = VolumeScaler.MIN, MaxValue = 0, Precision = adjust_step }; + public BindableDouble Bindable { get; } = new BindableDouble { MinValue = BindableVolume.MIN, MaxValue = 0, Precision = adjust_step }; protected readonly float CircleSize; @@ -252,7 +252,7 @@ namespace osu.Game.Overlays.Volume get => displayVolume; set { - percentage = 1 - (value / VolumeScaler.MIN); + percentage = 1 - (value / BindableVolume.MIN); int step = (int)Math.Round(value / adjust_step); bool stepChanged = step != currentStep; @@ -304,9 +304,9 @@ namespace osu.Game.Overlays.Volume private set => Bindable.Value = value; } - private const double adjust_step = VolumeScaler.STEP; + private const double adjust_step = BindableVolume.STEP; - private const int step_min = (int)(VolumeScaler.MIN / VolumeScaler.STEP); + private const int step_min = (int)(BindableVolume.MIN / BindableVolume.STEP); private const int step_max = 0; public void Increase(double amount = 1, bool isPrecise = false) => adjust(amount, isPrecise);