1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 05:42:56 +08:00

Rename Real/Scaled to Linear/Decibel

This commit is contained in:
Mike Will 2025-01-14 02:09:29 -05:00
parent 72ef33554a
commit 0d78b2b181
5 changed files with 13 additions and 13 deletions

View File

@ -81,7 +81,7 @@ namespace osu.Game.Overlays
{ {
AddInternal(audioDuckFilter = new AudioFilter(audio.TrackMixer)); AddInternal(audioDuckFilter = new AudioFilter(audio.TrackMixer));
audio.Tracks.AddAdjustment(AdjustableProperty.Volume, audioDuckVolume); audio.Tracks.AddAdjustment(AdjustableProperty.Volume, audioDuckVolume);
sampleVolume = audio.VolumeSample.Scaled.GetBoundCopy(); sampleVolume = audio.VolumeSample.Decibel.GetBoundCopy();
configManager.BindWith(OsuSetting.RandomSelectAlgorithm, randomSelectAlgorithm); configManager.BindWith(OsuSetting.RandomSelectAlgorithm, randomSelectAlgorithm);
} }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, OsuConfigManager config) private void load(AudioManager audio, OsuConfigManager config)
{ {
config.BindWith(OsuSetting.VolumeInactive, volumeInactive.Real); config.BindWith(OsuSetting.VolumeInactive, volumeInactive.Linear);
volumeInactive.Scale(); volumeInactive.Scale();
Children = new Drawable[] Children = new Drawable[]
@ -28,27 +28,27 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
new VolumeAdjustSlider new VolumeAdjustSlider
{ {
LabelText = AudioSettingsStrings.MasterVolume, LabelText = AudioSettingsStrings.MasterVolume,
Current = audio.Volume.Scaled, Current = audio.Volume.Decibel,
KeyboardStep = (float)BindableVolume.STEP, KeyboardStep = (float)BindableVolume.STEP,
}, },
new VolumeAdjustSlider new VolumeAdjustSlider
{ {
LabelText = AudioSettingsStrings.MasterVolumeInactive, LabelText = AudioSettingsStrings.MasterVolumeInactive,
Current = volumeInactive.Scaled, Current = volumeInactive.Decibel,
KeyboardStep = (float)BindableVolume.STEP, KeyboardStep = (float)BindableVolume.STEP,
PlaySamplesOnAdjust = true, PlaySamplesOnAdjust = true,
}, },
new VolumeAdjustSlider new VolumeAdjustSlider
{ {
LabelText = AudioSettingsStrings.EffectVolume, LabelText = AudioSettingsStrings.EffectVolume,
Current = audio.VolumeSample.Scaled, Current = audio.VolumeSample.Decibel,
KeyboardStep = (float)BindableVolume.STEP, KeyboardStep = (float)BindableVolume.STEP,
}, },
new VolumeAdjustSlider new VolumeAdjustSlider
{ {
LabelText = AudioSettingsStrings.MusicVolume, LabelText = AudioSettingsStrings.MusicVolume,
Current = audio.VolumeTrack.Scaled, Current = audio.VolumeTrack.Decibel,
KeyboardStep = (float)BindableVolume.STEP, KeyboardStep = (float)BindableVolume.STEP,
}, },
}; };

View File

@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Toolbar
{ {
base.LoadComplete(); base.LoadComplete();
globalVolume = audio.Volume.Scaled.GetBoundCopy(); globalVolume = audio.Volume.Decibel.GetBoundCopy();
globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)(1 - (v.NewValue / BindableVolume.MIN)), 200, Easing.OutQuint), true); globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)(1 - (v.NewValue / BindableVolume.MIN)), 200, Easing.OutQuint), true);
} }

View File

@ -76,9 +76,9 @@ namespace osu.Game.Overlays
}, },
}); });
volumeMeterMaster.Bindable.BindTo(audio.Volume.Scaled); volumeMeterMaster.Bindable.BindTo(audio.Volume.Decibel);
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample.Scaled); volumeMeterEffect.Bindable.BindTo(audio.VolumeSample.Decibel);
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack.Scaled); volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack.Decibel);
} }
protected override void LoadComplete() protected override void LoadComplete()

View File

@ -650,7 +650,7 @@ namespace osu.Game.Screens.Play
{ {
if (!muteWarningShownOnce.Value) if (!muteWarningShownOnce.Value)
{ {
double aggregateVolumeTrack = audioManager.Volume.Real.Value * audioManager.VolumeTrack.Real.Value; double aggregateVolumeTrack = audioManager.Volume.Linear.Value * audioManager.VolumeTrack.Linear.Value;
// Checks if the notification has not been shown yet and also if master volume is muted, track/music volume is muted or if the whole game is muted. // Checks if the notification has not been shown yet and also if master volume is muted, track/music volume is muted or if the whole game is muted.
if (volumeOverlay?.IsMuted.Value == true || Precision.AlmostBigger(volume_requirement, aggregateVolumeTrack)) if (volumeOverlay?.IsMuted.Value == true || Precision.AlmostBigger(volume_requirement, aggregateVolumeTrack))
@ -684,8 +684,8 @@ namespace osu.Game.Screens.Play
// Check values before resetting, as the user may have only had mute enabled, in which case we might not need to adjust volumes. // Check values before resetting, as the user may have only had mute enabled, in which case we might not need to adjust volumes.
// Note that we only restore halfway to ensure the user isn't suddenly overloaded by unexpectedly high volume. // Note that we only restore halfway to ensure the user isn't suddenly overloaded by unexpectedly high volume.
audioManager.Volume.SetFromLinear(Math.Max(audioManager.Volume.Real.Value, 0.5)); audioManager.Volume.SetFromLinear(Math.Max(audioManager.Volume.Linear.Value, 0.5));
audioManager.VolumeTrack.SetFromLinear(Math.Max(audioManager.VolumeTrack.Real.Value, 0.5)); audioManager.VolumeTrack.SetFromLinear(Math.Max(audioManager.VolumeTrack.Linear.Value, 0.5));
return true; return true;
}; };