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:
parent
72ef33554a
commit
0d78b2b181
@ -81,7 +81,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
AddInternal(audioDuckFilter = new AudioFilter(audio.TrackMixer));
|
||||
audio.Tracks.AddAdjustment(AdjustableProperty.Volume, audioDuckVolume);
|
||||
sampleVolume = audio.VolumeSample.Scaled.GetBoundCopy();
|
||||
sampleVolume = audio.VolumeSample.Decibel.GetBoundCopy();
|
||||
|
||||
configManager.BindWith(OsuSetting.RandomSelectAlgorithm, randomSelectAlgorithm);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, OsuConfigManager config)
|
||||
{
|
||||
config.BindWith(OsuSetting.VolumeInactive, volumeInactive.Real);
|
||||
config.BindWith(OsuSetting.VolumeInactive, volumeInactive.Linear);
|
||||
volumeInactive.Scale();
|
||||
|
||||
Children = new Drawable[]
|
||||
@ -28,27 +28,27 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MasterVolume,
|
||||
Current = audio.Volume.Scaled,
|
||||
Current = audio.Volume.Decibel,
|
||||
KeyboardStep = (float)BindableVolume.STEP,
|
||||
},
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MasterVolumeInactive,
|
||||
Current = volumeInactive.Scaled,
|
||||
Current = volumeInactive.Decibel,
|
||||
KeyboardStep = (float)BindableVolume.STEP,
|
||||
PlaySamplesOnAdjust = true,
|
||||
},
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.EffectVolume,
|
||||
Current = audio.VolumeSample.Scaled,
|
||||
Current = audio.VolumeSample.Decibel,
|
||||
KeyboardStep = (float)BindableVolume.STEP,
|
||||
},
|
||||
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MusicVolume,
|
||||
Current = audio.VolumeTrack.Scaled,
|
||||
Current = audio.VolumeTrack.Decibel,
|
||||
KeyboardStep = (float)BindableVolume.STEP,
|
||||
},
|
||||
};
|
||||
|
@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -76,9 +76,9 @@ namespace osu.Game.Overlays
|
||||
},
|
||||
});
|
||||
|
||||
volumeMeterMaster.Bindable.BindTo(audio.Volume.Scaled);
|
||||
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample.Scaled);
|
||||
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack.Scaled);
|
||||
volumeMeterMaster.Bindable.BindTo(audio.Volume.Decibel);
|
||||
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample.Decibel);
|
||||
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack.Decibel);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -650,7 +650,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
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.
|
||||
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.
|
||||
// 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.VolumeTrack.SetFromLinear(Math.Max(audioManager.VolumeTrack.Real.Value, 0.5));
|
||||
audioManager.Volume.SetFromLinear(Math.Max(audioManager.Volume.Linear.Value, 0.5));
|
||||
audioManager.VolumeTrack.SetFromLinear(Math.Max(audioManager.VolumeTrack.Linear.Value, 0.5));
|
||||
|
||||
return true;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user