mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 14:03:07 +08:00
Use volume scaling
This commit is contained in:
parent
dfbc93c3dc
commit
1d8ca0f93d
@ -98,7 +98,7 @@ namespace osu.Game.Configuration
|
||||
SetDefault(OsuSetting.NotifyOnPrivateMessage, true);
|
||||
|
||||
// Audio
|
||||
SetDefault(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
|
||||
SetDefault(OsuSetting.VolumeInactive, 0.25, 0, 1);
|
||||
|
||||
SetDefault(OsuSetting.MenuVoice, true);
|
||||
SetDefault(OsuSetting.MenuMusic, true);
|
||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
AddInternal(audioDuckFilter = new AudioFilter(audio.TrackMixer));
|
||||
audio.Tracks.AddAdjustment(AdjustableProperty.Volume, audioDuckVolume);
|
||||
sampleVolume = audio.VolumeSample.GetBoundCopy();
|
||||
sampleVolume = audio.VolumeSample.Scaled.GetBoundCopy();
|
||||
|
||||
configManager.BindWith(OsuSetting.RandomSelectAlgorithm, randomSelectAlgorithm);
|
||||
}
|
||||
|
@ -15,29 +15,34 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
{
|
||||
protected override LocalisableString Header => AudioSettingsStrings.VolumeHeader;
|
||||
|
||||
private readonly VolumeScaler volumeInactive = new VolumeScaler();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, OsuConfigManager config)
|
||||
{
|
||||
config.BindWith(OsuSetting.VolumeInactive, volumeInactive.Real);
|
||||
volumeInactive.Scale();
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MasterVolume,
|
||||
Current = audio.Volume,
|
||||
Current = audio.Volume.Scaled,
|
||||
KeyboardStep = 0.01f,
|
||||
DisplayAsPercentage = true
|
||||
},
|
||||
new SettingsSlider<double>
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MasterVolumeInactive,
|
||||
Current = config.GetBindable<double>(OsuSetting.VolumeInactive),
|
||||
Current = volumeInactive.Scaled,
|
||||
KeyboardStep = 0.01f,
|
||||
DisplayAsPercentage = true
|
||||
},
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.EffectVolume,
|
||||
Current = audio.VolumeSample,
|
||||
Current = audio.VolumeSample.Scaled,
|
||||
KeyboardStep = 0.01f,
|
||||
DisplayAsPercentage = true
|
||||
},
|
||||
@ -45,7 +50,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
new VolumeAdjustSlider
|
||||
{
|
||||
LabelText = AudioSettingsStrings.MusicVolume,
|
||||
Current = audio.VolumeTrack,
|
||||
Current = audio.VolumeTrack.Scaled,
|
||||
KeyboardStep = 0.01f,
|
||||
DisplayAsPercentage = true
|
||||
},
|
||||
|
@ -77,7 +77,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
globalVolume = audio.Volume.GetBoundCopy();
|
||||
globalVolume = audio.Volume.Scaled.GetBoundCopy();
|
||||
globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)v.NewValue, 200, Easing.OutQuint), true);
|
||||
}
|
||||
|
||||
|
@ -76,9 +76,9 @@ namespace osu.Game.Overlays
|
||||
},
|
||||
});
|
||||
|
||||
volumeMeterMaster.Bindable.BindTo(audio.Volume);
|
||||
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample);
|
||||
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack);
|
||||
volumeMeterMaster.Bindable.BindTo(audio.Volume.Scaled);
|
||||
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample.Scaled);
|
||||
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack.Scaled);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
Reference in New Issue
Block a user